Class LensContext<F extends ObjectType>
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.lens.LensContext<F>
-
- All Implemented Interfaces:
ModelContext<F>
,DebugDumpable
,Serializable
- Direct Known Subclasses:
LensContextPlaceholder
public class LensContext<F extends ObjectType> extends Object implements ModelContext<F>
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LensContext.ExportType
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LensContext(PrismContext prismContext)
LensContext(Class<F> focusClass, PrismContext prismContext, ProvisioningService provisioningService)
-
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
-
-
-
-
Constructor Detail
-
LensContext
public LensContext(Class<F> focusClass, PrismContext prismContext, ProvisioningService provisioningService)
-
LensContext
protected LensContext(PrismContext prismContext)
-
-
Method Detail
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfaceModelContext<F extends ObjectType>
-
getNotNullPrismContext
protected PrismContext getNotNullPrismContext()
-
getProvisioningService
public ProvisioningService getProvisioningService()
-
setTriggeredResource
public void setTriggeredResource(ResourceType triggeredResource)
-
getTriggeredResourceOid
public String getTriggeredResourceOid()
-
getRequestIdentifier
public String getRequestIdentifier()
- Specified by:
getRequestIdentifier
in interfaceModelContext<F extends ObjectType>
-
setRequestIdentifier
public void setRequestIdentifier(String requestIdentifier)
-
generateRequestIdentifierIfNeeded
public void generateRequestIdentifierIfNeeded()
-
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>
-
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
public Collection<LensProjectionContext> getProjectionContexts()
- Specified by:
getProjectionContexts
in interfaceModelContext<F extends ObjectType>
-
getProjectionContextsIterator
public Iterator<LensProjectionContext> getProjectionContextsIterator()
-
addProjectionContext
public void addProjectionContext(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()
-
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>
-
getSystemConfigurationType
public SystemConfigurationType getSystemConfigurationType()
-
getInternalsConfiguration
public InternalsConfigurationType getInternalsConfiguration()
-
setSystemConfiguration
public void setSystemConfiguration(PrismObject<SystemConfigurationType> systemConfiguration)
-
getAccountSynchronizationSettings
public ProjectionPolicyType getAccountSynchronizationSettings()
-
setAccountSynchronizationSettings
public void setAccountSynchronizationSettings(ProjectionPolicyType accountSynchronizationSettings)
-
getProjectionWave
public int getProjectionWave()
-
setProjectionWave
public void setProjectionWave(int wave)
-
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()
-
isFresh
public boolean isFresh()
-
setFresh
public void setFresh(boolean isFresh)
-
isRequestAuthorized
public boolean isRequestAuthorized()
-
setRequestAuthorized
public void setRequestAuthorized(boolean isRequestAuthorized)
-
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>
-
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 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 Collection<ObjectDelta<? extends ObjectType>> getAllChanges() throws SchemaException
Returns all changes, user and all accounts. Both primary and secondary changes are returned, but these are not merged. TODO: maybe it would be better to merge them.- Specified by:
getAllChanges
in interfaceModelContext<F extends ObjectType>
- Throws:
SchemaException
-
hasAnyPrimaryChange
public boolean hasAnyPrimaryChange() throws SchemaException
- Throws:
SchemaException
-
getPrimaryChanges
public Collection<ObjectDelta<? extends ObjectType>> getPrimaryChanges() throws SchemaException
- Throws:
SchemaException
-
replacePrimaryFocusDelta
public void replacePrimaryFocusDelta(ObjectDelta<F> newDelta)
-
replacePrimaryFocusDeltas
public void replacePrimaryFocusDeltas(List<ObjectDelta<F>> deltas) throws SchemaException
- Throws:
SchemaException
-
getExecutedDeltas
public Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutedDeltas() throws SchemaException
Returns all executed deltas, user and all accounts.- Throws:
SchemaException
-
getUnauditedExecutedDeltas
public Collection<ObjectDeltaOperation<? extends ObjectType>> getUnauditedExecutedDeltas() throws SchemaException
Returns all executed deltas, user and all accounts.- Throws:
SchemaException
-
markExecutedDeltasAudited
public void markExecutedDeltasAudited()
-
getRottenExecutedDeltas
public List<LensObjectDeltaOperation<?>> getRottenExecutedDeltas()
-
recompute
public void recompute() throws SchemaException, ConfigurationException
-
recomputeFocus
public void recomputeFocus() throws SchemaException, ConfigurationException
-
recomputeProjections
public void recomputeProjections() throws SchemaException
- Throws:
SchemaException
-
refreshAuxiliaryObjectClassDefinitions
public void refreshAuxiliaryObjectClassDefinitions() throws SchemaException
- Throws:
SchemaException
-
checkAbortRequested
public void checkAbortRequested()
-
checkConsistence
public void checkConsistence()
-
checkEncrypted
public void checkEncrypted()
-
createProjectionContext
public LensProjectionContext createProjectionContext()
-
createProjectionContext
public LensProjectionContext createProjectionContext(ResourceShadowDiscriminator rat)
-
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 resourceType)
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, ConfigurationException
Cleans up the contexts by removing some of the working state. The current wave number is retained. Otherwise it ends up in endless loop.
-
adopt
public void adopt(PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
normalize
public void normalize()
-
clone
public LensContext<F> clone()
-
copyValues
protected void copyValues(LensContext<F> clone)
-
distributeResource
public void distributeResource()
-
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>
-
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
-
fromLensContextType
public static LensContext fromLensContextType(LensContextType lensContextType, PrismContext prismContext, ProvisioningService provisioningService, 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()
-
setSequenceCounter
public void setSequenceCounter(String sequenceOid, long counter)
-
getConflictingProjectionContexts
public List<LensProjectionContext> getConflictingProjectionContexts()
-
addConflictingProjectionContext
public void addConflictingProjectionContext(LensProjectionContext conflictingContext)
-
clearConflictingProjectionContexts
public void clearConflictingProjectionContexts()
-
hasExplosiveProjection
public boolean hasExplosiveProjection() throws SchemaException
- Throws:
SchemaException
-
getHookPreviewResultsMap
@NotNull public 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> List<T> getHookPreviewResults(@NotNull Class<T> clazz)
- Specified by:
getHookPreviewResults
in interfaceModelContext<F extends ObjectType>
-
getHookPreviewResult
@Nullable public <T> T getHookPreviewResult(@NotNull Class<T> clazz)
- Specified by:
getHookPreviewResult
in interfaceModelContext<F extends ObjectType>
-
getConflictResolutionAttemptNumber
public int getConflictResolutionAttemptNumber()
-
setConflictResolutionAttemptNumber
public void setConflictResolutionAttemptNumber(int conflictResolutionAttemptNumber)
-
getFocusConflictWatcher
public ConflictWatcher getFocusConflictWatcher()
-
createAndRegisterFocusConflictWatcher
public ConflictWatcher createAndRegisterFocusConflictWatcher(@NotNull String oid, RepositoryService repositoryService)
-
unregisterConflictWatchers
public void unregisterConflictWatchers(RepositoryService repositoryService)
-
hasProjectionChange
public boolean hasProjectionChange()
-
deleteSecondaryDeltas
public void deleteSecondaryDeltas()
-
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)
-
finishBuild
public void finishBuild()
Finish all building activities and prepare context for regular use. This should lock all values that should not be changed during recompute, such as primary deltas. This method is invoked by context factories when context build is finished.
-
getOperationApprovedBy
@NotNull public List<ObjectReferenceType> getOperationApprovedBy()
-
getTreeDeltas
@NotNull public 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()
-
getNameResolver
public ObjectDeltaSchemaLevelUtil.NameResolver getNameResolver()
-
-