L - the type of the protocol specific location, typically a subclass of NodeLocationpublic final class ResourceTypeManager<L> extends Object
ResourceTypeManager are immutable and can thus be shared
among concurrent threads. The graph itself is never exposed externally - ResourceTypeManager rather provides
methods to retrieve data from the graph.| Constructor and Description |
|---|
ResourceTypeManager(Collection<ResourceType<L>> allTypes)
A simpler constructor that accepts a simple collection of all resource types that will be stored
in this type manager.
|
ResourceTypeManager(Map<Name,TypeSet<ResourceType<L>>> resourceTypeSetMap,
Collection<Name> setsToUse)
Adds the given types to the manager, building a graph to represent the type hierarchy.
|
| Modifier and Type | Method and Description |
|---|---|
Set<ResourceType<L>> |
getChildren(ResourceType<L> resourceType)
Returns the direct child types of the given resource type.
|
Set<ResourceType<L>> |
getParents(ResourceType<L> resourceType)
Returns the direct parent types of the given resource type.
|
List<ResourceType<L>> |
getResourceTypesBreadthFirst()
Returns an immutable
List of all ResourceTypes contained in resourceTypesGraph in
breadth-first order. |
Set<ResourceType<L>> |
getRootResourceTypes()
Returns resource types that are at the top of the hierarchy (that is, they do not have any parent types).
|
public ResourceTypeManager(Collection<ResourceType<L>> allTypes)
allTypes - all types contained in this managerpublic ResourceTypeManager(Map<Name,TypeSet<ResourceType<L>>> resourceTypeSetMap, Collection<Name> setsToUse) throws IllegalStateException
resourceTypeSetMap - a full set of types, must be immutablesetsToUse - optional set of type names that the manager to care about - it will ignore others it finds. If
null, then the full set is used (by "full set" it means the resourceTypeSetMap param).IllegalStateException - if types are missing (e.g. a type needs a parent but the parent is missing)public List<ResourceType<L>> getResourceTypesBreadthFirst()
List of all ResourceTypes contained in resourceTypesGraph in
breadth-first order.ResourceTypespublic Set<ResourceType<L>> getRootResourceTypes()
public Set<ResourceType<L>> getChildren(ResourceType<L> resourceType)
resourceType - the type whose children are to be returnedpublic Set<ResourceType<L>> getParents(ResourceType<L> resourceType)
resourceType - the type whose parents are to be returnedCopyright © 2015–2017 Red Hat, Inc.. All rights reserved.