Interface ModelElementContext<O extends ObjectType>
-
- All Superinterfaces:
DebugDumpable
,Serializable
- All Known Subinterfaces:
ModelProjectionContext
public interface ModelElementContext<O extends ObjectType> extends Serializable, DebugDumpable
- Author:
- semancik
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addToPrimaryDelta(ObjectDelta<O> value)
Add a delta to the primary delta.ArchetypeType
getArchetype()
List<ArchetypeType>
getArchetypes()
ObjectDelta<?>
getCurrentDelta()
Returns object delta valid for the current clockwork click.List<? extends ObjectDeltaOperation>
getExecutedDeltas()
PrismObject<O>
getObjectAny()
PrismObject<O>
getObjectCurrent()
"Current" state of the object i.e.PrismObject<O>
getObjectNew()
Expected state of the object after application of currentDelta i.e.PrismObject<O>
getObjectOld()
"Old" state of the object i.e.@NotNull Collection<? extends EvaluatedPolicyRule>
getObjectPolicyRules()
Returns all policy rules that apply to this object - even those that were not triggered.Class<O>
getObjectTypeClass()
String
getOid()
ObjectDelta<O>
getPrimaryDelta()
ObjectDelta<O>
getSecondaryDelta()
Returns secondary delta for the current clockwork click.ObjectDelta<O>
getSummaryDelta()
Returns object delta comprising both primary delta and (all) secondary deltas, merged together.ObjectDelta<O>
getSummarySecondaryDelta()
Returns all secondary deltas, merged together.boolean
isAdd()
Returns true if the object (focus or projection) is to be added.boolean
isDelete()
Returns true if the object (focus or projection) is to be deleted.boolean
isOfType(Class<?> aClass)
void
setPrimaryDelta(ObjectDelta<O> primaryDelta)
Sets the primary delta.-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
-
-
-
-
Method Detail
-
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
PrismObject<O> getObjectAny()
- Returns:
- "Any" value of the object in this order: new, current, old; taking the first non-null one. It is used when we are not interested in the details but we want just "any" value, e.g. for reporting purposes.
-
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> getExecutedDeltas()
- Returns:
- List of all executed deltas (in fact,
ObjectDeltaOperation
objects).
-
getArchetype
ArchetypeType getArchetype()
- Returns:
- Determined archetype of the object. Currently not supported for projections. Since 4.4 structural archetype is returned
-
getArchetypes
List<ArchetypeType> getArchetypes()
- Returns:
- All archetypes (structural and auxiliary)
-
-