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