Add modify vnf feature on driver
[vfc/nfvo/driver/vnfm/svnfm.git] / nokia / vnfmdriver / vfcadaptorservice / vfcadaptor / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nslcm / impl / NslcmMgmrImpl.java
index 405c736..13ee87d 100644 (file)
@@ -20,18 +20,15 @@ import java.io.IOException;
 import java.util.HashMap;
 
 import org.apache.http.client.ClientProtocolException;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpClientProcessorInf;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpRequestProcessor;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.VnfmInfo;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.stereotype.Component;
@@ -79,8 +76,8 @@ public class NslcmMgmrImpl implements NslcmMgmrInf{
                return response;
        }
 
-       public void notifyVnf(NslcmNotifyLCMEventsRequest driverRequest, String vnfInstanceId) throws ClientProtocolException, IOException {
-               String httpPath = String.format(CommonConstants.NslcmNotifyPath, vnfInstanceId);
+       public void notifyVnf(NslcmNotifyLCMEventsRequest driverRequest, String vnfmId, String vnfInstanceId) throws ClientProtocolException, IOException {
+               String httpPath = String.format(CommonConstants.NslcmNotifyPath, vnfmId, vnfInstanceId);
                RequestMethod method = RequestMethod.POST;
                        
                operateNslcmHttpTask(driverRequest, httpPath, method);
@@ -89,10 +86,10 @@ public class NslcmMgmrImpl implements NslcmMgmrInf{
        private String operateNslcmHttpTask(Object httpBodyObj, String httpPath, RequestMethod method) throws ClientProtocolException, IOException {
                String url=adaptorEnv.getLcmApiUriFront() + httpPath;
                
-               HashMap<String, String> map = new HashMap<String, String>();
+               HashMap<String, String> map = new HashMap<>();
                map.put(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
                
-               String responseStr = httpClientProcessor.process(url, method, map, gson.toJson(httpBodyObj));
+               String responseStr = httpClientProcessor.process(url, method, map, gson.toJson(httpBodyObj)).getContent();
                
                return responseStr;
        }