summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INFO.yaml9
-rw-r--r--dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceFactory.java4
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java11
-rw-r--r--dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/DbConfigPool.java5
-rw-r--r--dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/factory/DBConfigFactory.java4
-rw-r--r--dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java29
-rw-r--r--filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java15
-rw-r--r--filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java10
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java30
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicBinaryExpression.java4
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java6
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicGraph.java9
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicLoader.java8
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java19
14 files changed, 93 insertions, 70 deletions
diff --git a/INFO.yaml b/INFO.yaml
index 070df112..e15dda3a 100644
--- a/INFO.yaml
+++ b/INFO.yaml
@@ -33,10 +33,9 @@ committers:
company: 'ATT'
id: 'jh245g'
timezone: 'America/New York'
- - name: 'Ryan Goulding'
- email: 'ryandgoulding@gmail.com'
- company: 'Inocybe Technologies'
- id: 'rgoulding'
- timezone: 'America/New York'
tsc:
approval: 'https://lists.onap.org/pipermail/onap-tsc'
+ changes:
+ - type: 'Deletion'
+ name: 'Ryan Goulding'
+ link: 'https://lists.onap.org/g/onap-tsc/message/4261'
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceFactory.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceFactory.java
index 296fe70f..15aa7a1d 100644
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceFactory.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSourceFactory.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2016 - 2017 ONAP
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -38,7 +40,7 @@ public class CachedDataSourceFactory {
if(config instanceof JDBCConfiguration)
return JdbcDBCachedDataSource.createInstance(config);
- return (CachedDataSource)null;
+ return null;
}
}
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
index 9acae340..047fa297 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2016 - 2017 ONAP
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -68,7 +70,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
transient protected long retryInterval = 10000L;
transient boolean recoveryMode = true;
- SortedSet<CachedDataSource> dsQueue = new ConcurrentSkipListSet<CachedDataSource>(new DataSourceComparator());
+ SortedSet<CachedDataSource> dsQueue = new ConcurrentSkipListSet<>(new DataSourceComparator());
protected final Set<CachedDataSource> broken = Collections.synchronizedSet(new HashSet<CachedDataSource>());
protected final Object monitor = new Object();
protected final Properties configProps;
@@ -80,6 +82,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
protected final long monitoringInitialDelay;
protected final long expectedCompletionTime;
protected final long unprocessedFailoverThreshold;
+ private static final String LOGGER_ALARM_MSG="Generated alarm: DBResourceManager.getData - No active DB connection pools are available.";
public DBResourceManager(final DBLIBResourceProvider configuration) {
this(configuration.getProperties());
@@ -393,7 +396,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
// test if there are any connection pools available
if(this.dsQueue.isEmpty()){
- LOGGER.error("Generated alarm: DBResourceManager.getData - No active DB connection pools are available.");
+ LOGGER.error(LOGGER_ALARM_MSG);
throw new DBLibException("No active DB connection pools are available in RequestDataWithRecovery call.");
}
@@ -457,7 +460,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
private CachedRowSet requestDataNoRecovery(String statement, ArrayList<Object> arguments, String preferredDS) throws SQLException {
if(dsQueue.isEmpty()){
- LOGGER.error("Generated alarm: DBResourceManager.getData - No active DB connection pools are available.");
+ LOGGER.error(LOGGER_ALARM_MSG);
throw new DBLibException("No active DB connection pools are available in RequestDataNoRecovery call.");
}
CachedDataSource active = this.dsQueue.first();
@@ -533,7 +536,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
private boolean writeDataNoRecovery(String statement, ArrayList<Object> arguments, String preferredDS) throws SQLException {
if(dsQueue.isEmpty()){
- LOGGER.error("Generated alarm: DBResourceManager.getData - No active DB connection pools are available.");
+ LOGGER.error(LOGGER_ALARM_MSG);
throw new DBLibException("No active DB connection pools are available in RequestDataNoRecovery call.");
}
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/DbConfigPool.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/DbConfigPool.java
index 21fdab24..fb94ea0e 100644
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/DbConfigPool.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/config/DbConfigPool.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2016 - 2017 ONAP
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -30,7 +32,7 @@ public class DbConfigPool {
private final String type;
- private ArrayList<BaseDBConfiguration> configurations = new ArrayList<BaseDBConfiguration>();
+ private ArrayList<BaseDBConfiguration> configurations = new ArrayList<>();
public DbConfigPool(Properties properties) {
LOGGER.debug("Initializing DbConfigType");
@@ -38,7 +40,6 @@ public class DbConfigPool {
}
public int getTimeout() {
- // TODO Auto-generated method stub
return 0;
}
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/factory/DBConfigFactory.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/factory/DBConfigFactory.java
index c3503576..1aa90783 100644
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/factory/DBConfigFactory.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/factory/DBConfigFactory.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2016 - 2017 ONAP
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -44,7 +46,7 @@ public class DBConfigFactory {
static DbConfigPool getConfigparams(Properties properties) {
DbConfigPool xmlConfig = new DbConfigPool(properties);
- ArrayList<Properties> propertySets = new ArrayList<Properties>();
+ ArrayList<Properties> propertySets = new ArrayList<>();
if ("JDBC".equalsIgnoreCase(xmlConfig.getType())) {
String hosts = properties.getProperty(BaseDBConfiguration.DATABASE_HOSTS);
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java
index 4bfa058a..b44e2f89 100644
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java
@@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicLong;
public class PollingWorker implements Runnable {
- private Logger LOGGER = LoggerFactory.getLogger(PollingWorker.class);
+ private Logger logger = LoggerFactory.getLogger(PollingWorker.class);
private static PollingWorker self = null;
@@ -47,17 +47,6 @@ public class PollingWorker implements Runnable {
private static boolean enabled = false;
private Timer timer = null;
- public static void post(long starttime){
- PollingWorker temp = self;
- if(temp != null && enabled) {
- temp.register(new TestSample(starttime));
- }
- }
-
- public static void createInistance(Properties props){
- self = new PollingWorker(props);
- }
-
private PollingWorker(Properties ctxprops){
if(ctxprops==null || ctxprops.getProperty("org.onap.ccsdk.dblib.pm") == null){
enabled = false;
@@ -89,6 +78,18 @@ public class PollingWorker implements Runnable {
timer.schedule(new MyTimerTask(), interval*1000L, interval*1000L);
}
}
+ public static void post(long starttime){
+ PollingWorker temp = self;
+ if(temp != null && enabled) {
+ temp.register(new TestSample(starttime));
+ }
+ }
+
+ public static void createInistance(Properties props){
+ self = new PollingWorker(props);
+ }
+
+
private void register(TestSample object){
try {
@@ -113,12 +114,14 @@ public class PollingWorker implements Runnable {
consume((TestSample)next);
} else {
System.out.println(next.getClass().getName());
+ logger.error(next.getClass().getName());
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
+
}
}
@@ -146,7 +149,7 @@ public class PollingWorker implements Runnable {
}
sb.append(tmp2[i].get()).append("\t");
}
- LOGGER.info(sb.toString());
+ logger.info(sb.toString());
}
class MyTimerTask extends TimerTask{
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java
index d7a599cb..4481ab90 100644
--- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java
+++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -84,6 +86,7 @@ public class LogFilter implements Filter {
private static final Logger AUDIT = LoggerFactory.getLogger("org.onap.ccsdk.sli.core.filters.audit");
@Override
public void destroy() {
+ // this method does nothing
}
@Override
@@ -111,6 +114,7 @@ public class LogFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
+ // this method does nothing
}
@@ -134,11 +138,7 @@ public class LogFilter implements Filter {
String userName="unknown";
- /* below returning org.opendaylight.aaa.shiro.realm.TokenAuthRealm$ODLPrincipal@745dfcfe
- if ( request.getUserPrincipal() != null) {
- userName = request.getUserPrincipal().getName();
- }
- */
+
// going directly after Authorization header
if (request.getHeader("Authorization") != null) {
String authzHeader = request.getHeader("Authorization");
@@ -164,12 +164,8 @@ public class LogFilter implements Filter {
private void post(HttpServletRequest request,HttpServletResponse response,long startTime) {
- //AUDIT.info("{}|{}|{}{}",request.getRemoteHost(),request.getMethod(),request.getRequestURL().toString(),request.getQueryString());
- //AUDIT.info(request.getRemoteHost() + D + request.getMethod() + D + request.getRequestURL().toString() + D + request.getQueryString());
- //METRIC.info(request.getMethod() + D + response.getStatus() + D + request.getRequestURL().toString() + D + (System.currentTimeMillis() - startTime) + " ms");
MDC.put(BEGIN_TIMESTAMP,asIso8601(startTime));
MDC.put(END_TIMESTAMP,asIso8601(System.currentTimeMillis()));
- //MDC.put(REQUEST_ID,"already done above");
MDC.put(SERVICE_NAME,request.getRequestURL().toString());
int idx = request.getPathInfo().lastIndexOf(':');
String instance = "";
@@ -179,7 +175,6 @@ public class LogFilter implements Filter {
MDC.put(SERVICE_INSTANCE,instance);
MDC.put(THREAD_ID,"");
MDC.put(PHYSICAL_SERVER_NAME,"");
- //MDC.put(PARTNER_NAME,"already done above");
if ( response.getStatus() >= 400 ) {
MDC.put(STATUS_CODE,"ERROR");
} else {
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java
index f5510b9a..7b48a236 100644
--- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java
+++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -70,7 +72,7 @@ public class RequestResponseLoggingFilter implements Filter {
@Override
public void setWriteListener(WriteListener arg0) {
-
+ //this method does nothing
}
}
@@ -131,7 +133,7 @@ public class RequestResponseLoggingFilter implements Filter {
@Override
public void setReadListener(ReadListener arg0) {
-
+ // this method does nothing
}
}
@@ -151,7 +153,7 @@ public class RequestResponseLoggingFilter implements Filter {
InputStream is = req.getInputStream();
baos = new ByteArrayOutputStream();
- byte buf[] = new byte[1024];
+ byte[] buf = new byte[1024];
int letti;
while ((letti = is.read(buf)) > 0) {
baos.write(buf, 0, letti);
@@ -180,6 +182,7 @@ public class RequestResponseLoggingFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
+ //this method does nothing
}
@Override
@@ -259,6 +262,7 @@ public class RequestResponseLoggingFilter implements Filter {
@Override
public void destroy() {
+ //this method does nothing
}
private String decompressGZIPByteArray(byte[] bytes) {
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java
index 2e291023..e22f3925 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/PrintYangToProp.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -53,9 +55,11 @@ public class PrintYangToProp {
private static final Logger LOG = LoggerFactory.getLogger(PrintYangToProp.class);
public static final String PROPERTIES_FILE="";
private static Properties properties;
+ private static final String BUILDER="-builder";
+ private static final String IMPL="-impl";
public static Properties prop = new Properties();
- public static ArrayList<String> propList = new ArrayList<String>();
+ public static ArrayList<String> propList = new ArrayList<>();
public static Properties toProperties(Properties props, Object fromObj) {
@@ -115,14 +119,14 @@ public class PrintYangToProp {
propNamePfx = toLowerHyphen(fromClass.getSimpleName());
}
- if (propNamePfx.endsWith("-builder")) {
+ if (propNamePfx.endsWith(BUILDER)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-builder".length());
+ - BUILDER.length());
}
- if (propNamePfx.endsWith("-impl")) {
+ if (propNamePfx.endsWith(IMPL)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-impl".length());
+ - IMPL.length());
}
}
@@ -486,14 +490,14 @@ public class PrintYangToProp {
propNamePfx = toLowerHyphen(toClass.getSimpleName());
}
- if (propNamePfx.endsWith("-builder")) {
+ if (propNamePfx.endsWith(BUILDER)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-builder".length());
+ - BUILDER.length());
}
- if (propNamePfx.endsWith("-impl")) {
+ if (propNamePfx.endsWith(IMPL)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-impl".length());
+ - IMPL.length());
}
}
@@ -999,14 +1003,14 @@ public class PrintYangToProp {
propNamePfx = toLowerHyphen(toClass.getSimpleName());
}
- if (propNamePfx.endsWith("-builder")) {
+ if (propNamePfx.endsWith(BUILDER)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-builder".length());
+ - BUILDER.length());
}
- if (propNamePfx.endsWith("-impl")) {
+ if (propNamePfx.endsWith(IMPL)) {
propNamePfx = propNamePfx.substring(0, propNamePfx.length()
- - "-impl".length());
+ - IMPL.length());
}
}
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicBinaryExpression.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicBinaryExpression.java
index 45458e8d..a990dd95 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicBinaryExpression.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicBinaryExpression.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -81,7 +83,7 @@ public class SvcLogicBinaryExpression extends SvcLogicExpression {
public SvcLogicBinaryExpression()
{
- operators = new LinkedList<OperatorType>();
+ operators = new LinkedList<>();
}
public void addOperator(String operator)
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
index 3ade88f4..87e8f1a4 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
@@ -302,7 +302,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
throws SvcLogicException {
String deleteGraphSql = "DELETE FROM SVC_LOGIC WHERE module = ? AND rpc = ? AND version = ? AND mode = ?";
- ArrayList<String> args = new ArrayList<String>();
+ ArrayList<String> args = new ArrayList<>();
args.add(module);
args.add(rpc);
@@ -320,7 +320,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
String deactivateSql = "UPDATE SVC_LOGIC SET active = 'N' WHERE module = ? AND rpc = ? AND mode = ?";
String activateSql = "UPDATE SVC_LOGIC SET active = 'Y' WHERE module = ? AND rpc = ? AND mode = ? AND version = ?";
- ArrayList<String> args = new ArrayList<String>();
+ ArrayList<String> args = new ArrayList<>();
args.add(graph.getModule());
args.add(graph.getRpc());
@@ -437,7 +437,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
String activateSql = "UPDATE SVC_LOGIC SET active = 'Y' WHERE module = ? AND rpc = ? AND mode = ? AND version = ?";
- ArrayList<String> args = new ArrayList<String>();
+ ArrayList<String> args = new ArrayList<>();
args.add(module);
args.add(rpc);
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicGraph.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicGraph.java
index cbac1544..97f2bd7a 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicGraph.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicGraph.java
@@ -1,10 +1,13 @@
/*-
- * ============LICENSE_START=======================================================
+x * ============LICENSE_START=======================================================
* ONAP : CCSDK
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications copyright (C) 2017 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -46,8 +49,8 @@ public class SvcLogicGraph implements Serializable {
public SvcLogicGraph()
{
- attributes = new HashMap<String, Serializable>();
- namedNodes = new HashMap<String, SvcLogicNode>();
+ attributes = new HashMap<>();
+ namedNodes = new HashMap<>();
rootNode = null;
}
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicLoader.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicLoader.java
index d50c371c..433b723e 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicLoader.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicLoader.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -62,7 +64,7 @@ public class SvcLogicLoader {
}
protected List<ActivationEntry> processActivationFiles(List<Path> activationPaths) {
- List<ActivationEntry> activationEntries = new ArrayList<ActivationEntry>();
+ List<ActivationEntry> activationEntries = new ArrayList<>();
for (Path activationFile : activationPaths) {
activationEntries.addAll(getActivationEntries(activationFile));
}
@@ -104,7 +106,7 @@ public class SvcLogicLoader {
return activationEntries;
} catch (IOException ioe) {
LOGGER.error("Couldn't read the activation file at " + activationFilePath, ioe);
- return null;
+ return new ArrayList<>();
}
}
@@ -167,7 +169,7 @@ public class SvcLogicLoader {
public void bulkActivate() {
Path activationFile = Paths.get(directoryRoot);
- List<Path> pathList = new ArrayList<Path>(1);
+ List<Path> pathList = new ArrayList<>(1);
pathList.add(activationFile);
List<ActivationEntry> activationEntries = processActivationFiles(pathList);
activateGraphs(activationEntries);
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java
index 45f68351..72cfea50 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -31,6 +33,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.HashSet;
import java.util.TreeMap;
import org.apache.commons.lang3.StringEscapeUtils;
@@ -61,8 +64,8 @@ public class SvcLogicNode implements Serializable {
nodeName = "";
this.nodeType = nodeType;
this.graph = graph;
- attributes = new HashMap<String, SvcLogicExpression> ();
- parameters = new HashMap<String, SvcLogicExpression> ();
+ attributes = new HashMap<> ();
+ parameters = new HashMap<> ();
outcomes = null;
}
@@ -73,8 +76,8 @@ public class SvcLogicNode implements Serializable {
this.nodeName = nodeName;
this.nodeType = nodeType;
this.graph = graph;
- attributes = new HashMap<String, SvcLogicExpression> ();
- parameters = new HashMap<String, SvcLogicExpression> ();
+ attributes = new HashMap<> ();
+ parameters = new HashMap<> ();
outcomes = null;
graph.setNamedNode(nodeName, this);
}
@@ -224,7 +227,7 @@ public class SvcLogicNode implements Serializable {
{
if (outcomes == null)
{
- outcomes = new HashMap<String, SvcLogicNode>();
+ outcomes = new HashMap<>();
}
if (outcomeValue.length() == 0) {
@@ -242,7 +245,7 @@ public class SvcLogicNode implements Serializable {
{
if (outcomes == null)
{
- return null;
+ return new HashSet<>();
}
return outcomes.entrySet();
@@ -253,7 +256,7 @@ public class SvcLogicNode implements Serializable {
{
if (parameters == null)
{
- return null;
+ return new HashSet<>();
}
return parameters.entrySet();
@@ -307,7 +310,7 @@ public class SvcLogicNode implements Serializable {
if (outcomes != null)
{
- TreeMap<String, SvcLogicNode> sortedOutcomes = new TreeMap<String, SvcLogicNode>(outcomes);
+ TreeMap<String, SvcLogicNode> sortedOutcomes = new TreeMap<>(outcomes);
Set<Map.Entry<String, SvcLogicNode>> outcomeSet = sortedOutcomes.entrySet();
for (Iterator<Map.Entry<String, SvcLogicNode>> iter = outcomeSet.iterator(); iter.hasNext();)