Search in sources :

Example 1 with NetworkCardBean

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

the class ESightAdapter method setNetworkCard.

private List<ResourceKey> setNetworkCard(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
    List<ResourceKey> deviceChildKeys = new ArrayList<>();
    List<NetworkCardBean> networkcardBeans = device.getNetworkCard();
    if (!networkcardBeans.isEmpty()) {
        List<ResourceKey> netWorkCardResourceKey = new ArrayList<>();
        List<String> childHealthList = new ArrayList<>();
        for (NetworkCardBean bean : networkcardBeans) {
            ResourceKey key = bean.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
            netWorkCardResourceKey.add(key);
            allResourceList.add(key);
            childHealthList.add(ConvertUtils.convertHealthState(bean.getHealthState()));
        }
        // network card Group
        ResourceKey networkCardGroup = device.createGroupKey(Constant.TREE_NETWORK_CARD_GROUP, Constant.KIND_NETWORK_CARD_GROUP, netWorkCardResourceKey, relationshipsByResource, getAdapterKind());
        deviceChildKeys.add(networkCardGroup);
        setHealStatus4GroupObject(networkCardGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
    }
    return deviceChildKeys;
}
Also used : NetworkCardBean(com.huawei.esight.service.bean.NetworkCardBean) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

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