| Constructor and Description |
|---|
ResourceManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResource(T newResource)
Adds the given resource to the resource hierarchy.
|
Set<T> |
getAllResources()
Returns an unordered set of all resources currently being managed.
|
org.jgrapht.traverse.BreadthFirstIterator<T,org.jgrapht.graph.DefaultEdge> |
getBreadthFirstIterator()
Returns an iterator that let's you walk the tree of resources breadth-first.
|
Set<T> |
getChildren(T resource)
Returns the direct children of the given resource.
|
org.jgrapht.traverse.DepthFirstIterator<T,org.jgrapht.graph.DefaultEdge> |
getDepthFirstIterator()
Returns an iterator that let's you walk the tree of resources depth-first.
|
T |
getParent(T resource)
Returns the direct parent of the given resource.
|
T |
getResource(ID resourceId)
Given a resource ID this will return the resource with that ID
or
null if there is no resource with that ID. |
org.jgrapht.graph.ListenableDirectedGraph<T,org.jgrapht.graph.DefaultEdge> |
getResourcesGraph() |
Set<T> |
getRootResources()
Returns resources that are at the top of the hierarchy (that is, they do not have a parent).
|
public org.jgrapht.graph.ListenableDirectedGraph<T,org.jgrapht.graph.DefaultEdge> getResourcesGraph()
public org.jgrapht.traverse.BreadthFirstIterator<T,org.jgrapht.graph.DefaultEdge> getBreadthFirstIterator()
public org.jgrapht.traverse.DepthFirstIterator<T,org.jgrapht.graph.DefaultEdge> getDepthFirstIterator()
public Set<T> getRootResources()
public T getResource(ID resourceId)
null if there is no resource with that ID.resourceId - the ID of the resource to retrievepublic Set<T> getChildren(T resource)
resource - the resource whose children are to be returnedpublic T getParent(T resource)
resource - the resource whose parent is to be returnedpublic Set<T> getAllResources()
public void addResource(T newResource) throws IllegalArgumentException
newResource - the new resource to be addedIllegalArgumentException - if the new resource's parent does not yet exist in the hierarchyCopyright © 2015 Red Hat, Inc.. All rights reserved.