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;
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
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();
cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo());
esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos());
+ esrSystemInfoObj.setSystemStatus(vimRegisterInfo.getStatus());
esrSystemInfoList = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
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);
esrSystemInfoObj.setSslInsecure(vimAuthInfo.getSslInsecure());
esrSystemInfoObj.setEsrSystemInfoId(ExtsysUtil.generateId());
esrSystemInfoObj.setSystemType(SystemType.VIM.toString());
- esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
+// esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
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());
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>();
vimRegisterInfo.setComplexName(cloudRegion.getComplexName());
vimRegisterInfo.setCloudRegionVersion(cloudRegion.getCloudRegionVersion());
vimRegisterInfo.setOwnerDefinedType(cloudRegion.getOwnerDefinedType());
+ vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus());
return vimRegisterInfo;
}
}