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
public class LensContext<F extends ObjectType> extends Object implements ModelContext<F>, Cloneable
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LensContext.AuthorizationState
static class
LensContext.ExportType
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description LensContext()
LensContext(Class<F> focusClass)
-
Method Summary
-
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, dumpFocusPolicyRules
-
-
-
-
Method Detail
-
getProvisioningService
public ProvisioningService getProvisioningService()
-
setTriggeringResourceOid
public void setTriggeringResourceOid(@NotNull @NotNull ResourceType triggeringResource)
-
getTriggeringResourceOid
@Nullable public @Nullable String getTriggeringResourceOid()
-
getRequestIdentifier
public String getRequestIdentifier()
- Specified by:
getRequestIdentifier
in interfaceModelContext<F extends ObjectType>
-
setRequestIdentifier
public void setRequestIdentifier(String requestIdentifier)
-
getItemProcessingIdentifier
public String getItemProcessingIdentifier()
-
setItemProcessingIdentifier
public void setItemProcessingIdentifier(String itemProcessingIdentifier)
-
getState
public ModelState getState()
- Specified by:
getState
in interfaceModelContext<F extends ObjectType>
-
setState
public void setState(ModelState state)
-
getFocusContext
public LensFocusContext<F> getFocusContext()
- Specified by:
getFocusContext
in interfaceModelContext<F extends ObjectType>
-
hasFocusContext
public boolean hasFocusContext()
-
getFocusContextRequired
@NotNull public @NotNull LensFocusContext<F> getFocusContextRequired()
- Specified by:
getFocusContextRequired
in interfaceModelContext<F extends ObjectType>
-
setFocusContext
public void setFocusContext(LensFocusContext<F> focusContext)
-
createFocusContext
public LensFocusContext<F> createFocusContext()
-
createFocusContext
public LensFocusContext<F> createFocusContext(Class<F> explicitFocusClass)
-
getOrCreateFocusContext
public LensFocusContext<F> getOrCreateFocusContext()
-
getOrCreateFocusContext
public LensFocusContext<F> getOrCreateFocusContext(Class<F> explicitFocusClass)
-
getProjectionContexts
@NotNull public @NotNull Collection<LensProjectionContext> getProjectionContexts()
- Specified by:
getProjectionContexts
in interfaceModelContext<F extends ObjectType>
-
getProjectionContextsIterator
public Iterator<LensProjectionContext> getProjectionContextsIterator()
-
addProjectionContext
public void addProjectionContext(@NotNull @NotNull LensProjectionContext projectionContext)
-
findProjectionContextByOid
public LensProjectionContext findProjectionContextByOid(String oid)
-
findProjectionContext
public LensProjectionContext findProjectionContext(ResourceShadowDiscriminator rat)
- Specified by:
findProjectionContext
in interfaceModelContext<F extends ObjectType>
-
findOrCreateProjectionContext
public LensProjectionContext findOrCreateProjectionContext(ResourceShadowDiscriminator rat)
-
getFocusTemplate
public ObjectTemplateType getFocusTemplate()
- Specified by:
getFocusTemplate
in interfaceModelContext<F extends ObjectType>
-
setFocusTemplate
public void setFocusTemplate(ObjectTemplateType focusTemplate)
-
isFocusTemplateExternallySet
public boolean isFocusTemplateExternallySet()
-
setFocusTemplateExternallySet
public void setFocusTemplateExternallySet(boolean focusTemplateExternallySet)
-
findProjectionContext
public LensProjectionContext findProjectionContext(ResourceShadowDiscriminator rat, String oid)
-
getSystemConfiguration
public PrismObject<SystemConfigurationType> getSystemConfiguration()
- Specified by:
getSystemConfiguration
in interfaceModelContext<F extends ObjectType>
-
getSystemConfigurationBean
public SystemConfigurationType getSystemConfigurationBean()
-
getInternalsConfiguration
public InternalsConfigurationType getInternalsConfiguration()
-
setSystemConfiguration
public void setSystemConfiguration(PrismObject<SystemConfigurationType> systemConfiguration)
-
updateSystemConfiguration
public void updateSystemConfiguration(OperationResult result) throws SchemaException
- Throws:
SchemaException
-
getAccountSynchronizationSettings
public ProjectionPolicyType getAccountSynchronizationSettings()
-
setAccountSynchronizationSettings
public void setAccountSynchronizationSettings(ProjectionPolicyType accountSynchronizationSettings)
-
getProjectionWave
public int getProjectionWave()
-
incrementProjectionWave
public void incrementProjectionWave()
-
resetProjectionWave
public void resetProjectionWave()
-
getExecutionWave
public int getExecutionWave()
-
setExecutionWave
public void setExecutionWave(int executionWave)
-
incrementExecutionWave
public void incrementExecutionWave()
-
getMaxWave
public int getMaxWave()
-
computeMaxWaves
public int computeMaxWaves()
-
isFresh
public boolean isFresh()
-
setFresh
public void setFresh(boolean isFresh)
-
isRequestAuthorized
public boolean isRequestAuthorized()
-
getAuthorizationState
@NotNull public @NotNull LensContext.AuthorizationState getAuthorizationState()
-
setRequestAuthorized
public void setRequestAuthorized(@NotNull @NotNull LensContext.AuthorizationState authorizationState)
-
rot
public void rot(String reason)
Makes the context and all sub-context non-fresh.
-
getChannel
public String getChannel()
- Specified by:
getChannel
in interfaceModelContext<F extends ObjectType>
-
setChannel
public void setChannel(String channelUri)
-
setChannel
public void setChannel(QName channelQName)
-
isDoReconciliationForAllProjections
public boolean isDoReconciliationForAllProjections()
-
setDoReconciliationForAllProjections
public void setDoReconciliationForAllProjections(boolean doReconciliationForAllProjections)
-
isReconcileFocus
public boolean isReconcileFocus()
-
isExecutionPhaseOnly
public boolean isExecutionPhaseOnly()
-
setExecutionPhaseOnly
public void setExecutionPhaseOnly(boolean executionPhaseOnly)
-
getEvaluatedAssignmentTriple
public DeltaSetTriple<EvaluatedAssignmentImpl<?>> getEvaluatedAssignmentTriple()
- Specified by:
getEvaluatedAssignmentTriple
in interfaceModelContext<F extends ObjectType>
-
getEvaluatedAssignmentsStream
@NotNull public @NotNull Stream<EvaluatedAssignmentImpl<?>> 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
@NotNull public @NotNull Collection<EvaluatedAssignmentImpl<?>> getAllEvaluatedAssignments()
- Specified by:
getAllEvaluatedAssignments
in interfaceModelContext<F extends ObjectType>
-
setEvaluatedAssignmentTriple
public void setEvaluatedAssignmentTriple(DeltaSetTriple<EvaluatedAssignmentImpl<?>> evaluatedAssignmentTriple)
-
getOptions
public ModelExecuteOptions getOptions()
- Specified by:
getOptions
in interfaceModelContext<F extends ObjectType>
-
setOptions
public void setOptions(ModelExecuteOptions options)
-
getPartialProcessingOptions
@NotNull public @NotNull PartialProcessingOptionsType getPartialProcessingOptions()
- Specified by:
getPartialProcessingOptions
in interfaceModelContext<F extends ObjectType>
-
getRequestMetadata
public MetadataType getRequestMetadata()
-
setRequestMetadata
public void setRequestMetadata(MetadataType requestMetadata)
-
getInspector
public ClockworkInspector getInspector()
-
setInspector
public void setInspector(ClockworkInspector inspector)
-
isLazyAuditRequest
public boolean isLazyAuditRequest()
If set to true then the request will be audited right before execution. If no execution takes place then no request will be audited.
-
setLazyAuditRequest
public void setLazyAuditRequest(boolean lazyAuditRequest)
-
isRequestAudited
public boolean isRequestAudited()
-
setRequestAudited
public void setRequestAudited(boolean requestAudited)
-
isExecutionAudited
public boolean isExecutionAudited()
-
setExecutionAudited
public void setExecutionAudited(boolean executionAudited)
-
getStats
public LensContextStatsType getStats()
-
setStats
public void setStats(LensContextStatsType stats)
-
getRequestBusinessContext
public OperationBusinessContextType 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
public Collection<ObjectDelta<? extends ObjectType>> getPrimaryChanges()
-
getExecutedDeltas
@NotNull public @NotNull Collection<ObjectDeltaOperation<? extends ObjectType>> 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.
-
markExecutedDeltasAudited
public void markExecutedDeltasAudited()
-
getRottenExecutedDeltas
@NotNull public @NotNull List<LensObjectDeltaOperation<?>> getRottenExecutedDeltas()
-
recompute
public void recompute() throws SchemaException
- Throws:
SchemaException
-
recomputeFocus
public void recomputeFocus() throws SchemaException
- Throws:
SchemaException
-
recomputeProjections
public void recomputeProjections() throws SchemaException
- Throws:
SchemaException
-
refreshAuxiliaryObjectClassDefinitions
public void refreshAuxiliaryObjectClassDefinitions() throws SchemaException
- Throws:
SchemaException
-
checkAbortRequested
public void checkAbortRequested()
-
checkConsistenceIfNeeded
public void checkConsistenceIfNeeded()
-
checkConsistence
public void checkConsistence()
-
checkEncrypted
public void checkEncrypted()
-
createProjectionContext
public LensProjectionContext createProjectionContext()
-
createProjectionContext
public LensProjectionContext createProjectionContext(ResourceShadowDiscriminator rsd)
-
createDetachedProjectionContext
public LensProjectionContext createDetachedProjectionContext(ResourceShadowDiscriminator rsd)
-
getResource
public ResourceType getResource(ResourceShadowDiscriminator rat)
Returns a resource for specified account type. This is supposed to be efficient, taking the resource from the cache. It assumes the resource is in the cache.- See Also:
rememberResource(ResourceType)
-
getResource
public ResourceType getResource(String resourceOid)
Returns a resource for specified account type. This is supposed to be efficient, taking the resource from the cache. It assumes the resource is in the cache.- See Also:
rememberResource(ResourceType)
-
rememberResources
public void rememberResources(Collection<ResourceType> resources)
Puts resources in the cache for later use. The resources should be fetched from provisioning and have pre-parsed schemas. So the next time just reuse them without the other overhead.
-
rememberResource
public void rememberResource(ResourceType resource)
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
public void cleanup() throws SchemaException
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
public LensContext<F> clone()
-
copyValues
protected void copyValues(LensContext<F> clone)
-
getFocusClass
public Class<F> getFocusClass()
- Specified by:
getFocusClass
in interfaceModelContext<F extends ObjectType>
-
dump
public String dump(boolean showTriples)
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
debugDump
public String debugDump(int indent, boolean showTriples)
-
dumpAssignmentPolicyRules
public String dumpAssignmentPolicyRules(int indent, boolean alsoMessages)
- Specified by:
dumpAssignmentPolicyRules
in interfaceModelContext<F extends ObjectType>
-
dumpFocusPolicyRules
public String dumpFocusPolicyRules(int indent, boolean alsoMessages)
- Specified by:
dumpFocusPolicyRules
in interfaceModelContext<F extends ObjectType>
-
getTriggeredRulesCount
public static int getTriggeredRulesCount(Collection<? extends EvaluatedPolicyRule> policyRules)
-
toLensContextType
public LensContextType toLensContextType() throws SchemaException
- Throws:
SchemaException
-
toLensContextType
public LensContextType toLensContextType(LensContext.ExportType exportType) throws SchemaException
'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
-
setProgressListeners
public void setProgressListeners(Collection<ProgressListener> progressListeners)
-
getProgressListeners
public Collection<ProgressListener> getProgressListeners()
-
reportProgress
public void reportProgress(ProgressInformation progress)
- Specified by:
reportProgress
in interfaceModelContext<F extends ObjectType>
-
isAbortRequested
public boolean isAbortRequested()
-
getHistoricResourceObjects
public Collection<ResourceShadowDiscriminator> getHistoricResourceObjects()
- Specified by:
getHistoricResourceObjects
in interfaceModelContext<F extends ObjectType>
-
getSequenceCounter
public Long getSequenceCounter(String sequenceOid)
- Specified by:
getSequenceCounter
in interfaceModelContext<F extends ObjectType>
-
setSequenceCounter
public void setSequenceCounter(String sequenceOid, long counter)
- Specified by:
setSequenceCounter
in interfaceModelContext<F extends ObjectType>
-
getConflictingProjectionContexts
@NotNull public @NotNull List<LensProjectionContext> getConflictingProjectionContexts()
-
addConflictingProjectionContext
public void addConflictingProjectionContext(@NotNull @NotNull LensProjectionContext conflictingContext)
-
clearConflictingProjectionContexts
public void clearConflictingProjectionContexts()
-
hasExplosiveProjection
public boolean hasExplosiveProjection() throws SchemaException
- Throws:
SchemaException
-
getHookPreviewResultsMap
@NotNull public @NotNull Map<String,Collection<Containerable>> getHookPreviewResultsMap()
- Specified by:
getHookPreviewResultsMap
in interfaceModelContext<F extends ObjectType>
-
addHookPreviewResults
public void addHookPreviewResults(String hookUri, Collection<Containerable> results)
-
getHookPreviewResults
@NotNull public <T> @NotNull List<T> getHookPreviewResults(@NotNull @NotNull Class<T> clazz)
- Specified by:
getHookPreviewResults
in interfaceModelContext<F extends ObjectType>
-
getPolicyRuleEnforcerPreviewOutput
@Nullable public @Nullable PolicyRuleEnforcerPreviewOutputType getPolicyRuleEnforcerPreviewOutput()
- Specified by:
getPolicyRuleEnforcerPreviewOutput
in interfaceModelContext<F extends ObjectType>
-
setPolicyRuleEnforcerPreviewOutput
public void setPolicyRuleEnforcerPreviewOutput(PolicyRuleEnforcerPreviewOutputType policyRuleEnforcerPreviewOutput)
-
getConflictResolutionAttemptNumber
public int getConflictResolutionAttemptNumber()
-
setConflictResolutionAttemptNumber
public void setConflictResolutionAttemptNumber(int conflictResolutionAttemptNumber)
-
hasProjectionChange
public boolean hasProjectionChange()
-
getGlobalSecurityPolicy
public SecurityPolicyType getGlobalSecurityPolicy()
-
setGlobalSecurityPolicy
public void setGlobalSecurityPolicy(SecurityPolicyType globalSecurityPolicy)
-
getOwnerOid
public String getOwnerOid()
-
setOwnerOid
public void setOwnerOid(String ownerOid)
-
getCachedOwner
public PrismObject<UserType> getCachedOwner()
-
setCachedOwner
public void setCachedOwner(PrismObject<UserType> cachedOwner)
-
isPreview
public boolean isPreview()
- Specified by:
isPreview
in interfaceModelContext<F extends ObjectType>
-
setPreview
public void setPreview(boolean preview)
-
getOperationApprovedBy
@NotNull public @NotNull List<ObjectReferenceType> getOperationApprovedBy()
-
getTreeDeltas
@NotNull public @NotNull ObjectTreeDeltas<F> getTreeDeltas()
- Specified by:
getTreeDeltas
in interfaceModelContext<F extends ObjectType>
-
getPrivilegedExpressionProfile
public ExpressionProfile getPrivilegedExpressionProfile()
Expression profile to use for "privileged" operations, such as scripting hooks.
-
getFocusConstraintsCheckingStrategy
public ConstraintsCheckingStrategyType getFocusConstraintsCheckingStrategy()
-
getProjectionConstraintsCheckingStrategy
public ConstraintsCheckingStrategyType getProjectionConstraintsCheckingStrategy()
-
getOperationQualifier
public String getOperationQualifier()
-
removeIgnoredContexts
public void removeIgnoredContexts()
-
isInPrimary
public boolean isInPrimary()
-
hasFocusOfType
public boolean hasFocusOfType(Class<? extends ObjectType> type)
-
primaryFocusItemDeltaExists
public boolean primaryFocusItemDeltaExists(ItemPath path)
-
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
public String getTaskTreeOid(Task task, OperationResult result)
- Specified by:
getTaskTreeOid
in interfaceModelContext<F extends ObjectType>
-
getFocusOdoAbsolute
public ObjectDeltaObject<F> getFocusOdoAbsolute()
-
isForcedFocusDelete
public boolean isForcedFocusDelete()
-
inspectProjectorStart
public void inspectProjectorStart()
-
inspectProjectorFinish
public void inspectProjectorFinish()
-
hasStarted
public boolean hasStarted()
-
setStartedIfNotYet
public void setStartedIfNotYet()
-
-