Class ProcessedObjectImpl<O extends ObjectType>
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.simulation.ProcessedObjectImpl<O>
-
- All Implemented Interfaces:
ProcessedObject<O>
,DebugDumpable
,Serializable
public class ProcessedObjectImpl<O extends ObjectType> extends Object implements ProcessedObject<O>
Default (and the only) implementation ofProcessedObject
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.model.api.simulation.ProcessedObject
ProcessedObject.Metric, ProcessedObject.ProcessedObjectItemDelta<V extends PrismValue,D extends ItemDefinition<?>>, ProcessedObject.ValueWithState
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_PARSED
To store parsed version along withSimulationResultProcessedObjectType
bean.-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Fields inherited from interface com.evolveum.midpoint.model.api.simulation.ProcessedObject
DELTA_TO_PROCESSING_STATE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyDefinitions(@NotNull Task task, @NotNull OperationResult result)
Applies the definitions (currently, resource schema related to specific shadow) to the object(s) before/after, and the delta.static <O extends ObjectType>
@Nullable ProcessedObjectImpl<O>create(@NotNull LensElementContext<O> elementContext, @NotNull SimulationTransactionImpl simulationTransaction, @NotNull Task task, @NotNull OperationResult result)
CreatesProcessedObjectImpl
for theLensElementContext
.String
debugDump(int indent)
void
fixEstimatedOldValuesInDelta()
Resolves "estimated old values" for item deltas where they are not known.O
getAfter()
Returns the (expected) state of the object after the operation.int
getAssociationValuesChanged()
Returns the number of VALUES of associations added or deleted.int
getAttributeModificationsCount()
Returns the number of attribute modifications.O
getBefore()
Returns the state of the object before the operation.@Nullable ObjectDelta<O>
getDelta()
Returns the operation that is to be executed.@NotNull Collection<ObjectReferenceType>
getEffectiveObjectMarksRefs()
Returns references of object marks.String
getIntent()
@NotNull Collection<ProcessedObject.ProcessedObjectItemDelta<?,?>>
getItemDeltas(@Nullable Object pathsToInclude, @Nullable Object pathsToExclude, @Nullable Boolean includeOperationalItems)
Returns the collection of (augmented) item deltas related to this "processed object".ShadowKindType
getKind()
@NotNull Collection<String>
getMatchingEventMarksOids()
Returns OIDs of matching event marks for this object.@NotNull Collection<ProcessedObject.Metric>
getMetrics(@Nullable Boolean showEventMarks, @Nullable Boolean showExplicitMetrics)
Returns the collection ofProcessedObject.Metric
values for this object.@Nullable PolyStringType
getName()
Name of the object being processed.int
getNonOperationalItemModificationsCount()
Returns the number of modifications of non-operational items.String
getOid()
OID of the object whole processing is described by this record.@Nullable String
getResourceOid()
For processed objects that are shadows: returns the related resource OID.@Nullable OperationResult
getResult()
The result of the operation connected to this object.@Nullable OperationResultStatus
getResultStatus()
The status of the operation connected to this object.@NotNull ObjectProcessingStateType
getState()
State of the object.@NotNull Class<O>
getType()
Type of the object being processed.@NotNull QName
getTypeName()
boolean
hasEventMark(@NotNull String eventMarkOid)
boolean
hasNoEventMarks()
boolean
isFocus()
boolean
matches(@NotNull SimulationObjectPredicateType predicate, @NotNull Task task, @NotNull OperationResult result)
static <O extends ObjectType>
@NotNull ProcessedObjectImpl<O>parse(@NotNull SimulationResultProcessedObjectType bean)
CreatesProcessedObjectImpl
from pre-existingSimulationResultProcessedObjectType
bean.void
resolveEventMarks(OperationResult result)
For diagnostic purposes.@NotNull SimulationResultProcessedObjectType
toBean()
Creates aSimulationResultProcessedObjectType
bean corresponding to this object.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.model.api.simulation.ProcessedObject
getAfterOrBefore, getBeforeOrAfterRequired, isAddition, isDeletion, isModification, isNoChange, isOfFocusType, isShadow
-
-
-
-
Field Detail
-
KEY_PARSED
public static final String KEY_PARSED
To store parsed version along withSimulationResultProcessedObjectType
bean.
-
-
Method Detail
-
parse
@NotNull public static <O extends ObjectType> @NotNull ProcessedObjectImpl<O> parse(@NotNull @NotNull SimulationResultProcessedObjectType bean) throws SchemaException
CreatesProcessedObjectImpl
from pre-existingSimulationResultProcessedObjectType
bean. For example, during testing or report creation.- Throws:
SchemaException
- See Also:
ProcessedObjectImpl.InternalState.PARSED
-
create
@Nullable public static <O extends ObjectType> @Nullable ProcessedObjectImpl<O> create(@NotNull @NotNull LensElementContext<O> elementContext, @NotNull @NotNull SimulationTransactionImpl simulationTransaction, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) throws CommonException
CreatesProcessedObjectImpl
for theLensElementContext
. This is the classic (audit-like) simulation. Limitations: - We ignore the fact that sometimes we don't have full shadow loaded. (Although we do our best to load such full shadows during clockwork processing.) The deltas applied to "shadow-only" state may be misleading.- Throws:
CommonException
-
getOid
public String getOid()
Description copied from interface:ProcessedObject
OID of the object whole processing is described by this record. Usually not null but we shouldn't rely on it.- Specified by:
getOid
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getOid()
-
getType
@NotNull public @NotNull Class<O> getType()
Description copied from interface:ProcessedObject
Type of the object being processed.- Specified by:
getType
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getType()
-
getTypeName
@NotNull public @NotNull QName getTypeName()
-
getResourceOid
@Nullable public @Nullable String getResourceOid()
Description copied from interface:ProcessedObject
For processed objects that are shadows: returns the related resource OID.- Specified by:
getResourceOid
in interfaceProcessedObject<O extends ObjectType>
-
getKind
public ShadowKindType getKind()
-
getIntent
public String getIntent()
-
getName
@Nullable public @Nullable PolyStringType getName()
Description copied from interface:ProcessedObject
Name of the object being processed. May not be known; typically for shadows to-be-created.- Specified by:
getName
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getName()
-
getState
@NotNull public @NotNull ObjectProcessingStateType getState()
Description copied from interface:ProcessedObject
State of the object.- Specified by:
getState
in interfaceProcessedObject<O extends ObjectType>
- See Also:
ProcessedObject.DELTA_TO_PROCESSING_STATE
,SimulationResultProcessedObjectType.getState()
-
getMatchingEventMarksOids
@NotNull public @NotNull Collection<String> getMatchingEventMarksOids()
Description copied from interface:ProcessedObject
Returns OIDs of matching event marks for this object.- Specified by:
getMatchingEventMarksOids
in interfaceProcessedObject<O extends ObjectType>
-
getEffectiveObjectMarksRefs
@NotNull public @NotNull Collection<ObjectReferenceType> getEffectiveObjectMarksRefs()
Description copied from interface:ProcessedObject
Returns references of object marks. Primarily on "object before" state (if exists). To be reconsidered.- Specified by:
getEffectiveObjectMarksRefs
in interfaceProcessedObject<O extends ObjectType>
-
isFocus
public boolean isFocus()
- Specified by:
isFocus
in interfaceProcessedObject<O extends ObjectType>
-
getResultStatus
@Nullable public @Nullable OperationResultStatus getResultStatus()
Description copied from interface:ProcessedObject
The status of the operation connected to this object. Only "primary" objects have this information.- Specified by:
getResultStatus
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getResultStatus()
-
getResult
@Nullable public @Nullable OperationResult getResult()
Description copied from interface:ProcessedObject
The result of the operation connected to this object. Only "primary" objects have this information.- Specified by:
getResult
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getResult()
-
getBefore
@Nullable public O getBefore()
Description copied from interface:ProcessedObject
Returns the state of the object before the operation.- Specified by:
getBefore
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getBefore()
-
getAfter
@Nullable public O getAfter()
Description copied from interface:ProcessedObject
Returns the (expected) state of the object after the operation.- Specified by:
getAfter
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getAfter()
-
getDelta
@Nullable public @Nullable ObjectDelta<O> getDelta()
Description copied from interface:ProcessedObject
Returns the operation that is to be executed.- Specified by:
getDelta
in interfaceProcessedObject<O extends ObjectType>
- See Also:
SimulationResultProcessedObjectType.getDelta()
-
toBean
@NotNull public @NotNull SimulationResultProcessedObjectType toBean()
Description copied from interface:ProcessedObject
Creates aSimulationResultProcessedObjectType
bean corresponding to this object.- Specified by:
toBean
in interfaceProcessedObject<O extends ObjectType>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
getNonOperationalItemModificationsCount
@VisibleForTesting public int getNonOperationalItemModificationsCount()
Returns the number of modifications of non-operational items. Currently the implementation is primitive: we simply count the modifications (item deltas) in the object MODIFY delta. Other kinds of deltas (add, delete) are ignored. We also count a container modification as one item modification, even if there are multiple properties changed in the container.
-
getAttributeModificationsCount
@VisibleForTesting public int getAttributeModificationsCount()
Returns the number of attribute modifications. Not counting changes in ADD/DELETE deltas.
-
getAssociationValuesChanged
@VisibleForTesting public int getAssociationValuesChanged()
Returns the number of VALUES of associations added or deleted. Not counting changes in ADD/DELETE deltas. Assuming that there are no REPLACE modifications of associations.
-
matches
public boolean matches(@NotNull @NotNull SimulationObjectPredicateType predicate, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) throws CommonException
- Throws:
CommonException
-
resolveEventMarks
@VisibleForTesting public void resolveEventMarks(OperationResult result)
Description copied from interface:ProcessedObject
For diagnostic purposes.- Specified by:
resolveEventMarks
in interfaceProcessedObject<O extends ObjectType>
-
hasEventMark
public boolean hasEventMark(@NotNull @NotNull String eventMarkOid)
- Specified by:
hasEventMark
in interfaceProcessedObject<O extends ObjectType>
-
hasNoEventMarks
public boolean hasNoEventMarks()
- Specified by:
hasNoEventMarks
in interfaceProcessedObject<O extends ObjectType>
-
getItemDeltas
@NotNull public @NotNull Collection<ProcessedObject.ProcessedObjectItemDelta<?,?>> getItemDeltas(@Nullable @Nullable Object pathsToInclude, @Nullable @Nullable Object pathsToExclude, @Nullable @Nullable Boolean includeOperationalItems)
Description copied from interface:ProcessedObject
Returns the collection of (augmented) item deltas related to this "processed object". Limited! We are not able to see inside deltas. So, for example, when looking for `activation/administrativeStatus` property, and the whole `activation` container is added, the delta is not shown. See the implementation andItemDeltaFilter
for details. Experimental.- Specified by:
getItemDeltas
in interfaceProcessedObject<O extends ObjectType>
- Parameters:
pathsToInclude
- paths of items that we want to see in the list of deltaspathsToExclude
- paths of items that we do not want to see in the list of deltasincludeOperationalItems
- should the operational items be included in the list of deltas?
-
getMetrics
@NotNull public @NotNull Collection<ProcessedObject.Metric> getMetrics(@Nullable @Nullable Boolean showEventMarks, @Nullable @Nullable Boolean showExplicitMetrics)
Description copied from interface:ProcessedObject
Returns the collection ofProcessedObject.Metric
values for this object.- Specified by:
getMetrics
in interfaceProcessedObject<O extends ObjectType>
- Parameters:
showEventMarks
- Should we include mark-based metrics?showExplicitMetrics
- Should we include explicitly defined metrics?
-
applyDefinitions
public void applyDefinitions(@NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) throws SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, ObjectNotFoundException
Description copied from interface:ProcessedObject
Applies the definitions (currently, resource schema related to specific shadow) to the object(s) before/after, and the delta.- Specified by:
applyDefinitions
in interfaceProcessedObject<O extends ObjectType>
- Throws:
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
ObjectNotFoundException
-
fixEstimatedOldValuesInDelta
public void fixEstimatedOldValuesInDelta()
Description copied from interface:ProcessedObject
Resolves "estimated old values" for item deltas where they are not known. TEMPORARY; see MID-8536. This will be part of standard processing but because of code freeze doing it as separate code.- Specified by:
fixEstimatedOldValuesInDelta
in interfaceProcessedObject<O extends ObjectType>
-
-