/** * 将SnmpDevice任务添加到domainComponent * * @param SnmpDeviceNodeEntity */ private void addSnmpDeviceNodeToDomain(SnmpDeviceNodeEntity entity) { DomainComponent domainComp = m_domainLocator.createDomainIfNessary(entity.getDomain()); nodeidMaps.put(entity.getNodeid(), domainComp); SnmpDeviceNode node = createSnmpDeviceNode(entity); domainComp.addSnmpCollectdNode(node); }
public SnmpDeviceStatus getSnmpDeviceStatus(String nodeid) { DomainComponent domainComp = nodeidMaps.get(nodeid); if (domainComp != null) { return domainComp.getSnmpDeviceStatus(nodeid); } return null; }
// 根据nodeid获得域ID public static String getDomainId(String nodeid) { DomainComponent domainComp = nodeidMaps.get(nodeid); if (domainComp != null) { return domainComp.getDomainId(); } else { return null; } }
private void removeSnmpDeviceNodeFromDomain(String nodeid) { DomainComponent domainComp = nodeidMaps.get(nodeid); if (domainComp != null) { domainComp.removeSnmpCollectdNode(nodeid); } else { if (log().isDebugEnabled()) { log().debug("removeSnmpDeviceNode没有找到该nodeId:" + nodeid + "对应的域 "); } } }
/** 用nodeid做索引存储SnmpDeviceStatus采集结果到内存域中。 */ public void cacheSnmpDeviceResult(String nodeid, SnmpDeviceStatus status) { DomainComponent domainComp = nodeidMaps.get(nodeid); if (domainComp != null) { domainComp.cacheSnmpDeviceResult(nodeid, status); } }