import java.util.ArrayList;
+import java.util.List;
import org.onap.aai.esr.common.SystemType;
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
public CloudRegionDetail vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) {
CloudRegionDetail cloudRegion = new CloudRegionDetail();
- EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
cloudRegion.setCloudOwner(vimRegisterInfo.getCloudOwner());
cloudRegion.setCloudRegionId(vimRegisterInfo.getCloudRegionId());
cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType());
cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo());
- esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos());
+ EsrSystemInfo esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos());
esrSystemInfoObj.setSystemStatus(vimRegisterInfo.getStatus());
- esrSystemInfoList = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
+ EsrSystemInfoList esrSystemInfoList = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
return cloudRegion;
}
- private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(ArrayList<VimAuthInfo> vimAuthInfos) {
+ private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(List<VimAuthInfo> vimAuthInfos) {
EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo = vimAuthInfos.get(0);
+ VimAuthInfo vimAuthInfo = vimAuthInfos.get(0);
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.setDefaultTenant(vimAuthInfo.getDefaultTenant());
esrSystemInfoObj.setEsrSystemInfoId(extsysUtil.generateId());
esrSystemInfoObj.setSystemType(SystemType.VIM.toString());
// esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
vimAuthInfo.setSslCacert(authInfo.getSslCassert());
vimAuthInfo.setSslInsecure(authInfo.getSslInsecure());
vimAuthInfo.setUserName(authInfo.getUserName());
+ vimAuthInfo.setDefaultTenant(authInfo.getDefaultTenant());
return vimAuthInfo;
}
public VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) {
VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- ArrayList<VimAuthInfo> vimAuthInfos = new ArrayList<VimAuthInfo>();
+ List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
if(cloudRegion.getEsrSystemInfoList()!=null){
- vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0));
+ VimAuthInfo vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0));
+ vimAuthInfos.add(vimAuthInfo);
vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus());
}
- vimAuthInfos.add(vimAuthInfo);
vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo());
vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner());