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 void
add(AssignmentPathSegmentImpl segment)
AssignmentPathSegmentImpl
beforeLast(int n)
AssignmentPathImpl
clone()
Shallow clone.AssignmentPathImpl
cloneFirst(int n)
ExtensionType
collectExtensions(int startAt)
int
countTargetOccurrences(ObjectType target)
String
debugDump(int indent)
boolean
equivalent(AssignmentPath other)
Preliminary (limited) implementation.AssignmentPathSegmentImpl
first()
ObjectType
getConstructionThisObject()
Used as a source for thisObject variable.@NotNull List<ObjectType>
getFirstOrderChain()
Returns a "user understandable" part of this path.@NotNull PrismContext
getPrismContext()
ObjectType
getProtoRole()
In the context of meta-roles this is the role that the currently-processed inducement "applies to".AssignmentPathSegment
getSegment(int index)
Returns segment specified by index.@NotNull List<AssignmentPathSegmentImpl>
getSegments()
boolean
hasOnlyOrgs()
boolean
isEmpty()
AssignmentPathSegmentImpl
last()
boolean
matches(@NotNull List<OrderConstraintsType> orderConstraints)
Returns true if the path matches specified order constraints.void
shortDump(StringBuilder sb)
Show the content of the object intended for diagnostics.int
size()
AssignmentPathType
toAssignmentPathType(boolean includeAssignmentsContent)
String
toString()
-
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:
getSegments
in interfaceAssignmentPath
-
getSegment
public AssignmentPathSegment getSegment(int index)
Description copied from interface:AssignmentPath
Returns segment specified by index. Negative indexes work in reverse direction.- Specified by:
getSegment
in interfaceAssignmentPath
-
add
public void add(AssignmentPathSegmentImpl segment)
-
first
public AssignmentPathSegmentImpl first()
- Specified by:
first
in interfaceAssignmentPath
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceAssignmentPath
-
size
public int size()
- Specified by:
size
in interfaceAssignmentPath
-
last
public AssignmentPathSegmentImpl last()
- Specified by:
last
in interfaceAssignmentPath
-
beforeLast
public AssignmentPathSegmentImpl beforeLast(int n)
- Specified by:
beforeLast
in interfaceAssignmentPath
-
countTargetOccurrences
public int countTargetOccurrences(ObjectType target)
- Specified by:
countTargetOccurrences
in interfaceAssignmentPath
-
getFirstOrderChain
@NotNull public @NotNull List<ObjectType> getFirstOrderChain()
Description copied from interface:AssignmentPath
Returns 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:
getFirstOrderChain
in interfaceAssignmentPath
-
getProtoRole
public ObjectType getProtoRole()
Description copied from interface:AssignmentPath
In 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:
getProtoRole
in interfaceAssignmentPath
-
hasOnlyOrgs
public boolean hasOnlyOrgs()
-
clone
public AssignmentPathImpl clone()
Description copied from interface:AssignmentPath
Shallow clone.- Specified by:
clone
in interfaceAssignmentPath
- Overrides:
clone
in classObject
-
cloneFirst
public AssignmentPathImpl cloneFirst(int n)
- Specified by:
cloneFirst
in interfaceAssignmentPath
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
shortDump
public void shortDump(StringBuilder sb)
Description copied from interface:ShortDumpable
Show 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:
shortDump
in 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:
toAssignmentPathType
in interfaceAssignmentPath
-
getPrismContext
@NotNull public @NotNull PrismContext getPrismContext()
-
collectExtensions
public ExtensionType collectExtensions(int startAt) throws SchemaException
- Specified by:
collectExtensions
in interfaceAssignmentPath
- Throws:
SchemaException
-
matches
public boolean matches(@NotNull @NotNull List<OrderConstraintsType> orderConstraints)
Description copied from interface:AssignmentPath
Returns 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:
matches
in interfaceAssignmentPath
-
equivalent
public boolean equivalent(AssignmentPath other)
Description copied from interface:AssignmentPath
Preliminary (limited) implementation. To be used to compare paths pointing to the same target object. Use with care.- Specified by:
equivalent
in 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.
-
-