private static ThirdpatySdncWrapper thirdpatySdncWrapper;
private static final Logger LOG = LoggerFactory.getLogger(ThirdpatySdncWrapper.class);
+ private static ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil();
/**
* get ThirdpatySdncWrapper instance.
public Response registerThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc) {
CommonRegisterResponse result = new CommonRegisterResponse();
EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
- esrSdncDetail = ThirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
+ esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
String sdncId = esrSdncDetail.getThirdpartySdncId();
try {
ExternalSystemProxy.registerSdnc(sdncId, esrSdncDetail);
EsrThirdpartySdncDetail originalEsrSdncDetail = new EsrThirdpartySdncDetail();
EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo();
originalEsrSdncDetail = queryEsrThirdpartySdncDetail(sdncId);
- esrSdncDetail = ThirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
+ esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
String resourceVersion = originalEsrSdncDetail.getResourceVersion();
esrSdncDetail.setResourceVersion(resourceVersion);
esrSdncDetail.setThirdpartySdncId(sdncId);
} catch (Exception e) {
e.printStackTrace();
LOG.error("Query thirdparty SDNC list failed !");
- return Response.serverError().build();
+ return Response.ok().build();
}
}
if (resourceVersion != null) {
try {
ExternalSystemProxy.deleteThirdpartySdnc(thirdpartySdncId, resourceVersion);
- return Response.ok().build();
+ return Response.noContent().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();
+ return Response.noContent().build();
}
} else {
LOG.error("resouce-version is null ! Can not delete resouce from A&AI. ");
- return Response.serverError().build();
+ return Response.noContent().build();
}
}
String esrSdncStr = ExternalSystemProxy.queryThirdpartySdncDetail(sdncId);
LOG.info("Response from AAI by query thirdparty SDNC: " + esrSdncStr);
esrSdncDetail = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncDetail.class);
- sdncRegisterInfo = ThirdpartySdncManagerUtil.esrSdnc2SdncRegisterInfo(esrSdncDetail);
+ sdncRegisterInfo = thirdpartySdncManagerUtil.esrSdnc2SdncRegisterInfo(esrSdncDetail);
return sdncRegisterInfo;
} catch (Exception e) {
e.printStackTrace();