Package org.opennms.netmgt.dao.support
Class GenericIndexResourceType
- java.lang.Object
-
- org.opennms.netmgt.dao.support.GenericIndexResourceType
-
- All Implemented Interfaces:
OnmsResourceType
public final class GenericIndexResourceType extends java.lang.Object implements OnmsResourceType
Generic index resources are stored in paths like: snmp/1/${name}/${index}/ds.rrd The name and index elements depend on the implementation. Implementations are loaded from the data-collection configuration at run-time.
-
-
Constructor Summary
Constructors Constructor Description GenericIndexResourceType(ResourceStorageDao resourceStorageDao, java.lang.String name, java.lang.String label, java.lang.String resourceLabelExpression, StorageStrategy storageStrategy)
Constructor for GenericIndexResourceType.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.util.Map<java.lang.String,GenericIndexResourceType>
createTypes(java.util.Map<java.lang.String,ResourceType> configuredResourceTypes, ResourceStorageDao resourceStorageDao)
OnmsResource
getChildByName(OnmsResource parent, java.lang.String index)
Retrieves a child resource with the given name from the parent.java.lang.String
getLabel()
getLabeljava.lang.String
getLinkForResource(OnmsResource resource)
getLinkForResourcejava.lang.String
getName()
getNameOnmsResource
getResourceByPath(ResourcePath path, OnmsResource parent)
java.util.List<OnmsResource>
getResourcesForParent(OnmsResource parent)
Returns the set of resources that are available on the given parent.StorageStrategy
getStorageStrategy()
getStorageStrategyboolean
isResourceTypeOnParent(OnmsResource parent)
Returns true if one on more instances of the resource type are present on the parent resource.java.lang.String
toString()
-
-
-
Constructor Detail
-
GenericIndexResourceType
public GenericIndexResourceType(ResourceStorageDao resourceStorageDao, java.lang.String name, java.lang.String label, java.lang.String resourceLabelExpression, StorageStrategy storageStrategy)
Constructor for GenericIndexResourceType.
- Parameters:
resourceStorageDao
- aResourceStorageDao
object.name
- aString
object.label
- aString
object.resourceLabelExpression
- aString
object.storageStrategy
- aStorageStrategy
object.
-
-
Method Detail
-
getName
public java.lang.String getName()
getName
- Specified by:
getName
in interfaceOnmsResourceType
- Returns:
- a
String
object.
-
getLabel
public java.lang.String getLabel()
getLabel
- Specified by:
getLabel
in interfaceOnmsResourceType
- Returns:
- a
String
object.
-
getStorageStrategy
public StorageStrategy getStorageStrategy()
getStorageStrategy
- Returns:
- a
StorageStrategy
object.
-
isResourceTypeOnParent
public boolean isResourceTypeOnParent(OnmsResource parent)
Returns true if one on more instances of the resource type are present on the parent resource. Top-level resource types should always return false.- Specified by:
isResourceTypeOnParent
in interfaceOnmsResourceType
-
getResourcesForParent
public java.util.List<OnmsResource> getResourcesForParent(OnmsResource parent)
Returns the set of resources that are available on the given parent. If none are available, i.e. isResourceTypeOnParent() would return false, then an empty list should be returned. Top-level resource types should return the set of top-level resources when parent is null.- Specified by:
getResourcesForParent
in interfaceOnmsResourceType
-
getChildByName
public OnmsResource getChildByName(OnmsResource parent, java.lang.String index)
Retrieves a child resource with the given name from the parent.- Specified by:
getChildByName
in interfaceOnmsResourceType
- Returns:
- null if no resource with the given name was found
-
getLinkForResource
public java.lang.String getLinkForResource(OnmsResource resource)
getLinkForResource
- Specified by:
getLinkForResource
in interfaceOnmsResourceType
- Parameters:
resource
- aOnmsResource
object.- Returns:
- a
String
object.
-
getResourceByPath
public OnmsResource getResourceByPath(ResourcePath path, OnmsResource parent)
-
createTypes
protected static java.util.Map<java.lang.String,GenericIndexResourceType> createTypes(java.util.Map<java.lang.String,ResourceType> configuredResourceTypes, ResourceStorageDao resourceStorageDao)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-