summaryrefslogtreecommitdiffstats
path: root/aai-service/provider/src
diff options
context:
space:
mode:
Diffstat (limited to 'aai-service/provider/src')
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java10
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java3
-rw-r--r--aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java8
3 files changed, 11 insertions, 10 deletions
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 cf1392f67..a3aecda14 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
@@ -44,7 +44,6 @@ import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Properties;
-import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
@@ -82,6 +81,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
private String userPassword;
private final String applicationId;
private static final String HTTP_URL_CONNECTION_RESULT="HttpURLConnection result: {} : {}";
+ private static final String ENTRY_DOESNT_EXIST="Entry does not exist.";
/**
* class Constructor
@@ -281,7 +281,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, responseMessage, mapper.writeValueAsString(response));
}
} else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) {
- LOGwriteEndingTrace(responseCode, responseMessage, "Entry does not exist.");
+ LOGwriteEndingTrace(responseCode, responseMessage, ENTRY_DOESNT_EXIST);
ErrorResponse errorresponse = null;
try {
errorresponse = mapper.readValue(reader, ErrorResponse.class);
@@ -289,7 +289,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
errorresponse = new ErrorResponse();
RequestError requestError = new RequestError();
ServiceException serviceException = new ServiceException();
- serviceException.setText("Entry does not exist.");
+ serviceException.setText(ENTRY_DOESNT_EXIST);
requestError.setServiceException(serviceException);
errorresponse.setRequestError(requestError );
}
@@ -501,7 +501,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
LOGwriteEndingTrace(responseCode, responseMessage, stringBuilder.toString());
response = true;
} else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) {
- LOGwriteEndingTrace(responseCode, responseMessage, "Entry does not exist.");
+ LOGwriteEndingTrace(responseCode, responseMessage, ENTRY_DOESNT_EXIST);
response = false;
} else {
ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class);
@@ -574,7 +574,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface {
response = mapper.readValue(reader, clas);
LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", mapper.writeValueAsString(response));
} else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) {
- LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist.");
+ LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", ENTRY_DOESNT_EXIST);
return response;
} else {
BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) );
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
index 82df69818..c66ae06f4 100755
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java
@@ -433,8 +433,7 @@ public abstract class AAIRequest {
if(clazz == null) {
return null;
}
- GenericRequest request = new GenericRequest(clazz);
- return request;
+ return new GenericRequest(clazz);
}
public static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException {
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java
index 515359602..35f190e52 100644
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.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
@@ -104,19 +106,19 @@ public class GenericQueryRequest extends AAIRequest {
String encoded_vnf = encodeQuery(requestProperties.getProperty(key));
request_url = request_url.replace("{identifier}", encoded_vnf) ;
- aaiService.LOGwriteDateTrace("identifier", requestProperties.getProperty(key));
+ aaiService.LOGwriteDateTrace(IDENTIFIER, requestProperties.getProperty(key));
key = VALUE;
encoded_vnf = encodeQuery(requestProperties.getProperty(key));
request_url = request_url.replace("{value}", encoded_vnf) ;
- aaiService.LOGwriteDateTrace("value", requestProperties.getProperty(key));
+ aaiService.LOGwriteDateTrace(VALUE, requestProperties.getProperty(key));
key = START_NODE_TYPE;
encoded_vnf = encodeQuery(requestProperties.getProperty(key));
request_url = request_url.replace("{start-node-type}", encoded_vnf) ;
- aaiService.LOGwriteDateTrace("start-node-type", requestProperties.getProperty(key));
+ aaiService.LOGwriteDateTrace(START_NODE_TYPE, requestProperties.getProperty(key));
return request_url;
}