Search in sources :

Example 1 with FanBean

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;
}
Also used : FanBean(com.huawei.esight.service.bean.FanBean) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

FanBean (com.huawei.esight.service.bean.FanBean)1 ResourceKey (com.integrien.alive.common.adapter3.ResourceKey)1 ArrayList (java.util.ArrayList)1