summaryrefslogtreecommitdiffstats
path: root/nokia/vnfmdriver/vfcadaptorservice
diff options
context:
space:
mode:
authoryufei_zhou <yufei.zhou@nokia-sbell.com>2017-11-13 09:46:57 +0800
committeryufei_zhou <yufei.zhou@nokia-sbell.com>2017-11-13 09:46:57 +0800
commit9f4ae52e090175c91e26d40cc1c0c74c439c0a86 (patch)
tree754b81e46da7c6f7af657b75e2d2ecc524a3d3d5 /nokia/vnfmdriver/vfcadaptorservice
parent7014e3fe05b59edfaf164d53cbf540813b3e4143 (diff)
Update LCM notify part
Change-Id: I04586efa6f994e716b65c2dabbdfbf680c561baa Issue-ID: VFC-587 Signed-off-by: yufei_zhou <yufei.zhou@nokia-sbell.com>
Diffstat (limited to 'nokia/vnfmdriver/vfcadaptorservice')
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java29
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java4
-rw-r--r--nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/msb/impl/MsbMgmrImpl.java2
3 files changed, 25 insertions, 10 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java
index 5ff7f19a..b3c8bfe1 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java
@@ -114,20 +114,28 @@ public class InstantiateVnfContinueRunnable implements Runnable {
{
logger.info("Start to get vnfc resource");
- List<VnfcResourceInfo> vnfcResources = cbamMgmr.queryVnfcResource(execId);
- logger.info("vnfc resource for execId " + execId + " is: " + gson.toJson(vnfcResources));
+ List<VnfcResourceInfo> vnfcResources = new ArrayList<>();
+
+ try {
+ vnfcResources = cbamMgmr.queryVnfcResource(vnfInstanceId);
+ } catch (Exception e) {
+ logger.error("Error to queryVnfcResource.", e);
+ }
+
+ logger.info("vnfc resource for vnfInstanceId " + vnfInstanceId + " is: " + gson.toJson(vnfcResources));
logger.info("End to get vnfc resource");
- if(vnfcResources != null && !vnfcResources.isEmpty())
+ if(vnfcResources == null)
{
- logger.info("Start to notify LCM the instantiation result");
- NslcmNotifyLCMEventsRequest nslcmNotifyReq = buildNslcmNotifyLCMEventsRequest(vnfcResources);
-
- OperateTaskProgress.setAffectedVnfc(nslcmNotifyReq.getAffectedVnfc());
-
- nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfmId, vnfInstanceId);
- logger.info("End to notify LCM the instantiation result");
+ vnfcResources = new ArrayList<>();
}
+ logger.info("Start to notify LCM the instantiation result");
+ NslcmNotifyLCMEventsRequest nslcmNotifyReq = buildNslcmNotifyLCMEventsRequest(vnfcResources);
+
+ OperateTaskProgress.setAffectedVnfc(nslcmNotifyReq.getAffectedVnfc());
+
+ nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfmId, vnfInstanceId);
+ logger.info("End to notify LCM the instantiation result");
}
}
else {
@@ -268,6 +276,7 @@ public class InstantiateVnfContinueRunnable implements Runnable {
jobInfo.setVnfmExecutionId(cbamInstantiateResponse.getId());
if(CommonEnum.OperationStatus.FAILED == cbamInstantiateResponse.getStatus()){
jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_ERROR);
+// jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_FINISH);
} else if(CommonEnum.OperationStatus.OTHER == cbamInstantiateResponse.getStatus()){
jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_PROCESSING);
} else if(CommonEnum.OperationStatus.FINISHED == cbamInstantiateResponse.getStatus()){
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java
index 0e6493c1..13e4e3c6 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java
@@ -195,6 +195,10 @@ public class TerminateVnfContinueRunnable implements Runnable {
}
}
+ if(vnfcs == null) {
+ vnfcs = new ArrayList<>();
+ }
+
return vnfcs;
}
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/msb/impl/MsbMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/msb/impl/MsbMgmrImpl.java
index 78dcf413..e89eabe1 100644
--- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/msb/impl/MsbMgmrImpl.java
+++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/msb/impl/MsbMgmrImpl.java
@@ -57,6 +57,8 @@ public class MsbMgmrImpl implements IMsbMgmr {
map.put(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
String bodyPostStr = readVfcAdaptorInfoFromJsonFile();
+
+ logger.info("MSB register content is: " + bodyPostStr);
HttpResult httpResult = httpClientProcessor.process(url, RequestMethod.POST, map, bodyPostStr);
String responseStr = httpResult.getContent();