org.opennms.netmgt.model
Interface OnmsResourceType


public interface OnmsResourceType


Method Summary
 java.lang.String getLabel()
          Provides a human-friendly label for this resource type.
 java.lang.String getLinkForResource(OnmsResource resource)
           
 java.lang.String getName()
          Provides a unique name for this resource type.
 java.lang.String getRelativePathForAttribute(java.lang.String resourceParent, java.lang.String resource, java.lang.String attribute)
          Gets a relative path for an attribute on a resource of this resource type.
 java.util.List<OnmsResource> getResourcesForDomain(java.lang.String domain)
          Gets a list of resources on a specific domain.
 java.util.List<OnmsResource> getResourcesForNode(int nodeId)
          Gets a list of resources on a specific node.
 boolean isResourceTypeOnDomain(java.lang.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.
 

Method Detail

getName

java.lang.String getName()
Provides a unique name for this resource type.

Returns:
unique name

getLabel

java.lang.String getLabel()
Provides a human-friendly label for this resource type. It is particularly used in the webUI to describe this resource type.

Returns:
human-friendly label

isResourceTypeOnNode

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).

Parameters:
nodeId - node ID to check
Returns:
true if this resource type is on this node, false otherwise

getResourcesForNode

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

Parameters:
nodeId - node ID for which to get resources
Returns:
list of resources

getRelativePathForAttribute

java.lang.String getRelativePathForAttribute(java.lang.String resourceParent,
                                             java.lang.String resource,
                                             java.lang.String attribute)
Gets a relative path for an attribute on a resource of this resource type.

Parameters:
resourceParent - path to the parent of this resource
resource - the resource on this resource type
attribute - the attribute on the specific resource
Returns:
relative path

isResourceTypeOnDomain

boolean isResourceTypeOnDomain(java.lang.String domain)
Checks whether this resource type is on a specific domain. If possible, this should have less overhead than calling #getResourcesForDomain(String).

Parameters:
domain - domain to check
Returns:
true if this resource type is on this domain, false otherwise

getResourcesForDomain

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

Parameters:
domain - domain for which to get resources
Returns:
list of resources

getLinkForResource

java.lang.String getLinkForResource(OnmsResource resource)


Copyright © 2007. All Rights Reserved.