X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=mso-api-handlers%2Fmso-api-handler-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fapihandler%2Fcommon%2FCamundaTaskClient.java;h=845b1403483d84de297e2695275a20dcf7356815;hb=51561d7bd318444d44565fa27ad095ddefb6c761;hp=4b179daa7c7d267cb26da0b08b38c00ae301e3b8;hpb=4370cf4eefb3de99b5eff870f90637931e9759e1;p=so.git 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 4b179daa7c..845b140348 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 @@ -20,15 +20,15 @@ package org.openecomp.mso.apihandler.common; -import org.openecomp.mso.logger.MsoLogger; +import java.io.IOException; + +import javax.xml.bind.DatatypeConverter; + import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; - -import javax.xml.bind.DatatypeConverter; -import java.io.IOException; +import org.openecomp.mso.logger.MsoLogger; public class CamundaTaskClient extends RequestClient{ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH); @@ -38,8 +38,7 @@ public class CamundaTaskClient extends RequestClient{ } @Override - public HttpResponse post(String jsonReq) - throws ClientProtocolException, IOException{ + public HttpResponse post(String jsonReq) throws IOException{ HttpPost post = new HttpPost(url); msoLogger.debug("Camunda Task url is: "+ url); @@ -53,7 +52,7 @@ public class CamundaTaskClient extends RequestClient{ String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY); if(userCredentials != null){ post.addHeader("Authorization", "Basic " + DatatypeConverter - .printBase64Binary(userCredentials.getBytes())); + .printBase64Binary(userCredentials.getBytes())); } } } @@ -64,25 +63,18 @@ public class CamundaTaskClient extends RequestClient{ @Override public HttpResponse post(String camundaReqXML, String requestId, - String requestTimeout, String schemaVersion, String serviceInstanceId, String action) - throws ClientProtocolException, IOException{ + String requestTimeout, String schemaVersion, String serviceInstanceId, String action) { msoLogger.debug("Method not supported"); return null; } - + @Override - public HttpResponse post(String requestId, boolean isBaseVfModule, - int recipeTimeout, String requestAction, String serviceInstanceId, - String vnfId, String vfModuleId, String volumeGroupId, String networkId, - String serviceType, String vnfType, String vfModuleType, String networkType, - String requestDetails, String recipeParamXsd) - throws ClientProtocolException, IOException{ - msoLogger.debug("Method not supported"); + public HttpResponse post(RequestClientParamater params) { return null; } - + @Override - public HttpResponse get() throws ClientProtocolException, IOException{ + public HttpResponse get() throws IOException{ HttpGet get = new HttpGet(url); msoLogger.debug("Camunda Task url is: "+ url); String encryptedCredentials; @@ -91,12 +83,11 @@ public class CamundaTaskClient extends RequestClient{ if(encryptedCredentials != null){ String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY); if(userCredentials != null){ - get.addHeader("Authorization", "Basic " + DatatypeConverter - .printBase64Binary(userCredentials.getBytes())); + get.addHeader("Authorization", "Basic " + new String(DatatypeConverter + .printBase64Binary(userCredentials.getBytes()))); } } } - return client.execute(get); }