summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/resource/EmsManager.java1
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java14
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java49
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java6
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java8
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/util/VnfmManagerUtil.java6
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java7
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/ThirdpatySdncWrapper.java7
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java9
-rw-r--r--esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java8
10 files changed, 35 insertions, 80 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/resource/EmsManager.java b/esr-mgr/src/main/java/org/onap/aai/esr/resource/EmsManager.java
index ba51f43..63622e1 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/resource/EmsManager.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/resource/EmsManager.java
@@ -25,7 +25,6 @@ import io.swagger.annotations.ApiResponses;
import org.eclipse.jetty.http.HttpStatus;
import org.onap.aai.esr.entity.rest.EmsRegisterInfo;
import org.onap.aai.esr.util.ExtsysUtil;
-import org.onap.aai.esr.util.RestResponseUtil;
import org.onap.aai.esr.wrapper.EmsManagerWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java
index 40ebd27..916c9e7 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java
@@ -26,7 +26,7 @@ import org.onap.aai.esr.entity.rest.FtpAddr;
public class EmsManagerUtil {
- public static EsrEmsDetail emsRegisterInfo2EsrEms(EmsRegisterInfo emsRegisterInfo) {
+ public EsrEmsDetail emsRegisterInfo2EsrEms(EmsRegisterInfo emsRegisterInfo) {
EsrEmsDetail esrEms = new EsrEmsDetail();
esrEms.setEmsId(ExtsysUtil.generateId());
ArrayList<EsrSystemInfo> authInfos = new ArrayList<EsrSystemInfo>();
@@ -35,7 +35,7 @@ public class EmsManagerUtil {
return esrEms;
}
- private static ArrayList<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
+ private ArrayList<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
ArrayList<EsrSystemInfo> authInfos = new ArrayList<EsrSystemInfo>();
EsrSystemInfo resouceAuthInfo = new EsrSystemInfo();
EsrSystemInfo performanceAuthInfo = new EsrSystemInfo();
@@ -49,7 +49,7 @@ public class EmsManagerUtil {
return authInfos;
}
- private static EsrSystemInfo getAuthInfoFromFtpAddr(EmsRegisterInfo emsRegisterInfo, String systemType) {
+ private EsrSystemInfo getAuthInfoFromFtpAddr(EmsRegisterInfo emsRegisterInfo, String systemType) {
EsrSystemInfo authInfo = new EsrSystemInfo();
FtpAddr ftpAddr = new FtpAddr();
if(systemType.equals(SystemType.EMS_RESOUCE.toString())) {
@@ -72,7 +72,7 @@ public class EmsManagerUtil {
return authInfo;
}
- private static EsrSystemInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) {
+ private EsrSystemInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) {
EsrSystemInfo authInfo = new EsrSystemInfo();
AlarmAddr alarmAddr = new AlarmAddr();
alarmAddr = emsRegisterInfo.getAlarmAddr();
@@ -88,7 +88,7 @@ public class EmsManagerUtil {
return authInfo;
}
- public static EmsRegisterInfo EsrEms2EmsRegisterInfo(EsrEmsDetail esrEms) {
+ public EmsRegisterInfo EsrEms2EmsRegisterInfo(EsrEmsDetail esrEms) {
EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
EsrSystemInfo authInfo = new EsrSystemInfo();
@@ -117,7 +117,7 @@ public class EmsManagerUtil {
return emsRegisterInfo;
}
- private static FtpAddr getFtpAddrFromAuthInfo(EsrSystemInfo authInfo) {
+ private FtpAddr getFtpAddrFromAuthInfo(EsrSystemInfo authInfo) {
FtpAddr ftpAddr = new FtpAddr();
ftpAddr.setFtptype(authInfo.getType());
ftpAddr.setIp(authInfo.getIpAddress());
@@ -129,7 +129,7 @@ public class EmsManagerUtil {
return ftpAddr;
}
- private static AlarmAddr getAlarmAddrFromAuthInfo(EsrSystemInfo authInfo) {
+ private AlarmAddr getAlarmAddrFromAuthInfo(EsrSystemInfo authInfo) {
AlarmAddr alarmAddr = new AlarmAddr();
alarmAddr.setIp(authInfo.getIpAddress());
alarmAddr.setPassword(authInfo.getPassword());
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java
deleted file mode 100644
index 3c27178..0000000
--- a/esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright 2016-2017 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onap.aai.esr.util;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-public class RestResponseUtil {
-
- /**
- * get http success entity.
- */
- public static Response getSuccessResponse(Object obj) {
- if (obj != null) {
- return Response.ok(obj).build();
- } else {
- return Response.ok().build();
- }
- }
-
- public static Response getCreateSussceeResponse(Object obj) {
- return Response.status(Status.CREATED).entity(obj).build();
- }
-
- /**
- * get http error entity.
- */
- public static Response getErrorResponse(Object obj) {
- if (obj != null) {
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(obj).build();
- } else {
- return Response.serverError().build();
- }
-
- }
-}
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java
index 2cf4a0a..a2d1e1a 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java
@@ -25,7 +25,7 @@ import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
public class ThirdpartySdncManagerUtil {
- public static EsrThirdpartySdncDetail sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
+ public EsrThirdpartySdncDetail sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
EsrThirdpartySdncDetail esrThirdpartySdnc = new EsrThirdpartySdncDetail();
sdncRegisterInfo.setThirdpartySdncId(ExtsysUtil.generateId());
esrThirdpartySdnc.setThirdpartySdncId(sdncRegisterInfo.getThirdpartySdncId());
@@ -35,7 +35,7 @@ public class ThirdpartySdncManagerUtil {
return esrThirdpartySdnc;
}
- private static EsrSystemInfoList getEsrSystemInfoList(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
+ private EsrSystemInfoList getEsrSystemInfoList(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
EsrSystemInfo authInfo = new EsrSystemInfo();
@@ -54,7 +54,7 @@ public class ThirdpartySdncManagerUtil {
return esrSystemInfoList;
}
- public static ThirdpartySdncRegisterInfo esrSdnc2SdncRegisterInfo(EsrThirdpartySdncDetail esrSdnc) {
+ public ThirdpartySdncRegisterInfo esrSdnc2SdncRegisterInfo(EsrThirdpartySdncDetail esrSdnc) {
ThirdpartySdncRegisterInfo registerSdncInfo = new ThirdpartySdncRegisterInfo();
EsrSystemInfo esrSystemInfo = esrSdnc.getEsrSystemInfoList().getEsrSystemInfo().get(0);
registerSdncInfo.setThirdpartySdncId(esrSdnc.getThirdpartySdncId());
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java
index 06a8ef0..6393f12 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java
@@ -28,7 +28,7 @@ import org.onap.aai.esr.entity.rest.VimRegisterInfo;
public class VimManagerUtil {
- public static CloudRegionDetail vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) {
+ public CloudRegionDetail vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) {
CloudRegionDetail cloudRegion = new CloudRegionDetail();
EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
@@ -49,7 +49,7 @@ public class VimManagerUtil {
return cloudRegion;
}
- private static EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(ArrayList<VimAuthInfo> vimAuthInfos) {
+ private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(ArrayList<VimAuthInfo> vimAuthInfos) {
EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
VimAuthInfo vimAuthInfo = new VimAuthInfo();
vimAuthInfo = vimAuthInfos.get(0);
@@ -65,7 +65,7 @@ public class VimManagerUtil {
return esrSystemInfoObj;
}
- private static VimAuthInfo authInfo2VimAuthInfo(EsrSystemInfo authInfo) {
+ private VimAuthInfo authInfo2VimAuthInfo(EsrSystemInfo authInfo) {
VimAuthInfo vimAuthInfo = new VimAuthInfo();
vimAuthInfo.setAuthUrl(authInfo.getServiceUrl());
vimAuthInfo.setCloudDomain(authInfo.getCloudDomain());
@@ -76,7 +76,7 @@ public class VimManagerUtil {
return vimAuthInfo;
}
- public static VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) {
+ public VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) {
VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
VimAuthInfo vimAuthInfo = new VimAuthInfo();
ArrayList<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>();
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/VnfmManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/VnfmManagerUtil.java
index 57b754b..ca6babd 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/util/VnfmManagerUtil.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/util/VnfmManagerUtil.java
@@ -23,7 +23,7 @@ import org.onap.aai.esr.entity.rest.VnfmRegisterInfo;
public class VnfmManagerUtil {
- public static EsrVnfmDetail vnfmRegisterInfo2EsrVnfm(VnfmRegisterInfo vnfmRegisterInfo) {
+ public EsrVnfmDetail vnfmRegisterInfo2EsrVnfm(VnfmRegisterInfo vnfmRegisterInfo) {
EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
EsrSystemInfoList esrSystemInfo = new EsrSystemInfoList();
EsrSystemInfo authInfo = new EsrSystemInfo();
@@ -41,7 +41,7 @@ public class VnfmManagerUtil {
* @param vnfmRegisterInfo vnfm register informantion from portal
* @return
*/
- private static EsrSystemInfo getAuthInfoFromVnfmRegisterInfo(VnfmRegisterInfo vnfmRegisterInfo) {
+ private EsrSystemInfo getAuthInfoFromVnfmRegisterInfo(VnfmRegisterInfo vnfmRegisterInfo) {
EsrSystemInfo authInfo = new EsrSystemInfo();
authInfo.setEsrSystemInfoId(ExtsysUtil.generateId());
authInfo.setSystemName(vnfmRegisterInfo.getName());
@@ -55,7 +55,7 @@ public class VnfmManagerUtil {
return authInfo;
}
- public static VnfmRegisterInfo esrVnfm2VnfmRegisterInfo(EsrVnfmDetail esrVnfm) {
+ public VnfmRegisterInfo esrVnfm2VnfmRegisterInfo(EsrVnfmDetail esrVnfm) {
VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
EsrSystemInfo authInfo = new EsrSystemInfo();
vnfmRegisterInfo.setVnfmId(esrVnfm.getVnfmId());
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java
index 36f7963..e6e0f69 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/EmsManagerWrapper.java
@@ -34,6 +34,7 @@ import com.google.gson.Gson;
public class EmsManagerWrapper {
private static EmsManagerWrapper emsManagerWrapper;
private static final Logger LOG = LoggerFactory.getLogger(EmsManagerWrapper.class);
+ private static EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
/**
* get VnfmManagerWrapper instance.
@@ -49,7 +50,7 @@ public class EmsManagerWrapper {
public Response registerEms(EmsRegisterInfo emsRegisterInfo) {
CommonRegisterResponse result = new CommonRegisterResponse();
EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail = EmsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
+ esrEmsDetail = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
String emsId = esrEmsDetail.getEmsId();
try {
ExternalSystemProxy.registerEms(emsId, esrEmsDetail);
@@ -130,7 +131,7 @@ public class EmsManagerWrapper {
String esrEmsStr = ExternalSystemProxy.queryEmsDetail(emsId);
LOG.info("Response from AAI by query EMS: " + esrEmsStr);
esrEmsDetail = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
- emsRegisterInfo = EmsManagerUtil.EsrEms2EmsRegisterInfo(esrEmsDetail);
+ emsRegisterInfo = emsManagerUtil.EsrEms2EmsRegisterInfo(esrEmsDetail);
return emsRegisterInfo;
} catch (Exception e) {
e.printStackTrace();
@@ -174,7 +175,7 @@ public class EmsManagerWrapper {
EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo();
oriEsrEmsDetail = queryEsrEmsDetail(emsId);
- esrEmsDetail = EmsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
+ esrEmsDetail = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
String emsResourceVersion = oriEsrEmsDetail.getResourceVersion();
esrEmsDetail.setResourceVersion(emsResourceVersion);
esrEmsDetail.setEmsId(emsId);
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 4ecc5c9..0dfd45a 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
@@ -37,6 +37,7 @@ public class ThirdpatySdncWrapper {
private static ThirdpatySdncWrapper thirdpatySdncWrapper;
private static final Logger LOG = LoggerFactory.getLogger(ThirdpatySdncWrapper.class);
+ private static ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil();
/**
* get ThirdpatySdncWrapper instance.
@@ -52,7 +53,7 @@ public class ThirdpatySdncWrapper {
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);
@@ -72,7 +73,7 @@ public class ThirdpatySdncWrapper {
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);
@@ -145,7 +146,7 @@ public class ThirdpatySdncWrapper {
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();
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java
index ec52317..6d06a1c 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java
@@ -37,6 +37,7 @@ public class VimManagerWrapper {
private static VimManagerWrapper vimManagerWrapper;
private static final Logger LOG = LoggerFactory.getLogger(VimManagerWrapper.class);
+ private static VimManagerUtil vimManagerUtil = new VimManagerUtil();
/**
* get VimManagerWrapper instance.
@@ -56,7 +57,7 @@ public class VimManagerWrapper {
"Start register VIM, input VIM info is: " + ExtsysUtil.objectToString(vimRegisterInfo));
CloudRegionDetail cloudRegion = new CloudRegionDetail();
VimRegisterResponse result = new VimRegisterResponse();
- cloudRegion = VimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
+ cloudRegion = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
String cloudOwner = vimRegisterInfo.getCloudOwner();
String cloudRegionId = vimRegisterInfo.getCloudRegionId();
try {
@@ -112,7 +113,7 @@ public class VimManagerWrapper {
String cloudRegionstr = CloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
LOG.info("Response from AAI by query VIM: " + cloudRegionstr);
cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
- vim = VimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
+ vim = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
return Response.ok(vim).build();
} catch (Exception e) {
e.printStackTrace();
@@ -140,7 +141,7 @@ public class VimManagerWrapper {
try {
String cloudRegionstr = CloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
- registeredVimInfo = VimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
+ registeredVimInfo = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
} catch (Exception error) {
error.printStackTrace();
LOG.error("query VIM detail failed ! cloud-owner = " + cloudOwner + ", cloud-region-id = "
@@ -171,7 +172,7 @@ public class VimManagerWrapper {
String cloudRegionId = vimRegisterInfo.getCloudRegionId();
originalCloudRegionDetail = getOriginalCloudRegion(cloudOwner, cloudRegionId);
String resourceVersion = originalCloudRegionDetail.getResourceVersion();
- cloudRegionDetail = VimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
+ cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
if(resourceVersion != null) {
cloudRegionDetail.setResourceVersion(resourceVersion);
originalSystemInfo = originalCloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java
index 5f6c8db..a0ca60d 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VnfmManagerWrapper.java
@@ -35,6 +35,8 @@ public class VnfmManagerWrapper {
private static VnfmManagerWrapper vnfmManagerWrapper;
private static final Logger LOG = LoggerFactory.getLogger(VnfmManagerWrapper.class);
+ private static VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
+
/**
* get VnfmManagerWrapper instance.
*
@@ -50,7 +52,7 @@ public class VnfmManagerWrapper {
public Response registerVnfm(VnfmRegisterInfo vnfm) {
CommonRegisterResponse result = new CommonRegisterResponse();
EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
- esrVnfmDetail = VnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
+ esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
String vnfmId = esrVnfmDetail.getVnfmId();
try {
ExternalSystemProxy.registerVnfm(vnfmId, esrVnfmDetail);
@@ -69,7 +71,7 @@ public class VnfmManagerWrapper {
EsrVnfmDetail originalEsrVnfmDetail = new EsrVnfmDetail();
EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo();
originalEsrVnfmDetail = queryEsrVnfmDetail(vnfmId);
- esrVnfmDetail = VnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
+ esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
String resourceVersion = getResourceVersion(vnfmId);
esrVnfmDetail.setResourceVersion(resourceVersion);
esrVnfmDetail.setVnfmId(vnfmId);
@@ -140,7 +142,7 @@ public class VnfmManagerWrapper {
String esrVnfmstr = ExternalSystemProxy.queryVnfmDetail(vnfmId);
LOG.info("Response from AAI by query VNFM: " + esrVnfmstr);
esrVnfmDetail = new Gson().fromJson(esrVnfmstr, EsrVnfmDetail.class);
- vnfm = VnfmManagerUtil.esrVnfm2VnfmRegisterInfo(esrVnfmDetail);
+ vnfm = vnfmManagerUtil.esrVnfm2VnfmRegisterInfo(esrVnfmDetail);
return vnfm;
} catch (Exception e) {
e.printStackTrace();