Search in sources :

Example 1 with BoardBean

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

the class ESightAdapter method setBoard.

private List<ResourceKey> setBoard(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
    List<ResourceKey> deviceChildKeys = new ArrayList<>();
    List<BoardBean> boardBeans = device.getBoard();
    if (!boardBeans.isEmpty()) {
        List<ResourceKey> boardResourceKey = new ArrayList<>();
        List<String> childHealthList = new ArrayList<>();
        for (BoardBean board : boardBeans) {
            ResourceKey boardKey = board.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
            boardResourceKey.add(boardKey);
            allResourceList.add(boardKey);
            childHealthList.add(ConvertUtils.convertHealthState(board.getHealthState()));
        }
        // board Group
        ResourceKey boardGroup = device.createGroupKey(Constant.TREE_BOARD_GROUP, Constant.KIND_BOARD_GROUP, boardResourceKey, relationshipsByResource, getAdapterKind());
        deviceChildKeys.add(boardGroup);
        // add health state here
        setHealStatus4GroupObject(boardGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
    }
    return deviceChildKeys;
}
Also used : ArrayList(java.util.ArrayList) BoardBean(com.huawei.esight.service.bean.BoardBean) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

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