public class PathCompletion
extends java.lang.Object
implements java.lang.Cloneable
PathCompletion holds this information and even allows to
change it.
It's possible to define more than one completion for a certain entity type of
which all of them have to be evaluated. Basically this means that if more
than one completion exists, the whole path up to this point has to be
duplicated and followed for each completion. These new paths must be combined
using OR.
It may even be that there are no completions for a certain entity type at
all, which may of course cause OrgPolicies to fail.
In any case, one should be careful about changing the default behaviour of
PathCompletion as any change may have a great impact on the
results of existing OrgPolicies or may even cause them to be no longer
resolvable at all (as opposed to policies that can be resolved but produce an
empty result list).
There can't be a completion for Agent as this entity type obviously doesn't need one.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<EntityType,NavFunction[]> |
completions
holds all path completions
|
| Constructor and Description |
|---|
PathCompletion()
Constructs a new
PathCompletion with these default values:
Path completions per entity type. |
PathCompletion(java.util.Map<EntityType,NavFunction[]> completions)
Constructs a new
PathCompletion with the designated values. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
checkConsistency()
Checks the consistency of this path completion, that is, whether it
contains a cycle.
|
void |
clearCompletionsFor(EntityType entType,
boolean resetToDefaults)
Clears the completions for the given entity type and optionally resets them
back to the default values.
|
PathCompletion |
clonePathCompletion()
Clones this path completion by returning a new path completion object
having the same path completions as this object.
|
NavFunction[] |
getCompletionsFor(EntityType entType)
Returns the path completion(s) for the given entity type or
null if there is no completion defined. |
void |
setCompletionsFor(EntityType entType,
NavFunction... functions)
Sets the path completions for the given entity type.
|
protected final java.util.Map<EntityType,NavFunction[]> completions
public PathCompletion()
PathCompletion with these default values:
| end of path | completed to |
|---|---|
| OrgPosition | .getAgents() |
| OrgUnit | .getOrgPositions() |
| OrgGroup | .getOrgUnits() |
| ProjectGroup | .getOrgUnits() + .getOrgPositions() |
| Ability | .getRoles() + .getAgents() |
| Role | .getOrgPositions() |
| SubstitutionRule | .getSubstitute() |
public PathCompletion(java.util.Map<EntityType,NavFunction[]> completions)
PathCompletion with the designated values.
Entity types that do not have a completion in the designated map will be
set to the default path completion.completions - The path completions for entity types. The functions are
not chained but OR’ed. Not all entity types need to be set here.
For unset completions the default will be used.public NavFunction[] getCompletionsFor(EntityType entType)
null if there is no completion defined. See the class
description for more information on what the NavFunction array
contains.entType - the entity type for which to return the completionsnull if there is no completion definedpublic void setCompletionsFor(EntityType entType, NavFunction... functions)
entType - the entity type to set the path completion forfunctions - the function(s) a path ending on the given entity type
should be completed withpublic void clearCompletionsFor(EntityType entType, boolean resetToDefaults)
entType - the entity type for which the path completions should be
cleared or resetresetToDefaults - whether the completions should be reset to the
default valuespublic java.lang.String checkConsistency()
OrgModelManager.null).public PathCompletion clonePathCompletion()