use of org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource in project opennms by OpenNMS.
the class AbstractXmlCollectionHandler method getCollectionResource.
/**
* Gets the collection resource.
*
* @param agent the collection agent
* @param instance the resource instance
* @param resourceType the resource type
* @param timestamp the timestamp
* @return the collection resource
*/
protected Resource getCollectionResource(CollectionAgent agent, String instance, String resourceType, Date timestamp) {
final NodeLevelResource nodeResource = new NodeLevelResource(agent.getNodeId());
if (CollectionResource.RESOURCE_TYPE_NODE.equalsIgnoreCase(resourceType)) {
return nodeResource;
} else {
DeferredGenericTypeResource resource = new DeferredGenericTypeResource(nodeResource, resourceType, FALLBACK_RESOURCE_TYPE_NAME, instance);
if (timestamp != null) {
LOG.debug("getCollectionResource: the date that will be used when updating the RRDs is {}", timestamp);
resource.setTimestamp(timestamp);
}
return resource;
}
}
Aggregations