Package org.opennms.netmgt.mock
Class MockResourceType
- java.lang.Object
-
- org.opennms.netmgt.mock.MockResourceType
-
- All Implemented Interfaces:
OnmsResourceType
public class MockResourceType extends java.lang.Object implements OnmsResourceType
-
-
Constructor Summary
Constructors Constructor Description MockResourceType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnmsResource
getChildByName(OnmsResource parent, java.lang.String name)
Retrieves a child resource with the given name from the parent.java.lang.String
getLabel()
Provides a human-friendly label for this resource type.java.lang.String
getLinkForResource(OnmsResource resource)
getLinkForResourcejava.lang.String
getName()
Provides a unique name for this resource type.java.util.List<OnmsResource>
getResourcesForParent(OnmsResource parent)
Returns the set of resources that are available on the given parent.boolean
isResourceTypeOnParent(OnmsResource parent)
Returns true if one on more instances of the resource type are present on the parent resource.void
setLabel(java.lang.String label)
void
setLink(java.lang.String link)
void
setName(java.lang.String name)
-
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Description copied from interface:OnmsResourceType
Provides a human-friendly label for this resource type. It is particularly used in the webUI to describe this resource type.- Specified by:
getLabel
in interfaceOnmsResourceType
- Returns:
- human-friendly label
-
getLinkForResource
public java.lang.String getLinkForResource(OnmsResource resource)
Description copied from interface:OnmsResourceType
getLinkForResource
- Specified by:
getLinkForResource
in interfaceOnmsResourceType
- Parameters:
resource
- aOnmsResource
object.- Returns:
- a
String
object.
-
getName
public java.lang.String getName()
Description copied from interface:OnmsResourceType
Provides a unique name for this resource type.- Specified by:
getName
in interfaceOnmsResourceType
- Returns:
- unique name
-
isResourceTypeOnParent
public boolean isResourceTypeOnParent(OnmsResource parent)
Description copied from interface:OnmsResourceType
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)
Description copied from interface:OnmsResourceType
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 name)
Description copied from interface:OnmsResourceType
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
-
setLink
public void setLink(java.lang.String link)
-
setLabel
public void setLabel(java.lang.String label)
-
setName
public void setName(java.lang.String name)
-
-