public class ReferenceViewImpl extends java.lang.Object implements ReferenceView
| Constructor and Description |
|---|
ReferenceViewImpl(ConfigContextImpl configContext)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<Ref> |
findDependencies(Ref ref, java.util.Set<java.lang.String> typeIds, java.util.Set<java.lang.String> frontier, boolean includeMissingRefs)
Returns the list of all dependencies recursively starting from the given ref.
|
java.util.Set<Ref> |
findDependents(Ref ref, java.util.Set<java.lang.String> typeIds, java.util.Set<java.lang.String> frontier)
Returns the list of all dependents recursively starting from the given ref.
|
java.util.Set<Ref> |
getChildren(Ref ref)
returns the children contained in the parent ref.
|
java.util.Set<Ref> |
getDependencies(Ref ref)
returns the dependencies (resources) for the given ref.
|
java.util.Set<Ref> |
getDependents(Ref ref)
returns the dependents (resources) for the given ref - i.e.
|
Ref |
getParent(Ref ref)
returns the parent for the given child ref.
|
boolean |
hasCycle(Ref ref)
returns whether the given ref defines a cycle.
|
boolean |
hasCycle(Ref ref, java.util.Set<Ref> futureReferences)
returns whether the given ref will define a cycle if added the given references.
|
boolean |
hasDependencies(Ref ref)
returns whether the given ref has dependencies
|
boolean |
hasDependents(Ref ref)
returns whether the given ref has dependents
|
boolean |
isInCycle(Ref ref, java.util.Set<Ref> cycle)
returns whether the given ref is 'in' a cycle.
|
void |
sort(java.util.List<Ref> refs)
sorts the given list of resources (the list must allow sorting) by deletion order - i.e.
|
public ReferenceViewImpl(ConfigContextImpl configContext)
public boolean hasDependencies(Ref ref) throws NotFoundException
ReferenceViewhasDependencies in interface ReferenceViewNotFoundExceptionpublic java.util.Set<Ref> getDependencies(Ref ref) throws NotFoundException
ReferenceViewFor a resource, this basically returns the result of calling computeExternalReferences on this resource type def. For a location, this is the set of all resources that are outside this location but referenced by at least one resource in that location.
getDependencies in interface ReferenceViewNotFoundExceptionpublic java.util.Set<Ref> findDependencies(Ref ref, java.util.Set<java.lang.String> typeIds, java.util.Set<java.lang.String> frontier, boolean includeMissingRefs) throws NotFoundException
ReferenceViewfindDependencies in interface ReferenceViewref - the ref to start fromtypeIds - types of references to consider. If null, consider all types of referencesfrontier - indicates when to stop recursing (searching) along an edge. If non-null, and if recursing along an edge from Node A to Node B, the search stops along that edge stops after processing B. In other words there will be no recursing from Node B to its dependencies. If the value is null, the search does not stop based on the node type.includeMissingRefs - whether to include a reference in the result set even if it does not exist.NotFoundExceptionpublic boolean hasDependents(Ref ref)
ReferenceViewnote: a resource may have dependents even it if does not exist. This can happen if A depends on B and B gets deleted.
hasDependents in interface ReferenceViewpublic java.util.Set<Ref> getDependents(Ref ref)
ReferenceViewFor a location, this is the set of all resources that are outside this location but that reference a resource in that location.
note: a resource may have dependents even it if does not exist. This can happen if A depends on B and B gets deleted.
getDependents in interface ReferenceViewpublic java.util.Set<Ref> findDependents(Ref ref, java.util.Set<java.lang.String> typeIds, java.util.Set<java.lang.String> frontier)
ReferenceViewnote: a resource may have dependents even it if does not exist. This can happen if A depends on B and B gets deleted.
findDependents in interface ReferenceViewref - the ref to start fromtypeIds - types of references to consider. If null, consider all types of referencesfrontier - indicates when to stop recursing (searching) along an edge. If non-null, and if recursing along an edge from Node A to Node B, the search stops along that edge stops after processing B. In other words there will be no recursing from Node B to its dependents. If the value is null, the search does not stop based on the node type.public boolean hasCycle(Ref ref) throws NotFoundException
ReferenceViewhasCycle in interface ReferenceViewNotFoundExceptionpublic boolean hasCycle(Ref ref, java.util.Set<Ref> futureReferences) throws NotFoundException
ReferenceViewhasCycle in interface ReferenceViewNotFoundExceptionpublic boolean isInCycle(Ref ref, java.util.Set<Ref> cycle) throws NotFoundException
ReferenceViewisInCycle in interface ReferenceViewNotFoundExceptionpublic Ref getParent(Ref ref) throws ValidationException
ReferenceViewChildType.getParent in interface ReferenceViewValidationException - thrown if the parent cannot be found or if multiple parent existspublic java.util.Set<Ref> getChildren(Ref ref) throws NotFoundException
ReferenceViewParentType.getChildren in interface ReferenceViewNotFoundExceptionpublic void sort(java.util.List<Ref> refs) throws NotFoundException
ReferenceViewsort in interface ReferenceViewNotFoundException