aboutsummaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-iaas-adapter
diff options
context:
space:
mode:
authorDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-22 15:17:52 +0530
committerPatrick Brady <patrick.brady@att.com>2019-01-30 21:46:44 +0000
commit9c9ba25dd74787ca0a6cd0e5811d7b56708acaa4 (patch)
treee79558df1d22d4a5a20bb932c84a9accc0189b55 /appc-adapters/appc-iaas-adapter
parent09da4f91bcfe2e9fb3eab992f2ead8c424a1cfad (diff)
Multiple Sonar Fixes
Multiple Sonar Fixes Issue-ID: APPC-1353 Change-Id: I5bdf2119e886a58606bf6192b97c9ae43e4e0069 Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
Diffstat (limited to 'appc-adapters/appc-iaas-adapter')
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ProviderAdapterImpl.java12
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/RequestContext.java5
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java6
3 files changed, 10 insertions, 13 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ProviderAdapterImpl.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ProviderAdapterImpl.java
index cd14ffadc..8c0a61bed 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ProviderAdapterImpl.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ProviderAdapterImpl.java
@@ -40,8 +40,6 @@ import org.onap.appc.util.StructuredPropertyHelper.Node;
import com.att.cdp.zones.model.Image;
import com.att.cdp.zones.model.Server;
import com.att.cdp.zones.model.Stack;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import java.util.HashMap;
import java.util.List;
@@ -274,7 +272,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
String userId = null;
String password = null;
// domain is not required so set a default
- String domain = DEFAULT_DOMAIN_NAME;
+ String domain = ProviderAdapterImpl.DEFAULT_DOMAIN_NAME;
for (Node node2 : node.getChildren()) {
switch (node2.getName()) {
case Property.PROVIDER_TENANT_NAME:
@@ -282,16 +280,18 @@ public class ProviderAdapterImpl implements ProviderAdapter {
break;
case Property.PROVIDER_TENANT_USERID:
userId = node2.getValue();
- DEFAULT_USER = node2.getValue();
+ ProviderAdapterImpl.DEFAULT_USER = node2.getValue();
break;
case Property.PROVIDER_TENANT_PASSWORD:
// convert password from Base64 encrypted string prefixed with 'enc:'
password = EncryptionTool.getInstance().encrypt(node2.getValue());
- DEFAULT_PASS = node2.getValue();
+ ProviderAdapterImpl.DEFAULT_PASS = node2.getValue();
break;
case Property.PROVIDER_TENANT_DOMAIN:
domain = node2.getValue();
- DEFAULT_DOMAIN = node2.getValue();
+ ProviderAdapterImpl.DEFAULT_DOMAIN = node2.getValue();
+ break;
+ default:
break;
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/RequestContext.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/RequestContext.java
index 2456e274b..8c2833dfc 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/RequestContext.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/RequestContext.java
@@ -193,10 +193,7 @@ public class RequestContext {
}
accumulatedTime += (now - startTime);
startTime = now;
- if (accumulatedTime > timeToLive) {
- return false;
- }
- return true;
+ return !(accumulatedTime > timeToLive);
}
/**
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java
index 73872040b..4fe0c2e33 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/ServiceCatalogV2.java
@@ -312,9 +312,9 @@ public class ServiceCatalogV2 extends ServiceCatalog {
}
}
builder.append(String.format("%d services:%n", serviceEndpoints.size())); //$NON-NLS-1$
- for (String serviceType : serviceEndpoints.keySet()) {
- List<Service.Endpoint> endpoints = serviceEndpoints.get(serviceType);
- Service service = serviceTypes.get(serviceType);
+ for(Map.Entry<String, List<Access.Service.Endpoint>> entry : serviceEndpoints.entrySet()){
+ List<Service.Endpoint> endpoints = entry.getValue();
+ Service service = serviceTypes.get(entry.getKey());
builder.append(String.format("\t%s [%s] - %d endpoints%n", service.getType(), service.getName(), //$NON-NLS-1$
endpoints.size()));