use of com.huawei.esight.service.bean.FanBean in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method setFan.
private List<ResourceKey> setFan(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device, List<ChildBladeBean> childBladeBeans) {
List<ResourceKey> deviceChildKeys = new ArrayList<>();
List<FanBean> fanBeans = device.getFan();
if (!fanBeans.isEmpty()) {
List<ResourceKey> fanResourceKey = new ArrayList<>();
List<String> childHealthList = new ArrayList<>();
for (FanBean fan : fanBeans) {
ResourceKey key = fan.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
fanResourceKey.add(key);
allResourceList.add(key);
if (childBladeBeans.isEmpty()) {
childHealthList.add(ConvertUtils.convertHealthState(fan.getHealthState()));
}
}
// fan Group
ResourceKey fanGroup = device.createGroupKey(Constant.TREE_FAN_GROUP, Constant.KIND_FAN_GROUP, fanResourceKey, relationshipsByResource, getAdapterKind());
deviceChildKeys.add(fanGroup);
// add health state here
if (!childBladeBeans.isEmpty()) {
String groupHealth = ConvertUtils.convertHealthState(device.getFanOverHealth());
childHealthList.add(groupHealth);
}
setHealStatus4GroupObject(fanGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
}
return deviceChildKeys;
}
Aggregations