summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2018-11-21 10:20:30 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2018-11-21 10:20:37 +0800
commitf631bdf0291db28c1cc27450c3af7f17eae2ce59 (patch)
treec484301e7c3c2f61285196c34963e1a7b63172ca
parent1679133aeba5efcb89848e89503d42b2ad15fcba (diff)
Support NS Instance Termination for VF-C
Change-Id: I74b01f166fbb123fa01b218eb0b41fe6def140d9 Issue-ID: USECASEUI-161 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java30
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java3
2 files changed, 24 insertions, 9 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
index 25598f09..14ca9ed6 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
@@ -344,11 +344,11 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
@Override
public String deleteNsdPackage(String nsdInfoId) {
-
+ Response<ResponseBody> response=null;
String result="";
try {
logger.info("vfc deleteNsdPackage is starting!");
- Response<ResponseBody> response = this.vfcService.deleteNsdPackage(nsdInfoId).execute();
+ response = this.vfcService.deleteNsdPackage(nsdInfoId).execute();
logger.info("vfc deleteNsdPackage has finished!");
if (response.isSuccessful()) {
result=Constant.CONSTANT_SUCCESS;
@@ -357,6 +357,9 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
result=Constant.CONSTANT_FAILED;;
}
} catch (IOException e) {
+ if(e.getMessage().contains("204")){
+ return Constant.CONSTANT_SUCCESS;
+ }
logger.error("deleteNsdPackage occur exception:"+e);
result=Constant.CONSTANT_FAILED;;
}
@@ -366,11 +369,11 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
@Override
public String deleteVnfPackage(String vnfPkgId) {
-
+ Response<ResponseBody> response=null;
String result="";
try {
logger.info("vfc deleteVnfPackage is starting!");
- Response<ResponseBody> response = this.vfcService.deleteVnfdPackage(vnfPkgId).execute();
+ response = this.vfcService.deleteVnfdPackage(vnfPkgId).execute();
logger.info("vfc deleteVnfPackage has finished!");
if (response.isSuccessful()) {
result=Constant.CONSTANT_SUCCESS;
@@ -379,6 +382,9 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
result=Constant.CONSTANT_FAILED;;
}
} catch (IOException e) {
+ if(e.getMessage().contains("204")){
+ return Constant.CONSTANT_SUCCESS;
+ }
logger.error("deleteVnfPackage occur exception:"+e);
result=Constant.CONSTANT_FAILED;;
}
@@ -388,11 +394,11 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
@Override
public String deletePnfPackage(String pnfdInfoId) {
-
+ Response<ResponseBody> response=null;
String result="";
try {
logger.info("vfc deletePnfPackage is starting!");
- Response<ResponseBody> response = this.vfcService.deletePnfdPackage(pnfdInfoId).execute();
+ response = this.vfcService.deletePnfdPackage(pnfdInfoId).execute();
logger.info("vfc deletePnfPackage has finished!");
if (response.isSuccessful()) {
result=Constant.CONSTANT_SUCCESS;
@@ -401,6 +407,9 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
result=Constant.CONSTANT_FAILED;;
}
} catch (IOException e) {
+ if(e.getMessage().contains("204")){
+ return Constant.CONSTANT_SUCCESS;
+ }
logger.error("deletePnfPackage occur exception:"+e);
result=Constant.CONSTANT_FAILED;;
}
@@ -462,11 +471,11 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
@Override
public String deleteNetworkServiceInstance(String nsInstanceId) {
-
+ Response response = null;
String result="";
try {
logger.info("vfc deleteNetworkServiceInstance is starting!");
- Response<ResponseBody> response = this.vfcService.deleteNetworkServiceInstance(nsInstanceId).execute();
+ response = this.vfcService.deleteNetworkServiceInstance(nsInstanceId).execute();
logger.info("vfc deleteNetworkServiceInstance has finished!");
if (response.isSuccessful()) {
result=Constant.CONSTANT_SUCCESS;
@@ -475,8 +484,11 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
result=Constant.CONSTANT_FAILED;;
}
} catch (IOException e) {
+ if(e.getMessage().contains("204")){
+ return Constant.CONSTANT_SUCCESS;
+ }
logger.error("deleteNetworkServiceInstance occur exception:"+e);
- result=Constant.CONSTANT_FAILED;;
+ result=Constant.CONSTANT_FAILED;
}
return result;
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java
index 04561302..376961c9 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java
@@ -115,6 +115,9 @@ public class DefaultServiceInstanceService implements ServiceInstanceService {
String serviceDomain = serviceBean.getServiceDomain();
object.put("serviceDomain",serviceDomain);
object.put("serviceStatus",serviceBean.getStatus());
+ if("error".equals(serviceBean.getStatus())){
+ continue;
+ }
object.put("operationId",serviceBean.getOperationId());
if("SOTN".equals(serviceDomain)||"CCVPN".equals(serviceDomain)||"E2E Service".equals(serviceDomain)||"Network Service".equals(serviceDomain)){
List<String> parentIds = serviceLcmService.getServiceInstanceIdByParentId(serviceInstanceId);