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
FieldsModifier and TypeFieldDescriptionstatic final StringTo store parsed version along withSimulationResultProcessedObjectTypebean.Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRINGFields inherited from interface com.evolveum.midpoint.model.api.simulation.ProcessedObject
DELTA_TO_PROCESSING_STATE -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDefinitions(@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) CreatesProcessedObjectImplfor theLensElementContext.debugDump(int indent) voidResolves "estimated old values" for item deltas where they are not known.getAfter()Returns the (expected) state of the object after the operation.intReturns the number of VALUES of associations added or deleted.intReturns 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".intgetItemModificationsCount(@NotNull ItemPath itemPath) Counts modifications based on the specified path, excluding changes in ADD/DELETE deltas.intgetItemModificationsCount(@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.Metricvalues for this object.@Nullable PolyStringTypegetName()Name of the object being processed.intReturns the number of modifications of non-operational items.getOid()OID of the object whole processing is described by this record.@Nullable StringFor processed objects that are shadows: returns the related resource OID.@Nullable OperationResultThe result of the operation connected to this object.@Nullable OperationResultStatusThe status of the operation connected to this object.@NotNull ObjectProcessingStateTypegetState()State of the object.getType()Type of the object being processed.@NotNull QNamebooleanhasEventMark(@NotNull String eventMarkOid) booleanbooleanisFocus()booleanmatches(@NotNull SimulationObjectPredicateType predicate, @NotNull Task task, @NotNull OperationResult result) static <O extends ObjectType>
@NotNull ProcessedObjectImpl<O>parse(@NotNull SimulationResultProcessedObjectType bean) CreatesProcessedObjectImplfrom pre-existingSimulationResultProcessedObjectTypebean.voidresolveEventMarks(OperationResult result) For diagnostic purposes.@NotNull SimulationResultProcessedObjectTypetoBean()Creates aSimulationResultProcessedObjectTypebean corresponding to this object.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods 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 withSimulationResultProcessedObjectTypebean.
-
-
Method Details
-
parse
@NotNull public static <O extends ObjectType> @NotNull ProcessedObjectImpl<O> parse(@NotNull @NotNull SimulationResultProcessedObjectType bean) throws SchemaException CreatesProcessedObjectImplfrom pre-existingSimulationResultProcessedObjectTypebean. 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 CreatesProcessedObjectImplfor 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:ProcessedObjectOID of the object whole processing is described by this record. Usually not null but we shouldn't rely on it.- Specified by:
getOidin interfaceProcessedObject<O extends ObjectType>- See Also:
-
getType
Description copied from interface:ProcessedObjectType of the object being processed.- Specified by:
getTypein interfaceProcessedObject<O extends ObjectType>- See Also:
-
getTypeName
-
getResourceOid
Description copied from interface:ProcessedObjectFor processed objects that are shadows: returns the related resource OID.- Specified by:
getResourceOidin interfaceProcessedObject<O extends ObjectType>
-
getKind
-
getIntent
-
getName
Description copied from interface:ProcessedObjectName of the object being processed. May not be known; typically for shadows to-be-created.- Specified by:
getNamein interfaceProcessedObject<O extends ObjectType>- See Also:
-
getState
Description copied from interface:ProcessedObjectState of the object.- Specified by:
getStatein interfaceProcessedObject<O extends ObjectType>- See Also:
-
getMatchingEventMarksOids
Description copied from interface:ProcessedObjectReturns OIDs of matching event marks for this object.- Specified by:
getMatchingEventMarksOidsin interfaceProcessedObject<O extends ObjectType>
-
getEffectiveObjectMarksRefs
Description copied from interface:ProcessedObjectReturns references of object marks. Primarily on "object before" state (if exists). To be reconsidered.- Specified by:
getEffectiveObjectMarksRefsin interfaceProcessedObject<O extends ObjectType>
-
isFocus
public boolean isFocus()- Specified by:
isFocusin interfaceProcessedObject<O extends ObjectType>
-
getResultStatus
Description copied from interface:ProcessedObjectThe status of the operation connected to this object. Only "primary" objects have this information.- Specified by:
getResultStatusin interfaceProcessedObject<O extends ObjectType>- See Also:
-
getResult
Description copied from interface:ProcessedObjectThe result of the operation connected to this object. Only "primary" objects have this information.- Specified by:
getResultin interfaceProcessedObject<O extends ObjectType>- See Also:
-
getBefore
Description copied from interface:ProcessedObjectReturns the state of the object before the operation.- Specified by:
getBeforein interfaceProcessedObject<O extends ObjectType>- See Also:
-
getAfter
Description copied from interface:ProcessedObjectReturns the (expected) state of the object after the operation.- Specified by:
getAfterin interfaceProcessedObject<O extends ObjectType>- See Also:
-
getDelta
Description copied from interface:ProcessedObjectReturns the operation that is to be executed.- Specified by:
getDeltain interfaceProcessedObject<O extends ObjectType>- See Also:
-
toBean
Description copied from interface:ProcessedObjectCreates aSimulationResultProcessedObjectTypebean corresponding to this object.- Specified by:
toBeanin interfaceProcessedObject<O extends ObjectType>
-
debugDump
- Specified by:
debugDumpin 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.
IfallowSubPathsis 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
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. Assuming that there are no ADD/DELETE modifications of the whole associations container.- Throws:
SchemaException
-
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:ProcessedObjectFor diagnostic purposes.- Specified by:
resolveEventMarksin interfaceProcessedObject<O extends ObjectType>
-
hasEventMark
- Specified by:
hasEventMarkin interfaceProcessedObject<O extends ObjectType>
-
hasNoEventMarks
public boolean hasNoEventMarks()- Specified by:
hasNoEventMarksin 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:ProcessedObjectReturns 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 andItemDeltaFilterfor details. Experimental.- Specified by:
getItemDeltasin 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:ProcessedObjectReturns the collection ofProcessedObject.Metricvalues for this object.- Specified by:
getMetricsin 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:ProcessedObjectApplies the definitions (currently, resource schema related to specific shadow) to the object(s) before/after, and the delta.- Specified by:
applyDefinitionsin interfaceProcessedObject<O extends ObjectType>- Throws:
SchemaExceptionExpressionEvaluationExceptionCommunicationExceptionConfigurationExceptionObjectNotFoundException
-
fixEstimatedOldValuesInDelta
public void fixEstimatedOldValuesInDelta()Description copied from interface:ProcessedObjectResolves "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:
fixEstimatedOldValuesInDeltain interfaceProcessedObject<O extends ObjectType>
-