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
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionLensContext(@NotNull TaskExecutionMode taskExecutionMode) LensContext(Class<F> focusClass, @NotNull TaskExecutionMode taskExecutionMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConflictingProjectionContext(@NotNull LensProjectionContext conflictingContext) voidaddHookPreviewResults(String hookUri, Collection<? extends Containerable> results) voidaddProjectionContext(@NotNull LensProjectionContext projectionContext) booleanvoidvoidvoidvoidcleanup()Cleans up the contexts by removing some of the working state.voidclone()intcreateDetachedProjectionContext(@NotNull ProjectionContextKey key) createProjectionContext(@NotNull ProjectionContextKey key) @NotNull ProvisioningOperationContextdebugDump(int indent) debugDump(int indent, boolean showTriples) voidRemoves 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 LensProjectionContextfindProjectionContext(@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) intNumber of all changes.@NotNull Collection<EvaluatedAssignmentImpl<?>>@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 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 PolicyRuleEnforcerPreviewOutputTypeCollection<ObjectDelta<? extends ObjectType>>Expression profile to use for "privileged" operations, such as scripting hooks.@NotNull Collection<LensProjectionContext>intgetResource(String resourceOid) Returns a resource with given OID.@NotNull List<LensObjectDeltaOperation<?>>getSequenceCounter(String sequenceOid) getState()getStats()@NotNull TaskExecutionModegetTaskTreeOid(Task task, OperationResult result) @NotNull ObjectTreeDeltas<F>@Nullable String@NotNull Collection<ObjectDeltaOperation<? extends ObjectType>>Returns all executed deltas, user and all accounts.booleanbooleanbooleanbooleanhasFocusOfType(Class<? extends ObjectType> type) booleanhasLowerOrderContext(LensProjectionContext refProjCtx) booleanbooleanvoidvoidvoidbooleanbooleanbooleanbooleanbooleanbooleanisFresh()booleanbooleanbooleanbooleanbooleanvoidmarkMatchingProjectionsBroken(@NotNull ConstructionType construction, @NotNull String resourceOid) Resource OID should correspond to the construction.voidbooleanvoidvoidvoidvoidrememberResource(ResourceType resource) Puts resource in the cache for later use.voidvoidreportProgress(ProgressInformation progress) voidvoidMakes the context and all sub-context non-fresh.voidsetAccountSynchronizationSettings(ProjectionPolicyType accountSynchronizationSettings) voidsetChannel(String channelUri) voidsetChannel(QName channelQName) voidsetDoReconciliationForAllProjections(boolean doReconciliationForAllProjections) voidsetEvaluatedAssignmentTriple(DeltaSetTriple<EvaluatedAssignmentImpl<?>> evaluatedAssignmentTriple) voidsetExplicitFocusTemplateOid(String explicitFocusTemplateOid) voidsetFocusContext(LensFocusContext<F> focusContext) voidsetFresh(boolean isFresh) voidsetGlobalSecurityPolicy(SecurityPolicyType globalSecurityPolicy) voidsetInspector(ClockworkInspector inspector) voidsetItemProcessingIdentifier(String itemProcessingIdentifier) voidsetLazyAuditRequest(boolean lazyAuditRequest) voidsetOptions(ModelExecuteOptions options) voidsetPolicyRuleEnforcerPreviewOutput(PolicyRuleEnforcerPreviewOutputType policyRuleEnforcerPreviewOutput) voidsetPreview(boolean preview) voidsetProgressListeners(Collection<ProgressListener> progressListeners) voidsetSequenceCounter(String sequenceOid, long counter) voidvoidsetState(ModelState state) voidsetStats(LensContextStatsType stats) voidsetSystemConfiguration(PrismObject<SystemConfigurationType> systemConfiguration) voidsetTriggeringResourceOid(@NotNull ResourceType triggeringResource) toBean()toBean(LensContext.ExportType exportType) 'reduced' means - no full object values (focus, shadow).toString()voidMethods inherited from class java.lang.Object
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.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) -
hasLowerOrderContext
-
findLowerOrderContext
-
getProvisioningService
-
setTriggeringResourceOid
-
getTriggeringResourceOid
-
getRequestIdentifier
- Specified by:
getRequestIdentifierin interfaceModelContext<F extends ObjectType>
-
getItemProcessingIdentifier
-
setItemProcessingIdentifier
-
getState
- Specified by:
getStatein interfaceModelContext<F extends ObjectType>
-
setState
-
getFocusContext
- Specified by:
getFocusContextin interfaceModelContext<F extends ObjectType>
-
hasFocusContext
public boolean hasFocusContext() -
getFocusContextRequired
- Specified by:
getFocusContextRequiredin interfaceModelContext<F extends ObjectType>
-
setFocusContext
-
createFocusContext
-
getOrCreateFocusContext
-
getOrCreateFocusContext
-
getProjectionContexts
- Specified by:
getProjectionContextsin 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:
findProjectionContextByKeyExactin interfaceModelContext<F extends ObjectType>
-
findProjectionContexts
@NotNull public @NotNull Collection<LensProjectionContext> findProjectionContexts(@NotNull @NotNull ProjectionContextFilter filter) - Specified by:
findProjectionContextsin 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:
getFocusTemplatein interfaceModelContext<F extends ObjectType>
-
getSystemConfiguration
- Specified by:
getSystemConfigurationin 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() -
rot
Makes the context and all sub-context non-fresh. -
getChannel
- Specified by:
getChannelin interfaceModelContext<F extends ObjectType>
-
setChannel
-
setChannel
-
isDoReconciliationForAllProjections
public boolean isDoReconciliationForAllProjections() -
setDoReconciliationForAllProjections
public void setDoReconciliationForAllProjections(boolean doReconciliationForAllProjections) -
getEvaluatedAssignmentTriple
- Specified by:
getEvaluatedAssignmentTriplein interfaceModelContext<F extends ObjectType>
-
getEvaluatedAssignmentsStream
- Specified by:
getEvaluatedAssignmentsStreamin interfaceModelContext<F extends ObjectType>
-
getNonNegativeEvaluatedAssignments
@NotNull public @NotNull Collection<EvaluatedAssignmentImpl<?>> getNonNegativeEvaluatedAssignments()- Specified by:
getNonNegativeEvaluatedAssignmentsin interfaceModelContext<F extends ObjectType>
-
getAllEvaluatedAssignments
- Specified by:
getAllEvaluatedAssignmentsin interfaceModelContext<F extends ObjectType>
-
setEvaluatedAssignmentTriple
public void setEvaluatedAssignmentTriple(DeltaSetTriple<EvaluatedAssignmentImpl<?>> evaluatedAssignmentTriple) -
getOptions
- Specified by:
getOptionsin interfaceModelContext<F extends ObjectType>
-
setOptions
-
getPartialProcessingOptions
- Specified by:
getPartialProcessingOptionsin interfaceModelContext<F extends ObjectType>
-
getInspector
-
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:
getAllChangesin 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
-
recompute
- Throws:
SchemaException
-
recomputeFocus
- Throws:
SchemaException
-
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:
getFocusClassin interfaceModelContext<F extends ObjectType>
-
dump
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
debugDump
-
dumpAssignmentPolicyRules
- Specified by:
dumpAssignmentPolicyRulesin interfaceModelContext<F extends ObjectType>
-
dumpObjectPolicyRules
- Specified by:
dumpObjectPolicyRulesin 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:
reportProgressin interfaceModelContext<F extends ObjectType>
-
getHistoricResourceObjects
- Specified by:
getHistoricResourceObjectsin interfaceModelContext<F extends ObjectType>
-
getSequences
-
getSequenceCounter
- Specified by:
getSequenceCounterin interfaceModelContext<F extends ObjectType>
-
setSequenceCounter
- Specified by:
setSequenceCounterin interfaceModelContext<F extends ObjectType>
-
getConflictingProjectionContexts
-
addConflictingProjectionContext
public void addConflictingProjectionContext(@NotNull @NotNull LensProjectionContext conflictingContext) -
clearConflictingProjectionContexts
public void clearConflictingProjectionContexts() -
hasExplosiveProjection
-
getHookPreviewResultsMap
- Specified by:
getHookPreviewResultsMapin interfaceModelContext<F extends ObjectType>
-
addHookPreviewResults
-
getHookPreviewResults
- Specified by:
getHookPreviewResultsin interfaceModelContext<F extends ObjectType>
-
getPolicyRuleEnforcerPreviewOutput
- Specified by:
getPolicyRuleEnforcerPreviewOutputin interfaceModelContext<F extends ObjectType>
-
setPolicyRuleEnforcerPreviewOutput
public void setPolicyRuleEnforcerPreviewOutput(PolicyRuleEnforcerPreviewOutputType policyRuleEnforcerPreviewOutput) -
hasProjectionChange
-
getGlobalSecurityPolicy
-
setGlobalSecurityPolicy
-
isPreview
public boolean isPreview()- Specified by:
isPreviewin interfaceModelContext<F extends ObjectType>
-
setPreview
public void setPreview(boolean preview) -
getOperationApprovedBy
-
getOperationApproverComments
-
getTreeDeltas
- Specified by:
getTreeDeltasin interfaceModelContext<F extends ObjectType>
-
getPrivilegedExpressionProfile
Expression profile to use for "privileged" operations, such as scripting hooks.- Specified by:
getPrivilegedExpressionProfilein 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:
getTaskTreeOidin 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:
getTaskExecutionModein interfaceModelContext<F extends ObjectType>
-
createProvisioningOperationContext
-
getShadowMetadataRecordingStrategy
-
areAccessesMetadataEnabled
public boolean areAccessesMetadataEnabled()
-