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 StringKEY_PARSEDTo store parsed version along withSimulationResultProcessedObjectTypebean.-
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 voidapplyDefinitions(@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.StringdebugDump(int indent)voidfixEstimatedOldValuesInDelta()Resolves "estimated old values" for item deltas where they are not known.OgetAfter()Returns the (expected) state of the object after the operation.intgetAssociationValuesChanged()Returns the number of VALUES of associations added or deleted.intgetAttributeModificationsCount()Returns the number of attribute modifications.OgetBefore()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.StringgetIntent()@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".ShadowKindTypegetKind()@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.Metricvalues for this object.@Nullable PolyStringTypegetName()Name of the object being processed.intgetNonOperationalItemModificationsCount()Returns the number of modifications of non-operational items.StringgetOid()OID of the object whole processing is described by this record.@Nullable StringgetResourceOid()For processed objects that are shadows: returns the related resource OID.@Nullable OperationResultgetResult()The result of the operation connected to this object.@Nullable OperationResultStatusgetResultStatus()The status of the operation connected to this object.@NotNull ObjectProcessingStateTypegetState()State of the object.@NotNull Class<O>getType()Type of the object being processed.@NotNull QNamegetTypeName()booleanhasEventMark(@NotNull String eventMarkOid)booleanhasNoEventMarks()booleanisFocus()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.StringtoString()-
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 withSimulationResultProcessedObjectTypebean.
-
-
Method Detail
-
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
public String 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:
SimulationResultProcessedObjectType.getOid()
-
getType
@NotNull public @NotNull Class<O> getType()
Description copied from interface:ProcessedObjectType of the object being processed.- Specified by:
getTypein interfaceProcessedObject<O extends ObjectType>- See Also:
SimulationResultProcessedObjectType.getType()
-
getTypeName
@NotNull public @NotNull QName getTypeName()
-
getResourceOid
@Nullable public @Nullable String getResourceOid()
Description copied from interface:ProcessedObjectFor processed objects that are shadows: returns the related resource OID.- Specified by:
getResourceOidin interfaceProcessedObject<O extends ObjectType>
-
getKind
public ShadowKindType getKind()
-
getIntent
public String getIntent()
-
getName
@Nullable public @Nullable PolyStringType 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:
SimulationResultProcessedObjectType.getName()
-
getState
@NotNull public @NotNull ObjectProcessingStateType getState()
Description copied from interface:ProcessedObjectState of the object.- Specified by:
getStatein interfaceProcessedObject<O extends ObjectType>- See Also:
ProcessedObject.DELTA_TO_PROCESSING_STATE,SimulationResultProcessedObjectType.getState()
-
getMatchingEventMarksOids
@NotNull public @NotNull Collection<String> getMatchingEventMarksOids()
Description copied from interface:ProcessedObjectReturns OIDs of matching event marks for this object.- Specified by:
getMatchingEventMarksOidsin interfaceProcessedObject<O extends ObjectType>
-
getEffectiveObjectMarksRefs
@NotNull public @NotNull Collection<ObjectReferenceType> 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
@Nullable public @Nullable OperationResultStatus 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:
SimulationResultProcessedObjectType.getResultStatus()
-
getResult
@Nullable public @Nullable OperationResult 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:
SimulationResultProcessedObjectType.getResult()
-
getBefore
@Nullable public O getBefore()
Description copied from interface:ProcessedObjectReturns the state of the object before the operation.- Specified by:
getBeforein interfaceProcessedObject<O extends ObjectType>- See Also:
SimulationResultProcessedObjectType.getBefore()
-
getAfter
@Nullable public O getAfter()
Description copied from interface:ProcessedObjectReturns the (expected) state of the object after the operation.- Specified by:
getAfterin interfaceProcessedObject<O extends ObjectType>- See Also:
SimulationResultProcessedObjectType.getAfter()
-
getDelta
@Nullable public @Nullable ObjectDelta<O> getDelta()
Description copied from interface:ProcessedObjectReturns the operation that is to be executed.- Specified by:
getDeltain interfaceProcessedObject<O extends ObjectType>- See Also:
SimulationResultProcessedObjectType.getDelta()
-
toBean
@NotNull public @NotNull SimulationResultProcessedObjectType toBean()
Description copied from interface:ProcessedObjectCreates aSimulationResultProcessedObjectTypebean corresponding to this object.- Specified by:
toBeanin interfaceProcessedObject<O extends ObjectType>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDumpin 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:ProcessedObjectFor diagnostic purposes.- Specified by:
resolveEventMarksin interfaceProcessedObject<O extends ObjectType>
-
hasEventMark
public boolean hasEventMark(@NotNull @NotNull String eventMarkOid)- 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, ObjectNotFoundExceptionDescription 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>
-
-