Class ProcessedObjectImpl<O extends ObjectType>
java.lang.Object
com.evolveum.midpoint.model.impl.simulation.ProcessedObjectImpl<O>
- All Implemented Interfaces:
ProcessedObject<O>
,DebugDumpable
,Serializable
Default (and the only) implementation of
ProcessedObject
.- See Also:
-
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
Modifier and TypeFieldDescriptionstatic final String
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
Modifier and TypeMethodDescriptionvoid
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
.debugDump
(int indent) void
Resolves "estimated old values" for item deltas where they are not known.getAfter()
Returns the (expected) state of the object after the operation.int
Returns the number of VALUES of associations added or deleted.int
Returns the number of attribute modifications.Returns the state of the object before the operation.@Nullable ObjectDelta<O>
getDelta()
Returns the operation that is to be executed.@NotNull Collection<ObjectReferenceType>
Returns references of object marks.@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".int
getItemModificationsCount
(@NotNull ItemPath itemPath) Counts modifications based on the specified path, excluding changes in ADD/DELETE deltas.int
getItemModificationsCount
(@NotNull ItemPath itemPath, boolean allowSubPaths) Counts modifications based on the specified path, excluding changes in ADD/DELETE deltas.getKind()
@NotNull Collection<String>
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
Returns the number of modifications of non-operational items.getOid()
OID of the object whole processing is described by this record.@Nullable String
For processed objects that are shadows: returns the related resource OID.@Nullable OperationResult
The result of the operation connected to this object.@Nullable OperationResultStatus
The status of the operation connected to this object.@NotNull ObjectProcessingStateType
getState()
State of the object.getType()
Type of the object being processed.@NotNull QName
boolean
hasEventMark
(@NotNull String eventMarkOid) boolean
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.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 Details
-
KEY_PARSED
To store parsed version along withSimulationResultProcessedObjectType
bean.
-
-
Method Details
-
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
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:
-
getType
Description copied from interface:ProcessedObject
Type of the object being processed.- Specified by:
getType
in interfaceProcessedObject<O extends ObjectType>
- See Also:
-
getTypeName
-
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
-
getIntent
-
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:
-
getState
Description copied from interface:ProcessedObject
State of the object.- Specified by:
getState
in interfaceProcessedObject<O extends ObjectType>
- See Also:
-
getMatchingEventMarksOids
Description copied from interface:ProcessedObject
Returns OIDs of matching event marks for this object.- Specified by:
getMatchingEventMarksOids
in interfaceProcessedObject<O extends ObjectType>
-
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
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:
-
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:
-
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:
-
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:
-
getDelta
Description copied from interface:ProcessedObject
Returns the operation that is to be executed.- Specified by:
getDelta
in interfaceProcessedObject<O extends ObjectType>
- See Also:
-
toBean
Description copied from interface:ProcessedObject
Creates aSimulationResultProcessedObjectType
bean corresponding to this object.- Specified by:
toBean
in interfaceProcessedObject<O extends ObjectType>
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
toString
-
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. -
getItemModificationsCount
Counts modifications based on the specified path, excluding changes in ADD/DELETE deltas.The item path must exactly match the configuration.
Sub-item modifications are not counted.- Parameters:
itemPath
- the path to count modifications for- Returns:
- the number of attribute modifications.
-
getItemModificationsCount
Counts modifications based on the specified path, excluding changes in ADD/DELETE deltas.The item path must exactly match the configuration.
IfallowSubPaths
is true, sub-item modifications are also counted.- Parameters:
itemPath
- the path to count modifications forallowSubPaths
- if true, sub-item modifications are allowed- Returns:
- the number of attribute modifications
-
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
Description copied from interface:ProcessedObject
For diagnostic purposes.- Specified by:
resolveEventMarks
in interfaceProcessedObject<O extends ObjectType>
-
hasEventMark
- 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>
-