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 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 CollectionSetDTO(CollectionAgent agent, CollectionStatus status, Date timestamp, Map<Resource, List<Attribute<?>>> attributesByResource, boolean disableCounterPersistence) { this.agent = new CollectionAgentDTO(agent); this.status = status; this.timestamp = timestamp; collectionResources = new ArrayList<>(); for (Entry<Resource, List<Attribute<?>>> entry : attributesByResource.entrySet()) { collectionResources.add(new CollectionResourceDTO(entry.getKey(), entry.getValue())); } if (disableCounterPersistence) { this.disableCounterPersistence = disableCounterPersistence; } }
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(); }
final CollectionAgentDTO agentDTO = new CollectionAgentDTO(agent); final CollectionSet collectionSet = minionCollector.collect(agentDTO, Collections.unmodifiableMap(unmarshaledParms)); assertEquals(CollectionStatus.SUCCEEDED, collectionSet.getStatus());
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; }
final CollectionAgentDTO agentDTO = new CollectionAgentDTO(agent); final CollectionSet collectionSet = minionCollector.collect(agentDTO, Collections.unmodifiableMap(unmarshaledParms)); assertEquals(CollectionStatus.SUCCEEDED, collectionSet.getStatus());
} else { request.setAgent(new CollectionAgentDTO(agent)); final Map<String, String> marshaledParms = serviceCollector.marshalParameters(allAttributes); marshaledParms.forEach(request::addAttribute);
} else { request.setAgent(new CollectionAgentDTO(agent)); final Map<String, String> marshaledParms = serviceCollector.marshalParameters(allAttributes); marshaledParms.forEach(request::addAttribute);