Search in sources :

Example 6 with DeferredGenericTypeResource

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;
    }
}
Also used : DeferredGenericTypeResource(org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource) NodeLevelResource(org.opennms.netmgt.collection.support.builder.NodeLevelResource)

Aggregations

DeferredGenericTypeResource (org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource)6 NodeLevelResource (org.opennms.netmgt.collection.support.builder.NodeLevelResource)6 CollectionSetBuilder (org.opennms.netmgt.collection.support.builder.CollectionSetBuilder)4 Resource (org.opennms.netmgt.collection.support.builder.Resource)4 AttributeType (org.opennms.netmgt.collection.api.AttributeType)3 MalformedURLException (java.net.MalformedURLException)2 RemoteException (java.rmi.RemoteException)2 HashMap (java.util.HashMap)2 VmwareServer (org.opennms.netmgt.config.vmware.VmwareServer)2 VmwareViJavaAccess (org.opennms.protocols.vmware.VmwareViJavaAccess)2 HostRuntimeInfo (com.vmware.vim25.HostRuntimeInfo)1 HostSystemPowerState (com.vmware.vim25.HostSystemPowerState)1 HostSystem (com.vmware.vim25.mo.HostSystem)1 ManagedEntity (com.vmware.vim25.mo.ManagedEntity)1 Connection (java.sql.Connection)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 Date (java.util.Date)1 List (java.util.List)1