aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java186
1 files changed, 92 insertions, 94 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
index 37600f7b9..2ff337653 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -22,10 +22,6 @@ package org.onap.vid.mso.rest;
import com.google.common.collect.ImmutableMap;
import io.joshworks.restclient.http.HttpResponse;
-import java.util.HashMap;
-import java.util.Map;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
import org.apache.commons.codec.binary.Base64;
import org.eclipse.jetty.util.security.Password;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
@@ -35,17 +31,21 @@ import org.onap.vid.changeManagement.RequestDetailsWrapper;
import org.onap.vid.client.SyncRestClient;
import org.onap.vid.model.RequestReferencesContainer;
import org.onap.vid.mso.*;
+import org.onap.vid.utils.Logging;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.onap.vid.utils.Logging;
+import java.util.HashMap;
+import java.util.Map;
/**
* Created by pickjonathan on 21/06/2017.
*/
-public class MsoRestClientNew implements MsoInterface {
+public class MsoRestClientNew extends RestMsoImplementation implements MsoInterface {
/**
* The Constant dateFormat.
@@ -70,7 +70,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "createSvcInstance ";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetails, path);
@@ -79,7 +79,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper createE2eSvcInstance(Object requestDetails, String endpoint) {
String methodName = "createE2eSvcInstance ";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetails, path);
@@ -89,7 +89,7 @@ public class MsoRestClientNew implements MsoInterface {
public MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) {
String methodName = "createVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetails, path);
@@ -99,7 +99,7 @@ public class MsoRestClientNew implements MsoInterface {
public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "createNwInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetails, path);
@@ -108,7 +108,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "createVolumeGroupInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetails, path);
@@ -117,7 +117,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "createVfModuleInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetails, path);
@@ -126,7 +126,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper scaleOutVFModuleInstance(RequestDetailsWrapper requestDetailsWrapper, String endpoint) {
String methodName = "scaleOutVFModuleInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetailsWrapper, path);
}
@@ -134,7 +134,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper createConfigurationInstance(org.onap.vid.mso.rest.RequestDetailsWrapper requestDetailsWrapper, String endpoint) {
String methodName = "createConfigurationInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return createInstance(requestDetailsWrapper, path);
@@ -143,7 +143,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint) {
String methodName = "deleteE2eSvcInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return deleteInstance(requestDetails, path);
}
@@ -151,7 +151,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "deleteSvcInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return deleteInstance(requestDetails, path);
}
@@ -159,15 +159,17 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper unassignSvcInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "unassignSvcInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
- HttpResponse<String> response = client.post(endpoint, commonHeaders, requestDetails, String.class);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
+ String path = baseUrl + endpoint;
+
+ HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class);
return MsoUtil.wrapResponse(response);
}
@Override
public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) {
String methodName = "deleteVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return deleteInstance(requestDetails, path);
@@ -176,7 +178,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) {
String methodName = "deleteVfModule";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return deleteInstance(requestDetails, path);
@@ -185,7 +187,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "deleteVolumeGroupInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return deleteInstance(requestDetails, path);
@@ -194,59 +196,50 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "deleteNwInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return deleteInstance(requestDetails, path);
}
@Override
- public MsoResponseWrapper getOrchestrationRequest(String endpoint) {
+ public MsoResponseWrapper getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject, boolean warpException) {
String path = baseUrl + endpoint;
HttpResponse<String> response = client.get(path, commonHeaders, new HashMap<>(), String.class);
return MsoUtil.wrapResponse(response);
}
- public MsoResponseWrapper getManualTasks(String endpoint) {
+ @Override
+ public MsoResponseWrapper getOrchestrationRequest(String endpoint) {
String path = baseUrl + endpoint;
HttpResponse<String> response = client.get(path, commonHeaders, new HashMap<>(), String.class);
return MsoUtil.wrapResponse(response);
}
- public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String path, RestObject restObject) {
- String methodName = "getOrchestrationRequestsForDashboard";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + START);
-
- try {
- MsoResponseWrapper w = getOrchestrationRequest(path);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-
- return w;
+ public MsoResponseWrapper getManualTasks(String endpoint) {
+ String path = baseUrl + endpoint;
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
+ HttpResponse<String> response = client.get(path, commonHeaders, new HashMap<>(), String.class);
+ return MsoUtil.wrapResponse(response);
}
public MsoResponseWrapper getManualTasksByRequestId(String t, String sourceId, String endpoint, RestObject restObject) {
String methodName = "getManualTasksByRequestId";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(methodName + START);
try {
String path = baseUrl + endpoint;
MsoResponseWrapper w =getManualTasks(path);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse());
return w;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -254,19 +247,19 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) {
String methodName = "completeManualTask";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Complete ");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Complete ");
try {
String path = baseUrl + endpoint;
HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class);
MsoResponseWrapper w = MsoUtil.wrapResponse(response);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse());
return w;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -274,7 +267,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String endpoint) {
String methodName = "replaceVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
return replaceInstance(requestDetails, path);
}
@@ -283,7 +276,7 @@ public class MsoRestClientNew implements MsoInterface {
public MsoResponseWrapper deleteConfiguration(org.onap.vid.mso.rest.RequestDetailsWrapper requestDetailsWrapper, String pmc_endpoint) {
String methodName = "deleteConfiguration";
logger.debug(EELFLoggerDelegate.debugLogger,
- dateFormat.format(new Date()) + "<== " + methodName + START);
+ methodName + START);
String path = baseUrl + pmc_endpoint;
return deleteInstance(requestDetailsWrapper, path);
@@ -292,7 +285,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper setConfigurationActiveStatus(RequestDetails request, String endpoint) {
String methodName = "setConfigurationActiveStatus";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
String path = baseUrl + endpoint;
@@ -302,8 +295,8 @@ public class MsoRestClientNew implements MsoInterface {
HttpResponse<String> response = client.post(path, commonHeaders, request, String.class);
return MsoUtil.wrapResponse(response);
} catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -311,7 +304,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails request, String endpoint) {
String methodName = "setPortOnConfigurationStatus";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
String path = baseUrl + endpoint;
@@ -320,8 +313,8 @@ public class MsoRestClientNew implements MsoInterface {
HttpResponse<String> response = client.post(path, commonHeaders, request, String.class);
return MsoUtil.wrapResponse(response);
} catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -335,28 +328,29 @@ public class MsoRestClientNew implements MsoInterface {
public MsoResponseWrapper replaceInstance(org.onap.vid.changeManagement.RequestDetails request, String path) {
String methodName = "replaceInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Replace VNF, path =[" + path + "]");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Replace VNF, path =[" + path + "]");
+ RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+ requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
- HttpResponse<String> response = client.post(path, commonHeaders, request, String.class);
+ HttpResponse<String> response = client.post(path, commonHeaders, requestDetailsWrapper, String.class);
MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(response);
int status = msoResponseWrapperObject.getStatus();
if (status == 202) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName +
",post succeeded, msoResponseWrapperObject response:" + msoResponseWrapperObject.getResponse());
} else {
- logger.error(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
+ logger.error(EELFLoggerDelegate.debugLogger, methodName +
": post failed, msoResponseWrapperObject status" + status + ", response:" + msoResponseWrapperObject.getResponse());
- // TODO
}
return msoResponseWrapperObject;
} catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
@@ -365,7 +359,7 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String endpoint) {
String methodName = "updateVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
String path = baseUrl + endpoint;
RequestDetailsWrapper wrapper = new RequestDetailsWrapper();
@@ -375,20 +369,22 @@ public class MsoRestClientNew implements MsoInterface {
public MsoResponseWrapper updateInstance(org.onap.vid.changeManagement.RequestDetails request, String path) {
String methodName = "updateInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Delete, path =[" + path + "]");
- HttpResponse<String> response = client.post(path, commonHeaders, request, String.class);
+ RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+ requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
+ HttpResponse<String> response = client.put(path, commonHeaders, requestDetailsWrapper, String.class);
MsoResponseWrapper w = MsoUtil.wrapResponse(response);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse());
return w;
} catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
@@ -396,16 +392,16 @@ public class MsoRestClientNew implements MsoInterface {
public void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) {
String methodName = "activateServiceInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start ");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start ");
try {
String path = baseUrl + endpoint;
HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class);
MsoResponseWrapper w = MsoUtil.wrapResponse(response);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w =" + w.getResponse());
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w =" + w.getResponse());
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -413,16 +409,16 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint) {
String methodName = "removeRelationshipFromServiceInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Remove relationship from service instance, path =[" + endpoint + "]");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Remove relationship from service instance, path =[" + endpoint + "]");
String path = baseUrl + endpoint;
HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class);
return MsoUtil.wrapResponse(response);
} catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -430,43 +426,45 @@ public class MsoRestClientNew implements MsoInterface {
@Override
public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath) {
String methodName = "addRelationshipToServiceInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Add relationship to service instance, path =[" + addRelationshipsPath + "]");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Add relationship to service instance, path =[" + addRelationshipsPath + "]");
String path = baseUrl + addRelationshipsPath;
HttpResponse<String> response = client.post(path, commonHeaders, requestDetails, String.class);
return MsoUtil.wrapResponse(response);
} catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.info(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@Override
- public <T> HttpResponse<T> get(String path, Class<T> responseClass) {
+ public <T> HttpResponse<T> get(String endpoint, Class<T> responseClass) {
+ String path = baseUrl + endpoint;
return client.get(path, commonHeaders, new HashMap<>(), responseClass);
}
@Override
- public <T> HttpResponse<T> post(String path, RequestDetailsWrapper<?> requestDetailsWrapper,
- Class<T> responseClass) {
+ public <T> HttpResponse<T> post(String endpoint, RequestDetailsWrapper<?> requestDetailsWrapper, Class<T> responseClass) {
+ String path = baseUrl + endpoint;
+
return client.post(path, commonHeaders, requestDetailsWrapper, responseClass);
}
- private MsoResponseWrapper createInstance(Object request, String endpoint) {
+ private MsoResponseWrapper createInstance(Object request, String path) {
String methodName = "createInstance";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(methodName + START);
try {
- HttpResponse<String> response = client.post(endpoint, commonHeaders, request, String.class);
+ HttpResponse<String> response = client.post(path, commonHeaders, request, String.class);
return MsoUtil.wrapResponse(response);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}
}
@@ -481,20 +479,20 @@ public class MsoRestClientNew implements MsoInterface {
*/
private MsoResponseWrapper deleteInstance(Object request, String path) {
String methodName = "deleteInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START);
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + START);
try {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " calling Delete, path =[" + path + "]");
HttpResponse<String> response = client.delete(path, commonHeaders, request, String.class);
MsoResponseWrapper w = MsoUtil.wrapResponse(response);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+ logger.debug(EELFLoggerDelegate.debugLogger, methodName + " w=" + w.getResponse());
return w;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.error(EELFLoggerDelegate.errorLogger, "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, "." + methodName + e.toString());
throw e;
}