summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java20
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java6
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java54
4 files changed, 42 insertions, 42 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
index cf8e94a733..b4e7b7e068 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
@@ -51,7 +51,7 @@ public class CamundaTaskClient extends RequestClient{
StringEntity input = new StringEntity(jsonReq);
input.setContentType(CommonConstants.CONTENT_TYPE_JSON);
- String encryptedCredentials = null;
+ String encryptedCredentials;
if(props!=null){
encryptedCredentials = props.getProperty(CommonConstants.CAMUNDA_AUTH,null);
if(encryptedCredentials != null){
@@ -92,7 +92,7 @@ public class CamundaTaskClient extends RequestClient{
throws ClientProtocolException, IOException{
HttpGet get = new HttpGet(url);
msoLogger.debug("Camunda Task url is: "+ url);
- String encryptedCredentials = null;
+ String encryptedCredentials;
if(props!=null){
encryptedCredentials = props.getProperty(CommonConstants.CAMUNDA_AUTH,null);
if(encryptedCredentials != null){
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java
index e90989deb8..6722a930ae 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ResponseHandler.java
@@ -131,36 +131,36 @@ public class ResponseHandler {
}
private int setStatus(int statusCode){
- int status = 0;
+ int httpStatus;
switch(statusCode) {
case HttpStatus.SC_ACCEPTED:
case HttpStatus.SC_OK:
- status = HttpStatus.SC_ACCEPTED;
+ httpStatus = HttpStatus.SC_ACCEPTED;
break;
case HttpStatus.SC_BAD_REQUEST:
- status = HttpStatus.SC_BAD_REQUEST;
+ httpStatus = HttpStatus.SC_BAD_REQUEST;
break;
case HttpStatus.SC_UNAUTHORIZED:
case HttpStatus.SC_FORBIDDEN:
- status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR;
break;
case HttpStatus.SC_NOT_FOUND:
- status = HttpStatus.SC_NOT_IMPLEMENTED;
+ httpStatus = HttpStatus.SC_NOT_IMPLEMENTED;
break;
case HttpStatus.SC_INTERNAL_SERVER_ERROR:
- status = HttpStatus.SC_BAD_GATEWAY;
+ httpStatus = HttpStatus.SC_BAD_GATEWAY;
break;
case HttpStatus.SC_SERVICE_UNAVAILABLE:
- status = HttpStatus.SC_SERVICE_UNAVAILABLE;
+ httpStatus = HttpStatus.SC_SERVICE_UNAVAILABLE;
break;
case HttpStatus.SC_NO_CONTENT:
- status = HttpStatus.SC_NO_CONTENT;
+ httpStatus = HttpStatus.SC_NO_CONTENT;
break;
default:
- status = HttpStatus.SC_INTERNAL_SERVER_ERROR;
+ httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR;
break;
}
- return status;
+ return httpStatus;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
index 8ee106efc1..9b975facc6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
@@ -586,20 +586,20 @@ public class MsoRequest {
public Map<String, List<String>> getOrchestrationFilters (MultivaluedMap<String, String> queryParams) throws ValidationException {
String queryParam = null;
- Map<String, List<String>> orchestrationFilterParams = new HashMap<String, List<String>>();
+ Map<String, List<String>> orchestrationFilterParams = new HashMap<>();
for (Entry<String,List<String>> entry : queryParams.entrySet()) {
queryParam = entry.getKey();
try{
- if(queryParam.equalsIgnoreCase("filter")){
+ if("filter".equalsIgnoreCase(queryParam)){
for(String value : entry.getValue()) {
StringTokenizer st = new StringTokenizer(value, ":");
int counter=0;
String mapKey=null;
- List<String> orchestrationList = new ArrayList<String>();
+ List<String> orchestrationList = new ArrayList<>();
while (st.hasMoreElements()) {
if(counter == 0){
mapKey = st.nextElement() + "";
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
index 254ae3bf39..b426c39176 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
@@ -226,37 +226,37 @@ public class RequestsDatabase {
if(instanceName != null && !instanceName.equals("")) {
- if(requestScope.equals("service")){
+ if("service".equals(requestScope)){
criteria.add (Restrictions.eq (SERVICE_INSTANCE_NAME, instanceName));
- } else if(requestScope.equals("vnf")){
+ } else if("vnf".equals(requestScope)){
criteria.add (Restrictions.eq (VNF_INSTANCE_NAME, instanceName));
- } else if(requestScope.equals("volumeGroup")){
+ } else if("volumeGroup".equals(requestScope)){
criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_NAME, instanceName));
- } else if(requestScope.equals("vfModule")){
+ } else if("vfModule".equals(requestScope)){
criteria.add (Restrictions.eq (VFMODULE_INSTANCE_NAME, instanceName));
- } else if(requestScope.equals("network")){
+ } else if("network".equals(requestScope)){
criteria.add (Restrictions.eq (NETWORK_INSTANCE_NAME, instanceName));
}
} else {
if(instanceIdMap != null){
- if(requestScope.equals("service") && instanceIdMap.get("serviceInstanceId") != null){
+ if("service".equals(requestScope) && instanceIdMap.get("serviceInstanceId") != null){
criteria.add (Restrictions.eq (SERVICE_INSTANCE_ID, instanceIdMap.get("serviceInstanceId")));
}
- if(requestScope.equals("vnf") && instanceIdMap.get("vnfInstanceId") != null){
+ if("vnf".equals(requestScope) && instanceIdMap.get("vnfInstanceId") != null){
criteria.add (Restrictions.eq (VNF_INSTANCE_ID, instanceIdMap.get("vnfInstanceId")));
}
- if(requestScope.equals("vfModule") && instanceIdMap.get("vfModuleInstanceId") != null){
+ if("vfModule".equals(requestScope) && instanceIdMap.get("vfModuleInstanceId") != null){
criteria.add (Restrictions.eq (VFMODULE_INSTANCE_ID, instanceIdMap.get("vfModuleInstanceId")));
}
- if(requestScope.equals("volumeGroup") && instanceIdMap.get("volumeGroupInstanceId") != null){
+ if("volumeGroup".equals(requestScope) && instanceIdMap.get("volumeGroupInstanceId") != null){
criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_ID, instanceIdMap.get("volumeGroupInstanceId")));
}
- if(requestScope.equals("network") && instanceIdMap.get("networkInstanceId") != null){
+ if("network".equals(requestScope) && instanceIdMap.get("networkInstanceId") != null){
criteria.add (Restrictions.eq (NETWORK_INSTANCE_ID, instanceIdMap.get("networkInstanceId")));
}
}
@@ -270,7 +270,7 @@ public class RequestsDatabase {
InfraActiveRequests infraActiveRequests = null;
- if(dupList != null && dupList.size() > 0){
+ if(dupList != null && !dupList.isEmpty()){
infraActiveRequests = dupList.get(0);
}
@@ -284,40 +284,40 @@ public class RequestsDatabase {
for (Map.Entry<String, List<String>> entry : orchestrationMap.entrySet())
{
String mapKey = entry.getKey();
- if(mapKey.equalsIgnoreCase("serviceInstanceId")) {
+ if("serviceInstanceId".equalsIgnoreCase(mapKey)) {
mapKey = "serviceInstanceId";
- } else if(mapKey.equalsIgnoreCase("serviceInstanceName")) {
+ } else if("serviceInstanceName".equalsIgnoreCase(mapKey)) {
mapKey = "serviceInstanceName";
- } else if(mapKey.equalsIgnoreCase("vnfInstanceId")){
+ } else if("vnfInstanceId".equalsIgnoreCase(mapKey)){
mapKey = "vnfId";
- } else if(mapKey.equalsIgnoreCase("vnfInstanceName")) {
+ } else if("vnfInstanceName".equalsIgnoreCase(mapKey)) {
mapKey = "vnfName";
- } else if(mapKey.equalsIgnoreCase("vfModuleInstanceId")) {
+ } else if("vfModuleInstanceId".equalsIgnoreCase(mapKey)) {
mapKey = "vfModuleId";
- } else if(mapKey.equalsIgnoreCase("vfModuleInstanceName")) {
+ } else if("vfModuleInstanceName".equalsIgnoreCase(mapKey)) {
mapKey = "vfModuleName";
- } else if(mapKey.equalsIgnoreCase("volumeGroupInstanceId")) {
+ } else if("volumeGroupInstanceId".equalsIgnoreCase(mapKey)) {
mapKey = "volumeGroupId";
- } else if(mapKey.equalsIgnoreCase("volumeGroupInstanceName")) {
+ } else if("volumeGroupInstanceName".equalsIgnoreCase(mapKey)) {
mapKey = "volumeGroupName";
- } else if(mapKey.equalsIgnoreCase("networkInstanceId")) {
+ } else if("networkInstanceId".equalsIgnoreCase(mapKey)) {
mapKey = "networkId";
- } else if(mapKey.equalsIgnoreCase("networkInstanceName")) {
+ } else if("networkInstanceName".equalsIgnoreCase(mapKey)) {
mapKey = "networkName";
- } else if(mapKey.equalsIgnoreCase("lcpCloudRegionId")) {
+ } else if("lcpCloudRegionId".equalsIgnoreCase(mapKey)) {
mapKey = "aicCloudRegion";
- } else if(mapKey.equalsIgnoreCase("tenantId")) {
+ } else if("tenantId".equalsIgnoreCase(mapKey)) {
mapKey = "tenantId";
- } else if(mapKey.equalsIgnoreCase("modelType")) {
+ } else if("modelType".equalsIgnoreCase(mapKey)) {
mapKey = "requestScope";
- } else if(mapKey.equalsIgnoreCase("requestorId")) {
+ } else if("requestorId".equalsIgnoreCase(mapKey)) {
mapKey = "requestorId";
- } else if(mapKey.equalsIgnoreCase("requestExecutionDate")) {
+ } else if("requestExecutionDate".equalsIgnoreCase(mapKey)) {
mapKey = "startTime";
}
String propertyValue = entry.getValue().get(1);
- if (mapKey.equals("startTime")) {
+ if ("startTime".equals(mapKey)) {
SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");
try {
Date thisDate = format.parse(propertyValue);