diff options
author | 2017-09-18 15:56:58 +0800 | |
---|---|---|
committer | 2017-09-18 15:56:58 +0800 | |
commit | 80df263c114a5b1496f0f168f01d39006c319e00 (patch) | |
tree | ee16483d919ab025f7755a8a09841e519679254f /esr-mgr/src | |
parent | dd5fda2be4276ac66536853fe664db4f2f798e7c (diff) |
Realize the delete thirdparty SDNC API.
Change-Id: I76f64f200c1287424b8561f96942bb44fd6fc739
Issue-ID: AAI-319
Signed-off-by: lizi00164331 <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr/src')
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java | 4 | ||||
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java | 19 |
2 files changed, 21 insertions, 2 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java index 01d8ac3..e7f5d4b 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java @@ -69,4 +69,8 @@ public class ExternalSystemProxy { public static String querySdncList() throws Exception { return externalSystemproxy.queryThirdpartySdncList(transactionId, fromAppId, authorization); } + + public static void deleteThirdpartySdnc(String sdncId, String resourceVersion) throws Exception { + externalSystemproxy.deleteThirdpartySdnc(transactionId, fromAppId, authorization, sdncId, resourceVersion); + } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java index e5f9966..4b23fcf 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java @@ -119,8 +119,23 @@ public class ThirdpatySdncWrapper { } public Response delThirdpartySdnc(String thirdpartySdncId) { - //TODO - return Response.noContent().build(); + EsrThirdpartySdncDetail thirdpartySdncDetail = new EsrThirdpartySdncDetail(); + thirdpartySdncDetail = queryEsrThirdpartySdncDetail(thirdpartySdncId); + String resourceVersion = thirdpartySdncDetail.getResourceVersion(); + if (resourceVersion != null) { + try { + ExternalSystemProxy.deleteThirdpartySdnc(thirdpartySdncId, resourceVersion); + return Response.ok().build(); + } catch (Exception e) { + e.printStackTrace(); + LOG.error("Delete VNFM from A&AI failed! thirdparty SDNC ID: " + thirdpartySdncId + "resouce-version:" + + resourceVersion, e.getMessage()); + return Response.serverError().build(); + } + } else { + LOG.error("resouce-version is null ! Can not delete resouce from A&AI. "); + return Response.serverError().build(); + } } private ThirdpartySdncRegisterInfo querySdncDetail(String sdncId) { |