diff options
author | 2017-09-19 15:57:54 +0800 | |
---|---|---|
committer | 2017-09-19 15:57:54 +0800 | |
commit | f30cb941059edc86f8b8effaa261774e87395e44 (patch) | |
tree | 530542e6286c922470f7aa49a4601f95916737d6 /esr-mgr/src | |
parent | 48df9cda482edd36130777549ac42ee88f048af3 (diff) |
Fix the data structure of VIM.
Change-Id: I0f663872244495ad1c7dc605ac4e04aa415131b7
Issue-ID: AAI-332
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/entity/rest/VimRegisterInfo.java | 13 | ||||
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java | 12 |
2 files changed, 16 insertions, 9 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java index e5fc132..dd3fa95 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/entity/rest/VimRegisterInfo.java @@ -15,6 +15,8 @@ */ package org.onap.aai.esr.entity.rest; +import java.util.ArrayList; + public class VimRegisterInfo { private String cloudOwner; @@ -33,7 +35,7 @@ public class VimRegisterInfo { private String cloudExtraInfo; - private VimAuthInfo vimAuthInfo; + private ArrayList<VimAuthInfo> vimAuthInfos; public String getCloudOwner() { return cloudOwner; @@ -99,13 +101,12 @@ public class VimRegisterInfo { this.cloudExtraInfo = cloudExtraInfo; } - public VimAuthInfo getVimAuthInfo() { - return vimAuthInfo; + public ArrayList<VimAuthInfo> getVimAuthInfos() { + return vimAuthInfos; } - public void setVimAuthInfo(VimAuthInfo vimAuthInfo) { - this.vimAuthInfo = vimAuthInfo; + public void setVimAuthInfos(ArrayList<VimAuthInfo> vimAuthInfos) { + this.vimAuthInfos = vimAuthInfos; } - } 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 9952fad..de10ac1 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 @@ -16,6 +16,8 @@ package org.onap.aai.esr.util; +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.EsrSystemInfo; @@ -41,14 +43,16 @@ public class VimManagerUtil { cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType()); cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo()); - esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfo()); + esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos()); esrSystemInfoList = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj); cloudRegion.setEsrSystemInfoList(esrSystemInfoList); return cloudRegion; } - private static EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(VimAuthInfo vimAuthInfo) { + private static EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(ArrayList<VimAuthInfo> vimAuthInfos) { EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo(); + VimAuthInfo vimAuthInfo = new VimAuthInfo(); + vimAuthInfo = vimAuthInfos.get(0); esrSystemInfoObj.setCloudDomain(vimAuthInfo.getCloudDomain()); esrSystemInfoObj.setUserName(vimAuthInfo.getUserName()); esrSystemInfoObj.setPassword(vimAuthInfo.getPassword()); @@ -75,8 +79,10 @@ public class VimManagerUtil { public static VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) { VimRegisterInfo vimRegisterInfo = new VimRegisterInfo(); VimAuthInfo vimAuthInfo = new VimAuthInfo(); + ArrayList<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>(); vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0)); - vimRegisterInfo.setVimAuthInfo(vimAuthInfo); + vimAuthInfos.add(vimAuthInfo); + vimRegisterInfo.setVimAuthInfos(vimAuthInfos); vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo()); vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner()); vimRegisterInfo.setCloudRegionId(cloudRegion.getCloudRegionId()); |