summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorr.bogacki <r.bogacki@samsung.com>2019-07-09 13:05:34 +0200
committerr.bogacki <r.bogacki@samsung.com>2019-07-09 13:05:52 +0200
commitb20e6a4b1a26a67396df68c047045c64c068490e (patch)
treeec473cc0601bfe589c6273883283e28fca996c29
parentab9522a55b6cf8dd2137f635b1accef60de34d20 (diff)
Major Sonar fixes in E2EServiceInstances
Major code fixes in E2EServiceInstances according to the Sonar analysis. -Removed unnecessary code. -Removed unnecessary method parameters. -Removed unused variables. Issue-ID: SO-2099 Signed-off-by: Robert Bogacki <r.bogacki@samsung.com> Change-Id: I0e217174455a6748c663b3d5cc92fdc22b67ce2d
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java37
1 files changed, 10 insertions, 27 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
index fdc51ffe24..d162ccde65 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
@@ -140,7 +140,7 @@ public class E2EServiceInstances {
instanceIdMap.put("serviceId", serviceId);
- return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap, version);
+ return updateE2EserviceInstances(request, Action.updateInstance, version);
}
/**
@@ -188,7 +188,7 @@ public class E2EServiceInstances {
logger.debug("------------------scale begin------------------");
instanceIdMap.put("serviceId", serviceId);
- return scaleE2EserviceInstances(request, Action.scaleInstance, instanceIdMap, version);
+ return scaleE2EserviceInstances(request, Action.scaleInstance, version);
}
/**
@@ -251,8 +251,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
-
try {
requestClient = requestClientFactory.getRequestClient(workflowUrl);
@@ -291,8 +289,7 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
private Response getE2EServiceInstance(String serviceId, String operationId, String version) {
@@ -301,8 +298,6 @@ public class E2EServiceInstances {
String apiVersion = version.substring(1);
- long startTime = System.currentTimeMillis();
-
OperationStatus operationStatus;
try {
@@ -392,7 +387,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
try {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
@@ -436,12 +430,10 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
- private Response updateE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
- String version) throws ApiException {
+ private Response updateE2EserviceInstances(String requestJSON, Action action, String version) throws ApiException {
String requestId = UUID.randomUUID().toString();
long startTime = System.currentTimeMillis();
@@ -513,7 +505,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
String sirRequestJson = convertToString(sir);
try {
@@ -554,8 +545,7 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(serviceId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
private Response processE2EserviceInstances(String requestJSON, Action action,
@@ -629,7 +619,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
String sirRequestJson = convertToString(sir);
try {
@@ -668,12 +657,10 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
- private Response scaleE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
- String version) throws ApiException {
+ private Response scaleE2EserviceInstances(String requestJSON, Action action, String version) throws ApiException {
String requestId = UUID.randomUUID().toString();
long startTime = System.currentTimeMillis();
@@ -728,7 +715,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
try {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
@@ -772,12 +758,10 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
- private Response beplStatusUpdate(String serviceId, long startTime, RequestClient requestClient,
- ResponseHandler respHandler, int bpelStatus, Action action, HashMap<String, String> instanceIdMap,
+ private Response beplStatusUpdate(RequestClient requestClient, ResponseHandler respHandler, int bpelStatus,
String version) {
String apiVersion = version.substring(1);
@@ -876,7 +860,6 @@ public class E2EServiceInstances {
ServiceInstancesRequest sir = new ServiceInstancesRequest();
- String returnString = null;
RequestDetails requestDetails = new RequestDetails();
ModelInfo modelInfo = new ModelInfo();