X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=esr-mgr%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fesr%2Futil%2FVimManagerUtil.java;h=681b28878b5e24ba6c9ddcc9e78cae43e8e652d3;hb=refs%2Fchanges%2F63%2F12663%2F1;hp=54720ce7400784e9cd7d96362a29c7c1cf8a4de3;hpb=bb02e67db383ee68af8179c350e07a6c1ddffca9;p=aai%2Fesr-server.git 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 54720ce..681b288 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 @@ -19,9 +19,8 @@ import java.util.ArrayList; import org.onap.aai.esr.common.SystemStatus; import org.onap.aai.esr.common.SystemType; -import org.onap.aai.esr.entity.aai.AuthInfo; -import org.onap.aai.esr.entity.aai.CloudRegion; import org.onap.aai.esr.entity.aai.EsrSystemInfo; +import org.onap.aai.esr.entity.aai.CloudRegion; import org.onap.aai.esr.entity.aai.EsrSystemInfoList; import org.onap.aai.esr.entity.rest.VimAuthInfo; import org.onap.aai.esr.entity.rest.VimRegisterInfo; @@ -31,8 +30,9 @@ public class VimManagerUtil { public static CloudRegion vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) { CloudRegion cloudRegion = new CloudRegion(); - EsrSystemInfoList esrSystemInfo = new EsrSystemInfoList(); - AuthInfo authInfo = new AuthInfo(); + EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); + ArrayList esrSystemInfo = new ArrayList(); + EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); cloudRegion.setCloudOwner(vimRegisterInfo.getCloudOwner()); cloudRegion.setCloudRegionId(vimRegisterInfo.getCloudRegionId()); @@ -43,27 +43,27 @@ public class VimManagerUtil { cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType()); cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo()); - authInfo = vimAuthInfo2AuthInfo(vimRegisterInfo.getVimAuthInfo()); - esrSystemInfo = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(authInfo); - cloudRegion.setEsrSystemInfoList(esrSystemInfo); + esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfo()); + esrSystemInfoList = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj); + cloudRegion.setEsrSystemInfoList(esrSystemInfoList); return cloudRegion; } - private static AuthInfo vimAuthInfo2AuthInfo(VimAuthInfo vimAuthInfo) { - AuthInfo authInfo = new AuthInfo(); - authInfo.setCloudDomain(vimAuthInfo.getCloudDomain()); - authInfo.setUserName(vimAuthInfo.getUserName()); - authInfo.setPassword(vimAuthInfo.getPassword()); - authInfo.setServiceUrl(vimAuthInfo.getAuthUrl()); - authInfo.setSslCassert(vimAuthInfo.getSslCacert()); - authInfo.setSslInsecure(vimAuthInfo.getSslInsecure()); - authInfo.setEsrSystemInfoId(ExtsysUtil.generateId()); - authInfo.setSystemType(SystemType.VIM.toString()); - authInfo.setSystemStatus(SystemStatus.normal.toString()); - return authInfo; + private static EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(VimAuthInfo vimAuthInfo) { + EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); + esrSystemInfoObj.setCloudDomain(vimAuthInfo.getCloudDomain()); + esrSystemInfoObj.setUserName(vimAuthInfo.getUserName()); + esrSystemInfoObj.setPassword(vimAuthInfo.getPassword()); + esrSystemInfoObj.setServiceUrl(vimAuthInfo.getAuthUrl()); + esrSystemInfoObj.setSslCassert(vimAuthInfo.getSslCacert()); + esrSystemInfoObj.setSslInsecure(vimAuthInfo.getSslInsecure()); + esrSystemInfoObj.setEsrSystemInfoId(ExtsysUtil.generateId()); + esrSystemInfoObj.setSystemType(SystemType.VIM.toString()); + esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString()); + return esrSystemInfoObj; } - private static VimAuthInfo authInfo2VimAuthInfo(AuthInfo authInfo) { + private static VimAuthInfo authInfo2VimAuthInfo(EsrSystemInfo authInfo) { VimAuthInfo vimAuthInfo = new VimAuthInfo(); vimAuthInfo.setAuthUrl(authInfo.getServiceUrl()); vimAuthInfo.setCloudDomain(authInfo.getCloudDomain()); @@ -77,7 +77,7 @@ public class VimManagerUtil { public static VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegion cloudRegion) { VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); VimAuthInfo vimAuthInfo = new VimAuthInfo(); - vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().getEsrSystemInfo().get(0)); + vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0)); vimRegisterInfo.setVimAuthInfo(vimAuthInfo); vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo()); vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner()); @@ -85,6 +85,7 @@ public class VimManagerUtil { vimRegisterInfo.setCloudType(cloudRegion.getCloudType()); vimRegisterInfo.setCloudZone(cloudRegion.getCloudZone()); vimRegisterInfo.setComplexName(cloudRegion.getComplexName()); + vimRegisterInfo.setCloudRegionVersion(cloudRegion.getCloudRegionVersion()); vimRegisterInfo.setOwnerDefinedType(cloudRegion.getOwnerDefinedType()); return vimRegisterInfo; }