use of com.huawei.esight.service.bean.MezzBean in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method setMezz.
private List<ResourceKey> setMezz(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
List<ResourceKey> deviceChildKeys = new ArrayList<>();
List<MezzBean> mezzBeans = device.getMezz();
if (!mezzBeans.isEmpty()) {
List<ResourceKey> mezzResourceKey = new ArrayList<>();
List<String> childHealthList = new ArrayList<>();
for (MezzBean bean : mezzBeans) {
ResourceKey key = bean.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
mezzResourceKey.add(key);
allResourceList.add(key);
childHealthList.add(ConvertUtils.convertHealthState(bean.getMezzHealthStatus()));
}
// Mezz Group
ResourceKey mezzGroup = device.createGroupKey(Constant.TREE_MEZZ_GROUP, Constant.KIND_MEZZ_GROUP, mezzResourceKey, relationshipsByResource, getAdapterKind());
deviceChildKeys.add(mezzGroup);
// add health state here
setHealStatus4GroupObject(mezzGroup, Constant.ATTR_MEZZ_HEALTH_STATUS, childHealthList);
}
return deviceChildKeys;
}
Aggregations