private String getTypeFromCategories(OnmsNode node) { for (String rancidType: m_rancid_categories) { for (OnmsCategory nodecategory: node.getCategories()) { if (nodecategory.getName().equalsIgnoreCase(rancidType)) { LOG.debug("getTypeFromCategories: Found Matching Category: Rancid devicetype found: {}", rancidType); return rancidType; } } } LOG.warn("getTypeFromCategories: No Matching Category found: trying to get devicetype using config file"); return getTypeFromCategories(node); }
private String getTypeFromCategories(OnmsNode node) { for (String rancidType: m_rancid_categories) { for (OnmsCategory nodecategory: node.getCategories()) { if (nodecategory.getName().equalsIgnoreCase(rancidType)) { LOG.debug("getTypeFromCategories: Found Matching Category: Rancid devicetype found: {}", rancidType); return rancidType; } } } LOG.warn("getTypeFromCategories: No Matching Category found: trying to get devicetype using config file"); return getTypeFromCategories(node); }
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(),node.getSysDescription())); } r_node.setStateUp(false); r_node.setComment(RANCID_COMMENT+" nodeid:" + node.getNodeId()); r_node.setAuth(getSuitableRancidNodeAuthentication(node)); return r_node; }
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(),node.getSysDescription())); } r_node.setStateUp(false); r_node.setComment(RANCID_COMMENT+" nodeid:" + node.getNodeId()); r_node.setAuth(getSuitableRancidNodeAuthentication(node)); return r_node; }