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; } }
public CollectionAgentDTO(CollectionAgent agent) { Objects.requireNonNull(agent); for (String attribute : agent.getAttributeNames()) { setAttribute(attribute, agent.getAttribute(attribute)); } address = agent.getAddress(); storeByForeignSource = agent.isStoreByForeignSource(); nodeId = agent.getNodeId(); nodeLabel = agent.getNodeLabel(); foreignSource = agent.getForeignSource(); foreignId = agent.getForeignId(); location = agent.getLocationName(); setStorageResourcePath(agent.getStorageResourcePath()); sysUpTime = agent.getSavedSysUpTime(); }
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; }