Class GenericTypeResource
- java.lang.Object
-
- org.opennms.netmgt.collection.support.builder.AbstractResource
-
- org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource
-
- org.opennms.netmgt.collection.support.builder.GenericTypeResource
-
- All Implemented Interfaces:
Resource
public class GenericTypeResource extends DeferredGenericTypeResource
-
-
Constructor Summary
Constructors Constructor Description GenericTypeResource(NodeLevelResource node, ResourceType resourceType, java.lang.String instance)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getLabel(CollectionResource resource)
Returns a unique label for the instance of this resource.ResourcePath
getPath(CollectionResource resource)
Retrieves the path of the resource, relative to the repository root.PersistenceSelectorStrategy
getPersistenceSelectorStrategy()
ResourceType
getResourceType()
StorageStrategy
getStorageStrategy()
java.lang.String
getTypeName()
Returns the type name associated with the resource.int
hashCode()
Resource
resolve()
Used to lookup additional resource related information that may not have been available when the resource was created, and optionally return a new resource.protected static java.lang.String
sanitizeInstance(java.lang.String instance)
static java.lang.String
sanitizeInstanceStrict(java.lang.String instance)
java.lang.String
toString()
-
Methods inherited from class org.opennms.netmgt.collection.support.builder.DeferredGenericTypeResource
getFallbackTypeName, getInstance, getParent, getUnmodifiedInstance
-
Methods inherited from class org.opennms.netmgt.collection.support.builder.AbstractResource
getTimestamp, setTimestamp
-
-
-
-
Constructor Detail
-
GenericTypeResource
public GenericTypeResource(NodeLevelResource node, ResourceType resourceType, java.lang.String instance)
-
-
Method Detail
-
sanitizeInstance
protected static java.lang.String sanitizeInstance(java.lang.String instance)
-
sanitizeInstanceStrict
public static java.lang.String sanitizeInstanceStrict(java.lang.String instance)
-
getResourceType
public ResourceType getResourceType()
-
getLabel
public java.lang.String getLabel(CollectionResource resource)
Description copied from interface:Resource
Returns a unique label for the instance of this resource. This label is used by threshd to generate a unique id on a per resource basis, grouped by node. SeeCollectionResourceWrapper
- Specified by:
getLabel
in interfaceResource
- Overrides:
getLabel
in classDeferredGenericTypeResource
- Returns:
- a
String
object.
-
getPath
public ResourcePath getPath(CollectionResource resource)
Description copied from interface:Resource
Retrieves the path of the resource, relative to the repository root.- Specified by:
getPath
in interfaceResource
- Overrides:
getPath
in classDeferredGenericTypeResource
- Parameters:
resource
- Used by theGenericTypeResource
in order to determine the instance name.- Returns:
- relative path
-
resolve
public Resource resolve()
Description copied from interface:Resource
Used to lookup additional resource related information that may not have been available when the resource was created, and optionally return a new resource.
See
DeferredGenericTypeResource.resolve()
.This method should only be called when running in the context of the OpenNMS JVM (and not the Minion).
- Specified by:
resolve
in interfaceResource
- Overrides:
resolve
in classDeferredGenericTypeResource
- Returns:
- possibly a new resource, or this same instance if no resolving was performed
-
getStorageStrategy
public StorageStrategy getStorageStrategy()
-
getPersistenceSelectorStrategy
public PersistenceSelectorStrategy getPersistenceSelectorStrategy()
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:Resource
Returns the type name associated with the resource. Used for thresholding.- Specified by:
getTypeName
in interfaceResource
- Overrides:
getTypeName
in classDeferredGenericTypeResource
- Returns:
- type name
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDeferredGenericTypeResource
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDeferredGenericTypeResource
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classDeferredGenericTypeResource
-
-