org.opennms.netmgt.dao.support
Class GenericIndexResourceType

java.lang.Object
  extended by org.opennms.netmgt.dao.support.GenericIndexResourceType
All Implemented Interfaces:
OnmsResourceType

public class GenericIndexResourceType
extends Object
implements OnmsResourceType

GenericIndexResourceType class.

Version:
$Id: $
Author:
ranger

Nested Class Summary
 class GenericIndexResourceType.AttributeLoader
           
 
Constructor Summary
GenericIndexResourceType(ResourceDao resourceDao, String name, String label, String resourceLabelExpression, StorageStrategy storageStrategy)
          Constructor for GenericIndexResourceType.
 
Method Summary
 String getLabel()
          getLabel
 String getLinkForResource(OnmsResource resource)
          getLinkForResource
 String getName()
          getName
 List<String> getQueryableIndexesForNode(int nodeId)
          getQueryableIndexesForNode
 String getRelativePathForResource(int nodeId, String index)
          getRelativePathForResource
 OnmsResource getResourceByNodeAndIndex(int nodeId, String index)
          getResourceByNodeAndIndex
 List<OnmsResource> getResourcesForDomain(String domain)
          Gets a list of resources on a specific domain.
 List<OnmsResource> getResourcesForNode(int nodeId)
          Gets a list of resources on a specific node.
 StorageStrategy getStorageStrategy()
          getStorageStrategy
 boolean isResourceTypeOnDomain(String domain)
          Checks whether this resource type is on a specific domain.
 boolean isResourceTypeOnNode(int nodeId)
          Checks whether this resource type is on a specific node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericIndexResourceType

public GenericIndexResourceType(ResourceDao resourceDao,
                                String name,
                                String label,
                                String resourceLabelExpression,
                                StorageStrategy storageStrategy)

Constructor for GenericIndexResourceType.

Parameters:
resourceDao - a ResourceDao object.
name - a String object.
label - a String object.
resourceLabelExpression - a String object.
storageStrategy - a StorageStrategy object.
Method Detail

getName

public String getName()

getName

Specified by:
getName in interface OnmsResourceType
Returns:
a String object.

getLabel

public String getLabel()

getLabel

Specified by:
getLabel in interface OnmsResourceType
Returns:
a String object.

getStorageStrategy

public StorageStrategy getStorageStrategy()

getStorageStrategy

Returns:
a StorageStrategy object.

isResourceTypeOnNode

public boolean isResourceTypeOnNode(int nodeId)
Checks whether this resource type is on a specific node. If possible, this should have less overhead than calling #getResourcesForNode(int).

Specified by:
isResourceTypeOnNode in interface OnmsResourceType
Parameters:
nodeId - node ID to check
Returns:
true if this resource type is on this node, false otherwise

getResourcesForNode

public List<OnmsResource> getResourcesForNode(int nodeId)
Gets a list of resources on a specific node.

Specified by:
getResourcesForNode in interface OnmsResourceType
Parameters:
nodeId - node ID for which to get resources
Returns:
list of resources

getQueryableIndexesForNode

public List<String> getQueryableIndexesForNode(int nodeId)

getQueryableIndexesForNode

Parameters:
nodeId - a int.
Returns:
a List object.

getResourceByNodeAndIndex

public OnmsResource getResourceByNodeAndIndex(int nodeId,
                                              String index)

getResourceByNodeAndIndex

Parameters:
nodeId - a int.
index - a String object.
Returns:
a OnmsResource object.

getRelativePathForResource

public String getRelativePathForResource(int nodeId,
                                         String index)

getRelativePathForResource

Parameters:
nodeId - a int.
index - a String object.
Returns:
a String object.

isResourceTypeOnDomain

public boolean isResourceTypeOnDomain(String domain)
Checks whether this resource type is on a specific domain. If possible, this should have less overhead than calling #getResourcesForDomain(String). This resource type is never available for domains. Only the interface resource type is available for domains.

Specified by:
isResourceTypeOnDomain in interface OnmsResourceType
Parameters:
domain - domain to check
Returns:
true if this resource type is on this domain, false otherwise

getResourcesForDomain

public List<OnmsResource> getResourcesForDomain(String domain)
Gets a list of resources on a specific domain.

Specified by:
getResourcesForDomain in interface OnmsResourceType
Parameters:
domain - domain for which to get resources
Returns:
list of resources

getLinkForResource

public String getLinkForResource(OnmsResource resource)

getLinkForResource

Specified by:
getLinkForResource in interface OnmsResourceType
Parameters:
resource - a OnmsResource object.
Returns:
a String object.


Copyright © 2011. All Rights Reserved.