summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java3
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java6
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java21
-rw-r--r--ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/model/AnsibleMessageParser.java7
-rw-r--r--resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ReleaseFunction.java5
-rw-r--r--resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/AllocationItemJdbcDaoImpl.java3
6 files changed, 26 insertions, 19 deletions
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java
index 56b092e6..6af6ad6a 100755
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java
@@ -34,9 +34,6 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-
public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
public SearchResults requestServiceInstanceURL(String svcInstanceId) throws AAIServiceException;
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
index dd39ba9b..cf1392f6 100755
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java
@@ -144,7 +144,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
String extension = keystorePath.substring(keystorePath.lastIndexOf(".") + 1);
- if(extension != null && !extension.isEmpty() && extension.equalsIgnoreCase("JKS")) {
+ if(extension != null && !extension.isEmpty() && "JKS".equalsIgnoreCase(extension)) {
storeType = "JKS";
}
KeyStore ks = KeyStore.getInstance(storeType);
@@ -611,7 +611,8 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
}
URL requestUrl = null;
- HttpURLConnection con = getConfiguredConnection(requestUrl = request.getRequestUrl("PATCH", resourceVersion), "PATCH");
+ requestUrl = request.getRequestUrl("PATCH", resourceVersion);
+ HttpURLConnection con = getConfiguredConnection(requestUrl, "PATCH");
ObjectMapper mapper = AAIService.getObjectMapper();
String jsonText = request.toJSONString();
@@ -633,6 +634,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
try {
responseMessage = con.getResponseMessage();
} catch(Exception exc) {
+ LOG.info("Exception occured", exc.getMessage());
responseMessage = EnglishReasonPhraseCatalog.INSTANCE.getReason(responseCode,null);
} finally {
if(responseMessage == null)
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java
index 3b121126..4a3f9236 100755
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.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
@@ -140,7 +142,8 @@ public abstract class AAIDeclarations implements AAIClient {
public static final String QUERY_NODES_PATH = "org.onap.ccsdk.sli.adaptors.aai.query.nodes";
private static final String VERSION_PATTERN = "/v$/";
-
+
+ private static final String AAI_SERVICE_EXCEPTION = "AAI Service Exception";
protected abstract Logger getLogger();
public abstract AAIExecutorInterface getExecutor();
@@ -285,7 +288,7 @@ public abstract class AAIDeclarations implements AAIClient {
try {
vserverUrl = this.requestVserverURLNodeQuery(vserverName);
} catch (AAIServiceException aaiexc) {
- getLogger().warn("AAI Service Exception", aaiexc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, aaiexc);
ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage());
if (aaiexc.getReturnCode() >= 300) {
ctx.setAttribute(prefix + ".error.http" + "" + ".response-code", Integer.toString(aaiexc.getReturnCode()));
@@ -308,7 +311,7 @@ public abstract class AAIDeclarations implements AAIClient {
try {
vserver = this.requestVServerDataByURL(vserverUrl);
} catch (AAIServiceException aaiexc) {
- getLogger().warn("AAI Service Exception", aaiexc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, aaiexc);
ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage());
if (aaiexc.getReturnCode() >= 300) {
ctx.setAttribute(prefix + ".error.http" + ".response-code", Integer.toString(aaiexc.getReturnCode()));
@@ -601,7 +604,7 @@ public abstract class AAIDeclarations implements AAIClient {
request.processRequestPathValues(nameValues);
getExecutor().patch(request, resourceVersion);
} catch(AAIServiceException aaiexc) {
- getLogger().warn("AAI Service Exception", aaiexc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, aaiexc);
if(aaiexc.getReturnCode() == 404)
return QueryStatus.NOT_FOUND;
else
@@ -674,7 +677,7 @@ public abstract class AAIDeclarations implements AAIClient {
return QueryStatus.SUCCESS;
}
} catch(AAIServiceException aaiexc) {
- getLogger().warn("AAI Service Exception", aaiexc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, aaiexc);
if(aaiexc.getReturnCode() == 404)
return QueryStatus.NOT_FOUND;
else
@@ -796,7 +799,7 @@ public abstract class AAIDeclarations implements AAIClient {
retval = processResponseData(rv, resource, request, prefix, ctx, nameValues, modifier);
} catch(AAIServiceException aaiexc) {
- getLogger().warn("AAI Service Exception", aaiexc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, aaiexc);
int errorCode = aaiexc.getReturnCode();
ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage());
if(errorCode >= 300) {
@@ -1009,7 +1012,7 @@ public abstract class AAIDeclarations implements AAIClient {
String rv = getExecutor().get(request);
ctx.setAttribute(prefix, rv);
} catch(AAIServiceException aaiexc) {
- getLogger().warn("AAI Service Exception", aaiexc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, aaiexc);
if(aaiexc.getReturnCode() == 404)
return QueryStatus.NOT_FOUND;
@@ -1148,7 +1151,7 @@ public abstract class AAIDeclarations implements AAIClient {
setters.put(id, setter);
}
} catch(Exception exc) {
- getLogger().warn("AAI Service Exception", exc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, exc);
}
Method getter;
@@ -1158,7 +1161,7 @@ public abstract class AAIDeclarations implements AAIClient {
getters.put(id, getter);
}
} catch(Exception exc) {
- getLogger().warn("AAI Service Exception", exc);
+ getLogger().warn(AAI_SERVICE_EXCEPTION, exc);
}
}
diff --git a/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/model/AnsibleMessageParser.java b/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/model/AnsibleMessageParser.java
index 6e2244ff..427149cc 100644
--- a/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/model/AnsibleMessageParser.java
+++ b/ansible-adapter/ansible-adapter-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/model/AnsibleMessageParser.java
@@ -67,6 +67,7 @@ public class AnsibleMessageParser {
private static final String VERSION_OPT_KEY = "Version";
private static final String ACTION_OPT_KEY = "Action";
+ private String jsonException = "JSON exception";
private static final Logger LOGGER = LoggerFactory.getLogger(AnsibleMessageParser.class);
/**
@@ -153,7 +154,7 @@ public class AnsibleMessageParser {
ansibleResult = new AnsibleResult(code, msg);
} catch (JSONException e) {
- LOGGER.error("JSON exception", e);
+ LOGGER.error(jsonException, e);
ansibleResult = new AnsibleResult(600, "Error parsing response = " + input + ". Error = " + e.getMessage());
}
return ansibleResult;
@@ -171,7 +172,7 @@ public class AnsibleMessageParser {
JSONObject postResponse = new JSONObject(input);
ansibleResult = parseGetResponseNested(ansibleResult, postResponse);
} catch (JSONException e) {
- LOGGER.error("JSON exception", e);
+ LOGGER.error(jsonException, e);
ansibleResult = new AnsibleResult(AnsibleResultCodes.INVALID_PAYLOAD.getValue(),
"Error parsing response = " + input + ". Error = " + e.getMessage(), "");
}
@@ -222,7 +223,7 @@ public class AnsibleMessageParser {
finalCode = AnsibleResultCodes.REQ_FAILURE.getValue();
}
} catch (JSONException e) {
- LOGGER.error("JSON exception", e);
+ LOGGER.error(jsonException, e);
ansibleResult.setStatusCode(AnsibleResultCodes.INVALID_RESPONSE.getValue());
ansibleResult.setStatusMessage(String.format(
"Error processing response message = %s from host %s", results.getString(host), host));
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ReleaseFunction.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ReleaseFunction.java
index 17641845..b26c54cf 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ReleaseFunction.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ReleaseFunction.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
+ * Modifications Copyright © 2018 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +42,9 @@ class ReleaseFunction extends SynchronizedFunction {
private ResourceDao resourceDao;
- private String resourceSetId, resourceUnionId, assetId;
+ private String resourceSetId;
+ private String resourceUnionId;
+ private String assetId;
public ReleaseFunction(LockHelper lockHelper, ResourceDao resourceDao, String resourceSetId, String resourceUnionId,
String assetId, Collection<String> lockNames, int lockTimeout) {
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/AllocationItemJdbcDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/AllocationItemJdbcDaoImpl.java
index fcde0f8f..2a62c63a 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/AllocationItemJdbcDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/dao/jdbc/AllocationItemJdbcDaoImpl.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
+ * Modifications Copyright © 2018 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -110,7 +111,7 @@ public class AllocationItemJdbcDaoImpl implements AllocationItemJdbcDao {
}
if (resourceShareGroupFilter != null) {
- if (resourceShareGroupFilter.equalsIgnoreCase("null")) {
+ if (("null").equalsIgnoreCase(resourceShareGroupFilter)) {
sql += " AND resource_share_group_list IS NULL";
} else {
sql += " AND resource_share_group_list LIKE '" + resourceShareGroupFilter + "'";