Class LensContext<F extends ObjectType>
java.lang.Object
com.evolveum.midpoint.model.impl.lens.LensContext<F>
- All Implemented Interfaces:
ModelContext<F>
,DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
LensContextPlaceholder
- Author:
- semancik
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
static class
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
ConstructorDescriptionLensContext
(@NotNull TaskExecutionMode taskExecutionMode) LensContext
(Class<F> focusClass, @NotNull TaskExecutionMode taskExecutionMode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConflictingProjectionContext
(@NotNull LensProjectionContext conflictingContext) void
addHookPreviewResults
(String hookUri, Collection<? extends Containerable> results) void
addProjectionContext
(@NotNull LensProjectionContext projectionContext) boolean
void
void
void
void
cleanup()
Cleans up the contexts by removing some of the working state.void
clone()
int
createDetachedProjectionContext
(@NotNull ProjectionContextKey key) createProjectionContext
(@NotNull ProjectionContextKey key) @NotNull ProvisioningOperationContext
debugDump
(int indent) debugDump
(int indent, boolean showTriples) void
Removes results of any previous computations from the context.dump
(boolean showTriples) dumpAssignmentPolicyRules
(int indent, boolean alsoMessages) dumpObjectPolicyRules
(int indent, boolean alsoMessages) findFirstNotCompletedProjectionContext
(@NotNull ConstructionTargetKey targetKey) TODO TODO TODO Do not use this method (yet) Returns the projection context this construction should be applied to.findFirstProjectionContext
(@NotNull ConstructionTargetKey targetKey, boolean acceptReaping) TODOfindLowerOrderContext
(LensProjectionContext refProjCtx) @Nullable LensProjectionContext
findProjectionContext
(@NotNull ProjectionContextFilter filter) findProjectionContextByKeyExact
(@NotNull ProjectionContextKey key) findProjectionContextByOid
(@NotNull String oid) BEWARE! Before you call this method, please consider the fact that there may be more projection contexts matching given shadow OID.findProjectionContextByOidAndKey
(@NotNull String oid, @NotNull ProjectionContextKey key) TODO describe this and verify it's OK@NotNull Collection<LensProjectionContext>
findProjectionContexts
(@NotNull ProjectionContextFilter filter) @NotNull List<LensProjectionContext>
findProjectionContextsByOid
(@NotNull String oid) static <T extends ObjectType>
LensContext<T>fromLensContextBean
(LensContextType bean, Task task, OperationResult parentResult) int
Number of all changes.@NotNull Collection<EvaluatedAssignmentImpl<?>>
@NotNull LensContext.AuthorizationState
@NotNull List<LensProjectionContext>
@NotNull Stream<EvaluatedAssignmentImpl<?>>
@NotNull Collection<ObjectDeltaOperation<? extends ObjectType>>
Returns all executed deltas, user and all accounts.int
@NotNull LensFocusContext<F>
<T> @NotNull List<T>
getHookPreviewResults
(@NotNull Class<T> clazz) @NotNull Map<String,
Collection<? extends Containerable>> @NotNull MappingInspector
@NotNull ModelBeans
@NotNull Collection<EvaluatedAssignmentImpl<?>>
@NotNull List<ObjectReferenceType>
getOrCreateFocusContext
(Class<F> explicitFocusClass) static <F extends ObjectType>
@NotNull LensContext.GetOrCreateProjectionContextResultgetOrCreateProjectionContext
(LensContext<F> context, ProjectionContextKey contextKey) TODO not sure if this method should be here or inProjectionsLoadOperation
(that is currently the only client) The reason for being here is the similarity togetOrCreateProjectionContext(LensContext, ConstructionTargetKey, boolean)
and coupling withgetOrCreateProjectionContext(LensContext, HumanReadableDescribable, Supplier, Supplier)
.static <F extends ObjectType>
@NotNull LensContext.GetOrCreateProjectionContextResultgetOrCreateProjectionContext
(LensContext<F> context, ConstructionTargetKey targetKey, boolean acceptReaping) @NotNull PartialProcessingOptionsType
@Nullable PolicyRuleEnforcerPreviewOutputType
Collection<ObjectDelta<? extends ObjectType>>
Expression profile to use for "privileged" operations, such as scripting hooks.@NotNull Collection<LensProjectionContext>
int
getResource
(String resourceOid) Returns a resource with given OID.@NotNull List<LensObjectDeltaOperation<?>>
getSequenceCounter
(String sequenceOid) getState()
getStats()
@NotNull TaskExecutionMode
getTaskTreeOid
(Task task, OperationResult result) @NotNull ObjectTreeDeltas<F>
@Nullable String
@NotNull Collection<ObjectDeltaOperation<? extends ObjectType>>
Returns all executed deltas, user and all accounts.boolean
boolean
boolean
boolean
hasFocusOfType
(Class<? extends ObjectType> type) boolean
boolean
void
void
void
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isFresh()
boolean
boolean
boolean
boolean
boolean
void
markMatchingProjectionsBroken
(@NotNull ConstructionType construction, @NotNull String resourceOid) Resource OID should correspond to the construction.void
boolean
void
void
rememberResource
(ResourceType resource) Puts resource in the cache for later use.void
void
reportProgress
(ProgressInformation progress) void
void
Makes the context and all sub-context non-fresh.void
setAccountSynchronizationSettings
(ProjectionPolicyType accountSynchronizationSettings) void
setChannel
(String channelUri) void
setChannel
(QName channelQName) void
setDoReconciliationForAllProjections
(boolean doReconciliationForAllProjections) void
setEvaluatedAssignmentTriple
(DeltaSetTriple<EvaluatedAssignmentImpl<?>> evaluatedAssignmentTriple) void
setExplicitFocusTemplateOid
(String explicitFocusTemplateOid) void
setFocusContext
(LensFocusContext<F> focusContext) void
setFresh
(boolean isFresh) void
setGlobalSecurityPolicy
(SecurityPolicyType globalSecurityPolicy) void
setInspector
(ClockworkInspector inspector) void
setItemProcessingIdentifier
(String itemProcessingIdentifier) void
setLazyAuditRequest
(boolean lazyAuditRequest) void
setOptions
(ModelExecuteOptions options) void
setPolicyRuleEnforcerPreviewOutput
(PolicyRuleEnforcerPreviewOutputType policyRuleEnforcerPreviewOutput) void
setProgressListeners
(Collection<ProgressListener> progressListeners) void
setSequenceCounter
(String sequenceOid, long counter) void
void
setState
(ModelState state) void
setStats
(LensContextStatsType stats) void
setSystemConfiguration
(PrismObject<SystemConfigurationType> systemConfiguration) void
setTriggeringResourceOid
(@NotNull ResourceType triggeringResource) toBean()
toBean
(LensContext.ExportType exportType) 'reduced' means - no full object values (focus, shadow).toString()
void
Methods inherited from class java.lang.Object
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.context.ModelContext
dumpAssignmentPolicyRules, dumpObjectPolicyRules, isSimulation
-
Constructor Details
-
LensContext
-
LensContext
-
-
Method Details
-
getOrCreateProjectionContext
@NotNull public static <F extends ObjectType> @NotNull LensContext.GetOrCreateProjectionContextResult getOrCreateProjectionContext(LensContext<F> context, ProjectionContextKey contextKey) TODO not sure if this method should be here or inProjectionsLoadOperation
(that is currently the only client) The reason for being here is the similarity togetOrCreateProjectionContext(LensContext, ConstructionTargetKey, boolean)
and coupling withgetOrCreateProjectionContext(LensContext, HumanReadableDescribable, Supplier, Supplier)
. -
getOrCreateProjectionContext
@NotNull public static <F extends ObjectType> @NotNull LensContext.GetOrCreateProjectionContextResult getOrCreateProjectionContext(LensContext<F> context, ConstructionTargetKey targetKey, boolean acceptReaping) -
findLowerOrderContext
-
getProvisioningService
-
setTriggeringResourceOid
-
getTriggeringResourceOid
-
getRequestIdentifier
- Specified by:
getRequestIdentifier
in interfaceModelContext<F extends ObjectType>
-
getItemProcessingIdentifier
-
setItemProcessingIdentifier
-
getState
- Specified by:
getState
in interfaceModelContext<F extends ObjectType>
-
setState
-
getFocusContext
- Specified by:
getFocusContext
in interfaceModelContext<F extends ObjectType>
-
hasFocusContext
public boolean hasFocusContext() -
getFocusContextRequired
- Specified by:
getFocusContextRequired
in interfaceModelContext<F extends ObjectType>
-
setFocusContext
-
createFocusContext
-
getOrCreateFocusContext
-
getOrCreateFocusContext
-
getProjectionContexts
- Specified by:
getProjectionContexts
in interfaceModelContext<F extends ObjectType>
-
getProjectionContextsIterator
-
addProjectionContext
-
findProjectionContextByOid
BEWARE! Before you call this method, please consider the fact that there may be more projection contexts matching given shadow OID. -
findProjectionContextsByOid
@NotNull public @NotNull List<LensProjectionContext> findProjectionContextsByOid(@NotNull @NotNull String oid) -
findProjectionContextByOidAndKey
public LensProjectionContext findProjectionContextByOidAndKey(@NotNull @NotNull String oid, @NotNull @NotNull ProjectionContextKey key) TODO describe this and verify it's OK -
findProjectionContextByKeyExact
public LensProjectionContext findProjectionContextByKeyExact(@NotNull @NotNull ProjectionContextKey key) - Specified by:
findProjectionContextByKeyExact
in interfaceModelContext<F extends ObjectType>
-
findProjectionContexts
@NotNull public @NotNull Collection<LensProjectionContext> findProjectionContexts(@NotNull @NotNull ProjectionContextFilter filter) - Specified by:
findProjectionContexts
in interfaceModelContext<F extends ObjectType>
-
findProjectionContext
@VisibleForTesting @Nullable public @Nullable LensProjectionContext findProjectionContext(@NotNull @NotNull ProjectionContextFilter filter) -
findFirstNotCompletedProjectionContext
public LensProjectionContext findFirstNotCompletedProjectionContext(@NotNull @NotNull ConstructionTargetKey targetKey) TODO TODO TODO Do not use this method (yet) Returns the projection context this construction should be applied to. There may be more matching ones. We return the one that is the next one to be evaluated (according to the waves/ordering). TODO What is more reliable - ordering or waves? Waves may not be computed, while order should be specified. We hope... -
findFirstProjectionContext
public LensProjectionContext findFirstProjectionContext(@NotNull @NotNull ConstructionTargetKey targetKey, boolean acceptReaping) TODO -
getExplicitFocusTemplateOid
-
setExplicitFocusTemplateOid
-
getFocusTemplate
- Specified by:
getFocusTemplate
in interfaceModelContext<F extends ObjectType>
-
getSystemConfiguration
- Specified by:
getSystemConfiguration
in interfaceModelContext<F extends ObjectType>
-
getSystemConfigurationBean
-
getInternalsConfiguration
-
setSystemConfiguration
-
updateSystemConfiguration
- Throws:
SchemaException
-
getAccountSynchronizationSettings
-
setAccountSynchronizationSettings
-
getProjectionWave
public int getProjectionWave() -
incrementProjectionWave
public void incrementProjectionWave() -
resetProjectionWave
public void resetProjectionWave() -
getExecutionWave
public int getExecutionWave() -
computeMaxWaves
public int computeMaxWaves() -
isFresh
public boolean isFresh() -
setFresh
public void setFresh(boolean isFresh) -
isRequestAuthorized
public boolean isRequestAuthorized() -
getAuthorizationState
-
rot
Makes the context and all sub-context non-fresh. -
getChannel
- Specified by:
getChannel
in interfaceModelContext<F extends ObjectType>
-
setChannel
-
setChannel
-
isDoReconciliationForAllProjections
public boolean isDoReconciliationForAllProjections() -
setDoReconciliationForAllProjections
public void setDoReconciliationForAllProjections(boolean doReconciliationForAllProjections) -
isExecutionPhaseOnly
public boolean isExecutionPhaseOnly() -
getEvaluatedAssignmentTriple
- Specified by:
getEvaluatedAssignmentTriple
in interfaceModelContext<F extends ObjectType>
-
getEvaluatedAssignmentsStream
- Specified by:
getEvaluatedAssignmentsStream
in interfaceModelContext<F extends ObjectType>
-
getNonNegativeEvaluatedAssignments
@NotNull public @NotNull Collection<EvaluatedAssignmentImpl<?>> getNonNegativeEvaluatedAssignments()- Specified by:
getNonNegativeEvaluatedAssignments
in interfaceModelContext<F extends ObjectType>
-
getAllEvaluatedAssignments
- Specified by:
getAllEvaluatedAssignments
in interfaceModelContext<F extends ObjectType>
-
setEvaluatedAssignmentTriple
public void setEvaluatedAssignmentTriple(DeltaSetTriple<EvaluatedAssignmentImpl<?>> evaluatedAssignmentTriple) -
getOptions
- Specified by:
getOptions
in interfaceModelContext<F extends ObjectType>
-
setOptions
-
getPartialProcessingOptions
- Specified by:
getPartialProcessingOptions
in interfaceModelContext<F extends ObjectType>
-
getInspector
-
getMappingInspector
-
setInspector
-
setLazyAuditRequest
public void setLazyAuditRequest(boolean lazyAuditRequest) -
isRequestAudited
public boolean isRequestAudited() -
isExecutionAudited
public boolean isExecutionAudited() -
getStats
-
setStats
-
getRequestBusinessContext
-
getAllChanges
public int getAllChanges()Number of all changes. TODO reconsider this.- Specified by:
getAllChanges
in interfaceModelContext<F extends ObjectType>
-
hasAnyPrimaryChange
public boolean hasAnyPrimaryChange() -
getPrimaryChanges
-
getExecutedDeltas
Returns all executed deltas, user and all accounts. -
getUnauditedExecutedDeltas
@NotNull public @NotNull Collection<ObjectDeltaOperation<? extends ObjectType>> getUnauditedExecutedDeltas()Returns all executed deltas, user and all accounts. -
getRottenExecutedDeltas
-
refreshAuxiliaryObjectClassDefinitions
-
checkAbortRequested
public void checkAbortRequested() -
checkConsistenceIfNeeded
public void checkConsistenceIfNeeded() -
checkConsistence
public void checkConsistence() -
createProjectionContext
-
createDetachedProjectionContext
public LensProjectionContext createDetachedProjectionContext(@NotNull @NotNull ProjectionContextKey key) -
getResource
Returns a resource with given OID. This is supposed to be efficient, taking the resource from the cache. It assumes the resource is in the cache.- See Also:
-
rememberResource
Puts resource in the cache for later use. The resource should be fetched from provisioning and have pre-parsed schemas. So the next time just reuse it without the other overhead. -
cleanup
Cleans up the contexts by removing some of the working state. The current wave number is retained. Otherwise it ends up in endless loop.- Throws:
SchemaException
-
normalize
public void normalize() -
clone
-
getFocusClass
- Specified by:
getFocusClass
in interfaceModelContext<F extends ObjectType>
-
dump
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
debugDump
-
dumpAssignmentPolicyRules
- Specified by:
dumpAssignmentPolicyRules
in interfaceModelContext<F extends ObjectType>
-
dumpObjectPolicyRules
- Specified by:
dumpObjectPolicyRules
in interfaceModelContext<F extends ObjectType>
-
toBean
- Throws:
SchemaException
-
toBean
'reduced' means - no full object values (focus, shadow).This mode is to be used for re-starting operation after primary-stage approval (here all data are re-loaded; maybe except for objectOld, but let's neglect it for the time being).
It is also to be used for the FINAL stage, where we need the context basically for information about executed deltas.
- Throws:
SchemaException
-
fromLensContextBean
public static <T extends ObjectType> LensContext<T> fromLensContextBean(LensContextType bean, Task task, OperationResult parentResult) throws SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, ExpressionEvaluationException -
toString
-
setProgressListeners
-
reportProgress
- Specified by:
reportProgress
in interfaceModelContext<F extends ObjectType>
-
getHistoricResourceObjects
- Specified by:
getHistoricResourceObjects
in interfaceModelContext<F extends ObjectType>
-
getSequences
-
getSequenceCounter
- Specified by:
getSequenceCounter
in interfaceModelContext<F extends ObjectType>
-
setSequenceCounter
- Specified by:
setSequenceCounter
in interfaceModelContext<F extends ObjectType>
-
getConflictingProjectionContexts
-
addConflictingProjectionContext
public void addConflictingProjectionContext(@NotNull @NotNull LensProjectionContext conflictingContext) -
clearConflictingProjectionContexts
public void clearConflictingProjectionContexts() -
hasExplosiveProjection
-
getHookPreviewResultsMap
- Specified by:
getHookPreviewResultsMap
in interfaceModelContext<F extends ObjectType>
-
addHookPreviewResults
-
getHookPreviewResults
- Specified by:
getHookPreviewResults
in interfaceModelContext<F extends ObjectType>
-
getPolicyRuleEnforcerPreviewOutput
- Specified by:
getPolicyRuleEnforcerPreviewOutput
in interfaceModelContext<F extends ObjectType>
-
setPolicyRuleEnforcerPreviewOutput
public void setPolicyRuleEnforcerPreviewOutput(PolicyRuleEnforcerPreviewOutputType policyRuleEnforcerPreviewOutput) -
hasProjectionChange
-
getGlobalSecurityPolicy
-
setGlobalSecurityPolicy
-
isLegacyPreview
public boolean isLegacyPreview()- Specified by:
isLegacyPreview
in interfaceModelContext<F extends ObjectType>
-
getOperationApprovedBy
-
getOperationApproverComments
-
getTreeDeltas
- Specified by:
getTreeDeltas
in interfaceModelContext<F extends ObjectType>
-
getPrivilegedExpressionProfile
Expression profile to use for "privileged" operations, such as scripting hooks.- Specified by:
getPrivilegedExpressionProfile
in interfaceModelContext<F extends ObjectType>
-
getFocusConstraintsCheckingStrategy
-
getProjectionConstraintsCheckingStrategy
-
getOperationQualifier
-
removeIgnoredContexts
public void removeIgnoredContexts() -
isInPrimary
public boolean isInPrimary() -
isInInitial
public boolean isInInitial() -
hasFocusOfType
-
-
deleteNonTransientComputationResults
public void deleteNonTransientComputationResults()Removes results of any previous computations from the context. (Expecting that transient values are not present. So deals only with non-transient ones. Currently this means deletion of secondary deltas.) Used e.g. when restarting operation after being approved. -
isExperimentalCodeEnabled
public boolean isExperimentalCodeEnabled() -
getTaskTreeOid
- Specified by:
getTaskTreeOid
in interfaceModelContext<F extends ObjectType>
-
getFocusOdoAbsolute
-
isForcedFocusDelete
public boolean isForcedFocusDelete() -
inspectProjectorStart
public void inspectProjectorStart() -
inspectProjectorFinish
public void inspectProjectorFinish() -
hasStarted
public boolean hasStarted() -
setStartedIfNotYet
public void setStartedIfNotYet() -
isDiscoveryChannel
public boolean isDiscoveryChannel() -
markMatchingProjectionsBroken
public void markMatchingProjectionsBroken(@NotNull @NotNull ConstructionType construction, @NotNull @NotNull String resourceOid) Resource OID should correspond to the construction. (However, it may be missing in the construction bean itself, e.g. if a filter is used there.) -
getModelBeans
-
getTaskExecutionMode
- Specified by:
getTaskExecutionMode
in interfaceModelContext<F extends ObjectType>
-
createProvisioningOperationContext
-
getShadowMetadataRecordingStrategy
-
areAccessesMetadataEnabled
public boolean areAccessesMetadataEnabled()
-