Package org.opennms.netmgt.dao.support
Class AbstractTopLevelResourceType
- java.lang.Object
-
- org.opennms.netmgt.dao.support.AbstractTopLevelResourceType
-
- All Implemented Interfaces:
OnmsResourceType
- Direct Known Subclasses:
DomainResourceType
,NodeResourceType
public abstract class AbstractTopLevelResourceType extends Object implements OnmsResourceType
Extended by all top-level resources to ensure consistent behavior.- Author:
- jwhite
-
-
Constructor Summary
Constructors Constructor Description AbstractTopLevelResourceType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description OnmsResource
getChildByName(OnmsResource parent, String name)
Retrieves a child resource with the given name from the parent.abstract OnmsResource
getResourceByName(String name)
List<OnmsResource>
getResourcesForParent(OnmsResource parent)
Returns the set of resources that are available on the given parent.abstract List<OnmsResource>
getTopLevelResources()
boolean
isResourceTypeOnParent(OnmsResource parent)
Returns true if one on more instances of the resource type are present on the parent resource.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.model.OnmsResourceType
getLabel, getLinkForResource, getName
-
-
-
-
Method Detail
-
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 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, 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
-
getTopLevelResources
public abstract List<OnmsResource> getTopLevelResources()
-
getResourceByName
public abstract OnmsResource getResourceByName(String name)
-
-