当前位置: 首页>>代码示例>>Java>>正文


Java RancidNode.setDeviceType方法代码示例

本文整理汇总了Java中org.opennms.rancid.RancidNode.setDeviceType方法的典型用法代码示例。如果您正苦于以下问题:Java RancidNode.setDeviceType方法的具体用法?Java RancidNode.setDeviceType怎么用?Java RancidNode.setDeviceType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opennms.rancid.RancidNode的用法示例。


在下文中一共展示了RancidNode.setDeviceType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSuitableRancidNode

import org.opennms.rancid.RancidNode; //导入方法依赖的package包/类
private RancidNode getSuitableRancidNode(OnmsNode node) {
    

    //The group should be the foreign source of the node

    String group = node.getForeignSource();

    if (group == null) return null;
    RancidNode r_node = new RancidNode(group, node.getLabel());

    String ipaddress = m_onmsNodeIpMap.get(node.getId());

    if (m_rancidAdapterConfig.useCategories(ipaddress)) {
        log().debug("getSuitableRancidNode: Using Categories to get Rancid devicetype for node: " + node.getLabel());
        r_node.setDeviceType(getTypeFromCategories(node)); 
    } else {
        log().debug("getSuitableRancidNode: Using Sysoid to get Rancid devicetype for node: " + node.getLabel());
        r_node.setDeviceType(getTypeFromSysObjectId(node.getSysObjectId()));
    }
    r_node.setStateUp(false);
    r_node.setComment(RANCID_COMMENT);
    r_node.setAuth(getSuitableRancidNodeAuthentication(node));
    return r_node;
    

}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:27,代码来源:RancidProvisioningAdapter.java

示例2: updateNodeOnRouterDb

import org.opennms.rancid.RancidNode; //导入方法依赖的package包/类
/**
 * <p>updateNodeOnRouterDb</p>
 *
 * @param groupName a {@link java.lang.String} object.
 * @param deviceName a {@link java.lang.String} object.
 * @param deviceType a {@link java.lang.String} object.
 * @param status a {@link java.lang.String} object.
 * @param comment a {@link java.lang.String} object.
 * @return a boolean.
 */
public boolean updateNodeOnRouterDb(String groupName, String deviceName, String deviceType, String status, String comment ){
    
    log().debug("InventoryService updateNodeOnRouterDb: " + groupName+"->"+deviceName+":"+ deviceType+":"+ status + ":" + comment);

    try {  
        RancidNode rn = RWSClientApi.getRWSRancidNodeTLO(m_cp, groupName, deviceName);
        rn.setDeviceType(deviceType);
        if (comment != null) rn.setComment(comment);
        if ("up".equalsIgnoreCase(status)) {
            rn.setStateUp(true);
        } else if ("down".equalsIgnoreCase(status)) {
            rn.setStateUp(false);
        }
        RWSClientApi.updateRWSRancidNode(m_cp, rn);
    }
    catch (Throwable e){
        log().debug("updateNodeOnRouterDb has given exception on node "  + groupName+"/"+deviceName + " "+ e.getMessage() );
        return false;
    }
    return true;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:32,代码来源:InventoryService.java

示例3: createNodeOnRouterDb

import org.opennms.rancid.RancidNode; //导入方法依赖的package包/类
/**
  * <p>createNodeOnRouterDb</p>
  *
  * @param groupName a {@link java.lang.String} object.
  * @param deviceName a {@link java.lang.String} object.
  * @param deviceType a {@link java.lang.String} object.
  * @param status a {@link java.lang.String} object.
  * @param comment a {@link java.lang.String} object.
  * @return a boolean.
  */
 public boolean createNodeOnRouterDb(String groupName, String deviceName, String deviceType, String status,String comment ){
     
     log().debug("InventoryService createNodeOnRouterDb: " + groupName+"->"+deviceName+":"+ deviceType+":"+ status + ":" + comment);

     try {  
         RancidNode rn = new RancidNode(groupName,deviceName);
         rn.setDeviceType(deviceType);
         if (comment != null) rn.setComment(comment);
         if ("up".equalsIgnoreCase(status)) {
             rn.setStateUp(true);
         } else if ("down".equalsIgnoreCase(status)) {
             rn.setStateUp(false);
         }
         RWSClientApi.createRWSRancidNode(m_cp, rn);
     }
     catch (Throwable e){
         log().debug("createNodeOnRouterDb has given exception on node "  + groupName+"/"+deviceName + " "+ e.getMessage() );
         return false;
     }
     return true;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:32,代码来源:InventoryService.java


注:本文中的org.opennms.rancid.RancidNode.setDeviceType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。