Package org.opennms.netmgt.dao.mock
Class MockResourceDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.MockResourceDao
-
- All Implemented Interfaces:
ResourceDao
public class MockResourceDao extends Object implements ResourceDao
-
-
Constructor Summary
Constructors Constructor Description MockResourceDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
deleteResourceById(ResourceId resourceId)
Deletes the resource identified by the given resource ID.List<OnmsResource>
findTopLevelResources()
findTopLevelResourcesOnmsResource
getResourceById(ResourceId id)
getResourceByIdOnmsResource
getResourceForNode(OnmsNode node)
getResourceForNodeResourceId
getResourceId(CollectionResource resource, long nodeId)
Collection<OnmsResourceType>
getResourceTypes()
getResourceTypes
-
-
-
Method Detail
-
getResourceTypes
public Collection<OnmsResourceType> getResourceTypes()
Description copied from interface:ResourceDao
getResourceTypes
- Specified by:
getResourceTypes
in interfaceResourceDao
- Returns:
- a
Collection
object.
-
getResourceById
public OnmsResource getResourceById(ResourceId id)
Description copied from interface:ResourceDao
getResourceById
- Specified by:
getResourceById
in interfaceResourceDao
- Parameters:
id
- aString
object.- Returns:
- a
OnmsResource
object.
-
findTopLevelResources
public List<OnmsResource> findTopLevelResources()
Description copied from interface:ResourceDao
findTopLevelResources
- Specified by:
findTopLevelResources
in interfaceResourceDao
- Returns:
- a
List
object.
-
getResourceForNode
public OnmsResource getResourceForNode(OnmsNode node)
Description copied from interface:ResourceDao
getResourceForNode
- Specified by:
getResourceForNode
in interfaceResourceDao
- Parameters:
node
- aOnmsNode
object.- Returns:
- a
OnmsResource
object.
-
deleteResourceById
public boolean deleteResourceById(ResourceId resourceId)
Description copied from interface:ResourceDao
Deletes the resource identified by the given resource ID.- Specified by:
deleteResourceById
in interfaceResourceDao
- Parameters:
resourceId
- the ID of the resource to delete- Returns:
true
iff, the resource was found and deleted
-
getResourceId
public ResourceId getResourceId(CollectionResource resource, long nodeId)
- Specified by:
getResourceId
in interfaceResourceDao
-
-