Search in sources :

Example 1 with PSUBean

use of com.huawei.esight.service.bean.PSUBean in project Server_Management_Plugin_vRealize by Huawei.

the class ESightAdapter method setPsu.

private List<ResourceKey> setPsu(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device, List<ChildBladeBean> childBladeBeans) {
    List<ResourceKey> deviceChildKeys = new ArrayList<>();
    List<PSUBean> psuBeans = device.getPSU();
    if (!psuBeans.isEmpty()) {
        List<ResourceKey> psuResourceKey = new ArrayList<>();
        List<String> childHealthList = new ArrayList<>();
        for (PSUBean psu : psuBeans) {
            ResourceKey key = psu.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
            psuResourceKey.add(key);
            allResourceList.add(key);
            if (childBladeBeans.isEmpty()) {
                childHealthList.add(ConvertUtils.convertHealthState(psu.getHealthState()));
            }
        }
        // PSU Group
        ResourceKey psuGroup = device.createGroupKey(Constant.TREE_PSU_GROUP, Constant.KIND_PSU_GROUP, psuResourceKey, relationshipsByResource, getAdapterKind());
        deviceChildKeys.add(psuGroup);
        // add health state here
        if (!childBladeBeans.isEmpty()) {
            String groupHealth = ConvertUtils.convertHealthState(device.getPemHealth());
            childHealthList.add(groupHealth);
        }
        setHealStatus4GroupObject(psuGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
    }
    return deviceChildKeys;
}
Also used : PSUBean(com.huawei.esight.service.bean.PSUBean) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

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