Class AssignmentPathImpl
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.lens.assignments.AssignmentPathImpl
-
- All Implemented Interfaces:
AssignmentPath,DebugDumpable,ShortDumpable,Serializable,Cloneable
public class AssignmentPathImpl extends Object implements AssignmentPath
Path from focus object to a given assignment. Contains also some (although not complete) information on evaluation of individual segments.- Author:
- semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description AssignmentPathImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(AssignmentPathSegmentImpl segment)AssignmentPathSegmentImplbeforeLast(int n)AssignmentPathImplclone()Shallow clone.AssignmentPathImplcloneFirst(int n)ExtensionTypecollectExtensions(int startAt)intcountTargetOccurrences(ObjectType target)StringdebugDump(int indent)booleanequivalent(AssignmentPath other)Preliminary (limited) implementation.AssignmentPathSegmentImplfirst()ObjectTypegetConstructionThisObject()Used as a source for thisObject variable.@NotNull List<ObjectType>getFirstOrderChain()Returns a "user understandable" part of this path.@NotNull PrismContextgetPrismContext()ObjectTypegetProtoRole()In the context of meta-roles this is the role that the currently-processed inducement "applies to".AssignmentPathSegmentgetSegment(int index)Returns segment specified by index.@NotNull List<AssignmentPathSegmentImpl>getSegments()booleanhasOnlyOrgs()booleanisEmpty()AssignmentPathSegmentImpllast()booleanmatches(@NotNull List<OrderConstraintsType> orderConstraints)Returns true if the path matches specified order constraints.voidshortDump(StringBuilder sb)Show the content of the object intended for diagnostics.intsize()AssignmentPathTypetoAssignmentPathType(boolean includeAssignmentsContent)StringtoString()-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.model.api.context.AssignmentPath
getAt
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
-
-
-
Method Detail
-
getSegments
@NotNull public @NotNull List<AssignmentPathSegmentImpl> getSegments()
- Specified by:
getSegmentsin interfaceAssignmentPath
-
getSegment
public AssignmentPathSegment getSegment(int index)
Description copied from interface:AssignmentPathReturns segment specified by index. Negative indexes work in reverse direction.- Specified by:
getSegmentin interfaceAssignmentPath
-
add
public void add(AssignmentPathSegmentImpl segment)
-
first
public AssignmentPathSegmentImpl first()
- Specified by:
firstin interfaceAssignmentPath
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceAssignmentPath
-
size
public int size()
- Specified by:
sizein interfaceAssignmentPath
-
last
public AssignmentPathSegmentImpl last()
- Specified by:
lastin interfaceAssignmentPath
-
beforeLast
public AssignmentPathSegmentImpl beforeLast(int n)
- Specified by:
beforeLastin interfaceAssignmentPath
-
countTargetOccurrences
public int countTargetOccurrences(ObjectType target)
- Specified by:
countTargetOccurrencesin interfaceAssignmentPath
-
getFirstOrderChain
@NotNull public @NotNull List<ObjectType> getFirstOrderChain()
Description copied from interface:AssignmentPathReturns a "user understandable" part of this path. I.e. only those objects that are of "order 1" above the focal object. E.g. from chain of jack =(a)=> Engineer =(i)=> Employee =(a)=> PersonMetarole =(i2)=> Person =(i)=> Entity the result would be Engineer -> Employee -> Person -> Entity TODO find a better name- Specified by:
getFirstOrderChainin interfaceAssignmentPath
-
getProtoRole
public ObjectType getProtoRole()
Description copied from interface:AssignmentPathIn the context of meta-roles this is the role that the currently-processed inducement "applies to". I.e. the role that would contain this inducement in case that meta-roles were not used. Technically, this is the last element in the "first order chain" or roles. Note: proto- is the opposite of meta-- Specified by:
getProtoRolein interfaceAssignmentPath
-
hasOnlyOrgs
public boolean hasOnlyOrgs()
-
clone
public AssignmentPathImpl clone()
Description copied from interface:AssignmentPathShallow clone.- Specified by:
clonein interfaceAssignmentPath- Overrides:
clonein classObject
-
cloneFirst
public AssignmentPathImpl cloneFirst(int n)
- Specified by:
cloneFirstin interfaceAssignmentPath
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable
-
shortDump
public void shortDump(StringBuilder sb)
Description copied from interface:ShortDumpableShow the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDumpin interfaceShortDumpable- Parameters:
sb- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
toAssignmentPathType
public AssignmentPathType toAssignmentPathType(boolean includeAssignmentsContent)
- Specified by:
toAssignmentPathTypein interfaceAssignmentPath
-
getPrismContext
@NotNull public @NotNull PrismContext getPrismContext()
-
collectExtensions
public ExtensionType collectExtensions(int startAt) throws SchemaException
- Specified by:
collectExtensionsin interfaceAssignmentPath- Throws:
SchemaException
-
matches
public boolean matches(@NotNull @NotNull List<OrderConstraintsType> orderConstraints)Description copied from interface:AssignmentPathReturns true if the path matches specified order constraints. All of them must match. Although there are some defaults, it is recommended to specify constraints explicitly. Currently not supported on empty paths. Not all parts of OrderConstraintsType are supported. Namely, resetOrder item has no meaning here.- Specified by:
matchesin interfaceAssignmentPath
-
equivalent
public boolean equivalent(AssignmentPath other)
Description copied from interface:AssignmentPathPreliminary (limited) implementation. To be used to compare paths pointing to the same target object. Use with care.- Specified by:
equivalentin interfaceAssignmentPath
-
getConstructionThisObject
public ObjectType getConstructionThisObject()
Used as a source for thisObject variable. This variable is officially deprecated, but it is used as a legacy role pointer inAssociationFromLinkExpressionEvaluator. This is the specification from common-3 documentation: "The legacy algorithm is guaranteed to work up to meta-role level. For plain roles (order-one inducement) the role itself is selected. For meta-roles (order-two inducement) the first (plain) role is selected. At the meta-meta role level (order-three inducement) and above the behavior is formally undefined and it may change in any future versions. However, current behaviour roughly corresponds to assignment path index -2." Should be removed or adapted on appropriate occasion.
-
-