Class ElementState<O extends ObjectType>
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.lens.ElementState<O>
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class ElementState<O extends ObjectType> extends Object implements Serializable, Cloneable
Encapsulates the maintenance of the state of an element (focus, projection). Holds mainly: - basic information like type, definition, and OID - state: old, current, new - deltas: primary, secondary, current (i.e. current -> new), summary (i.e. old -> new) - archived secondary deltas - flags related to the validity of computed components (see below), to avoid needless recomputation - various other state flags (see in the description) Implementation notes: 1. Computed components (current, summary delta, adjusted current object, new object) are evaluated lazily. Their validity is indicated by appropriate flags, driving their (re)computation. 2. Because of their complexity and interdependence, state-changing operations are grouped in a separate region: State updates.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adopt(PrismContext prismContext)
ElementState<O>
clone()
ObjectDeltaObject<O>
getAbsoluteObjectDeltaObject()
@NotNull ObjectDeltaWaves<O>
getArchivedSecondaryDeltas()
ObjectDelta<O>
getCurrentDelta()
PrismObject<O>
getNewObject()
String
getOid()
ObjectDeltaObject<O>
getRelativeObjectDeltaObject()
ObjectDelta<O>
getSummaryDelta()
void
normalize()
@NotNull RememberedElementState<O>
rememberState()
Creates a representation of a state to be (maybe) restored later.void
restoreState(@NotNull RememberedElementState<O> rememberedState)
void
setCurrentObjectAndOid(@NotNull PrismObject<O> object)
Sets the current object and updates the OID as well.void
setInitialObject(@NotNull PrismObject<O> object, boolean isAdd)
Sets both current and (if the operation is not `ADD`) also the old object.void
swallowToSecondaryDelta(LensElementContext<?> context, ItemDelta<?,?> itemDelta)
-
-
-
Method Detail
-
getOid
public String getOid()
-
getNewObject
public PrismObject<O> getNewObject()
-
getCurrentDelta
public ObjectDelta<O> getCurrentDelta()
-
getSummaryDelta
public ObjectDelta<O> getSummaryDelta()
-
getArchivedSecondaryDeltas
@NotNull public @NotNull ObjectDeltaWaves<O> getArchivedSecondaryDeltas()
-
getRelativeObjectDeltaObject
public ObjectDeltaObject<O> getRelativeObjectDeltaObject() throws SchemaException
- Throws:
SchemaException
-
getAbsoluteObjectDeltaObject
public ObjectDeltaObject<O> getAbsoluteObjectDeltaObject() throws SchemaException
- Throws:
SchemaException
-
swallowToSecondaryDelta
public void swallowToSecondaryDelta(LensElementContext<?> context, ItemDelta<?,?> itemDelta) throws SchemaException
- Throws:
SchemaException
-
setCurrentObjectAndOid
public void setCurrentObjectAndOid(@NotNull @NotNull PrismObject<O> object)
Sets the current object and updates the OID as well. Used when OID may change (on projections). Should be used only by the context loader.
-
setInitialObject
public void setInitialObject(@NotNull @NotNull PrismObject<O> object, boolean isAdd)
Sets both current and (if the operation is not `ADD`) also the old object.
-
rememberState
@NotNull public @NotNull RememberedElementState<O> rememberState()
Creates a representation of a state to be (maybe) restored later. Currently comprises only the secondary deltas. Later we may add also current and summary deltas and new object.
-
restoreState
public void restoreState(@NotNull @NotNull RememberedElementState<O> rememberedState)
-
normalize
public void normalize()
-
clone
public ElementState<O> clone()
-
adopt
public void adopt(PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
-