private CollectionAgent getCollectionAgent() { final InetAddress hostAddr = InetAddrUtils.addr(host); if (nodeCriteria != null) { return collectionAgentFactory.createCollectionAgentAndOverrideLocation(nodeCriteria, hostAddr, location); } else { System.out.println("NOTE: Some collectors require a database node and IP interface.\n"); final CollectionAgentDTO agent = new CollectionAgentDTO(); agent.setLocationName(location); agent.setAddress(hostAddr); agent.setStorageResourcePath(ResourcePath.fromString("")); return agent; } }
private CollectionAgent createAgent(OnmsIpInterface ipIf, OnmsNode node, String location) { final CollectionAgentDTO agent = new CollectionAgentDTO(); agent.setAddress(ipIf.getIpAddress()); agent.setForeignId(node.getForeignId()); agent.setForeignSource(node.getForeignSource()); agent.setNodeId(node.getId()); agent.setNodeLabel(node.getLabel()); agent.setLocationName(location); agent.setStorageResourcePath(DefaultCollectionAgentService.createStorageResourcePath(agent)); agent.setStoreByForeignSource(storeByForeignSource); return agent; }
private CollectionAgent createAgent(OnmsIpInterface ipIf, OnmsNode node, String location) { final CollectionAgentDTO agent = new CollectionAgentDTO(); agent.setAddress(ipIf.getIpAddress()); agent.setForeignId(node.getForeignId()); agent.setForeignSource(node.getForeignSource()); agent.setNodeId(node.getId()); agent.setNodeLabel(node.getLabel()); agent.setLocationName(location); agent.setStorageResourcePath(DefaultCollectionAgentService.createStorageResourcePath(agent)); agent.setStoreByForeignSource(storeByForeignSource); return agent; }