Search in sources :

Example 1 with RAIDBean

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

the class ESightAdapter method setRaid.

private List<ResourceKey> setRaid(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
    List<ResourceKey> deviceChildKeys = new ArrayList<>();
    List<RAIDBean> raidBeans = device.getRAID();
    if (!raidBeans.isEmpty()) {
        List<ResourceKey> raidResourceKey = new ArrayList<>();
        List<String> childHealthList = new ArrayList<>();
        for (RAIDBean raid : raidBeans) {
            ResourceKey key = raid.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
            raidResourceKey.add(key);
            allResourceList.add(key);
            childHealthList.add(ConvertUtils.convertHealthState(raid.getHealthState()));
        }
        // RAID Group
        ResourceKey raidGroup = device.createGroupKey(Constant.TREE_RAID_GROUP, Constant.KIND_RAID_GROUP, raidResourceKey, relationshipsByResource, getAdapterKind());
        deviceChildKeys.add(raidGroup);
        // add health state here
        setHealStatus4GroupObject(raidGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
    }
    return deviceChildKeys;
}
Also used : ArrayList(java.util.ArrayList) RAIDBean(com.huawei.esight.service.bean.RAIDBean) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

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