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:
  • Constructor Details

    • AssignmentPathImpl

      public AssignmentPathImpl()
  • Method Details

    • getSegments

      @NotNull public @NotNull List<AssignmentPathSegmentImpl> getSegments()
      Specified by:
      getSegments in interface AssignmentPath
    • 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 interface AssignmentPath
    • add

      public void add(AssignmentPathSegmentImpl segment)
    • first

      public AssignmentPathSegmentImpl first()
      Specified by:
      first in interface AssignmentPath
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface AssignmentPath
    • size

      public int size()
      Specified by:
      size in interface AssignmentPath
    • last

      Specified by:
      last in interface AssignmentPath
    • beforeLast

      public AssignmentPathSegmentImpl beforeLast(int n)
      Specified by:
      beforeLast in interface AssignmentPath
    • countTargetOccurrences

      public int countTargetOccurrences(ObjectType target)
      Specified by:
      countTargetOccurrences in interface AssignmentPath
    • 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 interface AssignmentPath
    • 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 interface AssignmentPath
    • clone

      public AssignmentPathImpl clone()
      Description copied from interface: AssignmentPath
      Shallow clone.
      Specified by:
      clone in interface AssignmentPath
      Overrides:
      clone in class Object
    • cloneFirst

      public AssignmentPathImpl cloneFirst(int n)
      Specified by:
      cloneFirst in interface AssignmentPath
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • debugDump

      public String debugDump(int indent)
      Specified by:
      debugDump in interface DebugDumpable
    • 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 interface ShortDumpable
      Parameters:
      sb - StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
    • toAssignmentPathBean

      public AssignmentPathType toAssignmentPathBean(boolean includeAssignmentsContent)
      Specified by:
      toAssignmentPathBean in interface AssignmentPath
    • getPrismContext

      @NotNull public @NotNull PrismContext getPrismContext()
    • collectExtensions

      public ExtensionType collectExtensions(int startAt) throws SchemaException
      Specified by:
      collectExtensions in interface AssignmentPath
      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 interface AssignmentPath
    • 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 interface AssignmentPath
    • getOtherPrivilegesLimitation

      @NotNull public OtherPrivilegesLimitations.Limitation getOtherPrivilegesLimitation()
      Description copied from interface: AssignmentPath
      Returns the limitation for "other" privileges that are delegated through this path.
      Specified by:
      getOtherPrivilegesLimitation in interface AssignmentPath
    • 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 in AssociationFromLinkExpressionEvaluator. 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.
    • computePathVariables

      @Nullable public @Nullable AssignmentPathVariables computePathVariables() throws SchemaException
      Throws:
      SchemaException