Interface ModelElementContext<O extends ObjectType>

All Superinterfaces:
DebugDumpable, Serializable
All Known Subinterfaces:
ModelProjectionContext
All Known Implementing Classes:
LensElementContext, LensFocusContext, LensProjectionContext

public interface ModelElementContext<O extends ObjectType> extends Serializable, DebugDumpable
Author:
semancik
  • Method Details

    • getObjectTypeClass

      Class<O> getObjectTypeClass()
      Returns:
      Type of object represented by this context. It is declared when context is created, so the actual type of the object can be its subtype. (Although this is quite unusual.)
    • isOfType

      boolean isOfType(Class<?> aClass)
      Returns:
      True if the declared or actual object type is a subtype of aClass.
    • getObjectOld

      PrismObject<O> getObjectOld()
      "Old" state of the object i.e. the one that was present when the clockwork started. It can be present on the beginning or filled-in during projector execution by the context loaded. This value is used as an "old state" for resource object mappings (in constructions or resources), persona mappings, notifications, policy rules, and so on.
    • getObjectCurrent

      PrismObject<O> getObjectCurrent()
      "Current" state of the object i.e. the one that was present when the current clockwork click started. It is typically filled-in by the context loader. For projections, it is usually the same as the "old" state, as they are not updated iteratively but only once per clockwork run. This value used as an "old state" for focus mappings (in object template or assigned ones). INVARIANT: For LensProjectionContext the `shadowLifecycleState` must be present on this object (if the object is not null).
    • getObjectNew

      PrismObject<O> getObjectNew()
      Expected state of the object after application of currentDelta i.e. item deltas computed during current projection: objectCurrent + currentDelta = objectNew.
    • getObjectAny

      default PrismObject<O> getObjectAny()
      Returns "any" value of the object (new, current, old). It is used when we are not interested in the details but we want just "any" value, e.g. for reporting purposes.
    • getObjectAnyRequired

      @NotNull default @NotNull PrismObject<O> getObjectAnyRequired()
    • getObjectNewOrCurrentOrOld

      PrismObject<O> getObjectNewOrCurrentOrOld()
      Returns:
      The first non-null object of these: new, current, old. (Or null of all of them all null.)
    • getObjectOldOrCurrent

      default PrismObject<O> getObjectOldOrCurrent()
    • getOid

      String getOid()
      Returns:
      OID of the object. If not determined yet, it is obtained from available sources, like object old, current, new, or primary delta.
    • getObjectPolicyRules

      @NotNull @NotNull Collection<? extends EvaluatedPolicyRule> getObjectPolicyRules()
      Returns all policy rules that apply to this object - even those that were not triggered. The policy rules are compiled from all the applicable sources (target, meta-roles, etc.)
    • isAdd

      boolean isAdd()
      Returns true if the object (focus or projection) is to be added.
    • isDelete

      boolean isDelete()
      Returns true if the object (focus or projection) is to be deleted.
    • getPrimaryDelta

      ObjectDelta<O> getPrimaryDelta()
      Returns:
      Primary delta i.e. one that the caller specified that has to be executed.
    • setPrimaryDelta

      void setPrimaryDelta(ObjectDelta<O> primaryDelta)
      Sets the primary delta. Must be called before the clockwork starts.
    • addToPrimaryDelta

      void addToPrimaryDelta(ObjectDelta<O> value) throws SchemaException
      Add a delta to the primary delta. Must be called before the clockwork starts.
      Throws:
      SchemaException
    • getSecondaryDelta

      ObjectDelta<O> getSecondaryDelta()
      Returns secondary delta for the current clockwork click. The caller MUST NOT modify returned object in any way.
    • getCurrentDelta

      ObjectDelta<?> getCurrentDelta()
      Returns object delta valid for the current clockwork click. It is either primary delta merged with the current secondary delta (if primary delta was not applied yet), or simply current secondary delta. The returned object is (kind of) immutable. Changing it may do strange things, but most likely the changes will be lost.
    • getSummaryDelta

      ObjectDelta<O> getSummaryDelta()
      Returns object delta comprising both primary delta and (all) secondary deltas, merged together. The returned object is (kind of) immutable. Changing it may do strange things, but most likely the changes will be lost.
    • getSummarySecondaryDelta

      ObjectDelta<O> getSummarySecondaryDelta()
      Returns all secondary deltas, merged together. (Can take some time to compute. So use with care.) The returned object is (kind of) immutable. Changing it may do strange things, but most likely the changes will be lost.
    • getExecutedDeltas

      List<? extends ObjectDeltaOperation<O>> getExecutedDeltas()
      Returns:
      List of all executed deltas (in fact, ObjectDeltaOperation objects).
    • getArchetype

      ArchetypeType getArchetype()
      TODO is this method ever used?
      Returns:
      Determined archetype of the object. Currently not supported for projections. Since 4.4 structural archetype is returned
    • getArchetypes

      List<ArchetypeType> getArchetypes()
      TODO is this method ever used?
      Returns:
      All archetypes (structural and auxiliary)
    • getModelContext

      @NotNull @NotNull ModelContext<?> getModelContext()
    • getMatchingEventMarksOids

      @NotNull @NotNull Collection<String> getMatchingEventMarksOids()
      Returns OIDs of event marks determined for this focus/projection context.