com.evolveum.midpoint.model.lens
Class LensContext<F extends ObjectType,P extends ObjectType>

java.lang.Object
  extended by com.evolveum.midpoint.model.lens.LensContext<F,P>
All Implemented Interfaces:
ModelContext<F,P>, DebugDumpable, Dumpable, Serializable

public class LensContext<F extends ObjectType,P extends ObjectType>
extends Object
implements ModelContext<F,P>

Author:
semancik
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
LensContext(Class<F> focusClass, Class<P> projectionClass, PrismContext prismContext)
           
 
Method Summary
 void addProjectionContext(LensProjectionContext<P> projectionContext)
           
 void adopt(PrismContext prismContext)
           
 void checkConsistence()
           
 void cleanup()
          Cleans up the contexts by removing secondary deltas and other working state.
 void clearExecutedDeltas()
           
 LensContext<F,P> clone()
           
protected  void copyValues(LensContext<F,P> clone)
           
 LensFocusContext<F> createFocusContext()
           
 LensFocusContext<F> createFocusContext(Class<F> explicitFocusClass)
           
 LensProjectionContext<P> createProjectionContext()
           
 LensProjectionContext<P> createProjectionContext(ResourceShadowDiscriminator rat)
           
 String debugDump()
          Show the content of the object intended for diagnostics by system administrator.
 String debugDump(int indent)
           
 String debugDump(int indent, boolean showTriples)
           
 void distributeResource()
           
 String dump()
          Show the content of the object intended for diagnostics by developer.
 String dump(boolean showTriples)
           
 LensProjectionContext<P> findOrCreateProjectionContext(ResourceShadowDiscriminator rat)
           
 LensProjectionContext<P> findProjectionContext(ResourceShadowDiscriminator rat)
           
 LensProjectionContext<P> findProjectionContextByOid(String oid)
           
 AccountSynchronizationSettingsType getAccountSynchronizationSettings()
           
 Collection<ObjectDelta<? extends ObjectType>> getAllChanges()
          Returns all changes, user and all accounts.
 String getChannel()
           
 DeltaSetTriple<Assignment> getEvaluatedAssignmentTriple()
           
 Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutedDeltas()
          Returns all executed deltas, user and all accounts.
 int getExecutionWave()
           
 LensFocusContext<F> getFocusContext()
           
 ValuePolicyType getGlobalPasswordPolicy()
           
 int getMaxWave()
           
protected  PrismContext getNotNullPrismContext()
           
 ModelExecuteOptions getOptions()
           
 LensFocusContext<F> getOrCreateFocusContext()
           
 LensFocusContext<F> getOrCreateFocusContext(Class<F> explicitFocusClass)
           
 PrismContext getPrismContext()
           
 Collection<LensProjectionContext<P>> getProjectionContexts()
           
 int getProjectionWave()
           
 ResourceType getResource(ResourceShadowDiscriminator rat)
          Returns a resource for specified account type.
 ResourceType getResource(String resourceOid)
          Returns a resource for specified account type.
 ModelState getState()
           
 UserTemplateType getUserTemplate()
           
 void incrementExecutionWave()
           
 void incrementProjectionWave()
           
 boolean isDoReconciliationForAllProjections()
           
 boolean isFresh()
           
 void normalize()
           
 void recompute()
           
 void recomputeFocus()
           
 void recomputeProjections()
           
 void rememberResource(ResourceType resourceType)
          Puts resource in the cache for later use.
 void rememberResources(Collection<ResourceType> resources)
          Puts resources in the cache for later use.
 void removeRottenContexts()
          Removes projection contexts that are not fresh.
 void resetProjectionWave()
           
 void rot()
          Makes the context and all sub-context non-fresh.
 void setAccountSynchronizationSettings(AccountSynchronizationSettingsType accountSynchronizationSettings)
           
 void setChannel(QName channelQName)
           
 void setChannel(String channelUri)
           
 void setDoReconciliationForAllProjections(boolean doReconciliationForAllProjections)
           
 void setEvaluatedAssignmentTriple(DeltaSetTriple<Assignment> evaluatedAssignmentTriple)
           
 void setExecutionWave(int executionWave)
           
 void setFocusContext(LensFocusContext<F> focusContext)
           
 void setFresh(boolean isFresh)
           
 void setGlobalPasswordPolicy(ValuePolicyType globalPasswordPolicy)
           
 void setOptions(ModelExecuteOptions options)
           
 void setProjectionWave(int wave)
           
 void setState(ModelState state)
           
 void setUserTemplate(UserTemplateType userTemplate)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LensContext

public LensContext(Class<F> focusClass,
                   Class<P> projectionClass,
                   PrismContext prismContext)
Method Detail

getPrismContext

public PrismContext getPrismContext()

getNotNullPrismContext

protected PrismContext getNotNullPrismContext()

getState

public ModelState getState()
Specified by:
getState in interface ModelContext<F extends ObjectType,P extends ObjectType>

setState

public void setState(ModelState state)

getFocusContext

public LensFocusContext<F> getFocusContext()
Specified by:
getFocusContext in interface ModelContext<F extends ObjectType,P 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<P>> getProjectionContexts()
Specified by:
getProjectionContexts in interface ModelContext<F extends ObjectType,P extends ObjectType>

addProjectionContext

public void addProjectionContext(LensProjectionContext<P> projectionContext)

findProjectionContextByOid

public LensProjectionContext<P> findProjectionContextByOid(String oid)

findProjectionContext

public LensProjectionContext<P> findProjectionContext(ResourceShadowDiscriminator rat)
Specified by:
findProjectionContext in interface ModelContext<F extends ObjectType,P extends ObjectType>

findOrCreateProjectionContext

public LensProjectionContext<P> findOrCreateProjectionContext(ResourceShadowDiscriminator rat)

getUserTemplate

public UserTemplateType getUserTemplate()

setUserTemplate

public void setUserTemplate(UserTemplateType userTemplate)

getAccountSynchronizationSettings

public AccountSynchronizationSettingsType getAccountSynchronizationSettings()

setAccountSynchronizationSettings

public void setAccountSynchronizationSettings(AccountSynchronizationSettingsType accountSynchronizationSettings)

getGlobalPasswordPolicy

public ValuePolicyType getGlobalPasswordPolicy()

setGlobalPasswordPolicy

public void setGlobalPasswordPolicy(ValuePolicyType globalPasswordPolicy)

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)

rot

public void rot()
Makes the context and all sub-context non-fresh.


removeRottenContexts

public void removeRottenContexts()
Removes projection contexts that are not fresh. These are usually artifacts left after the context reload. E.g. an account that used to be linked to a user before but was removed in the meantime.


getChannel

public String getChannel()

setChannel

public void setChannel(String channelUri)

setChannel

public void setChannel(QName channelQName)

isDoReconciliationForAllProjections

public boolean isDoReconciliationForAllProjections()

setDoReconciliationForAllProjections

public void setDoReconciliationForAllProjections(boolean doReconciliationForAllProjections)

getEvaluatedAssignmentTriple

public DeltaSetTriple<Assignment> getEvaluatedAssignmentTriple()

setEvaluatedAssignmentTriple

public void setEvaluatedAssignmentTriple(DeltaSetTriple<Assignment> evaluatedAssignmentTriple)

getOptions

public ModelExecuteOptions getOptions()

setOptions

public void setOptions(ModelExecuteOptions options)

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.

Throws:
SchemaException

getExecutedDeltas

public Collection<ObjectDeltaOperation<? extends ObjectType>> getExecutedDeltas()
                                                                         throws SchemaException
Returns all executed deltas, user and all accounts.

Throws:
SchemaException

clearExecutedDeltas

public void clearExecutedDeltas()

recompute

public void recompute()
               throws SchemaException
Throws:
SchemaException

recomputeFocus

public void recomputeFocus()
                    throws SchemaException
Throws:
SchemaException

recomputeProjections

public void recomputeProjections()
                          throws SchemaException
Throws:
SchemaException

checkConsistence

public void checkConsistence()

createProjectionContext

public LensProjectionContext<P> createProjectionContext()

createProjectionContext

public LensProjectionContext<P> 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:
SyncContext#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:
SyncContext#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
Cleans up the contexts by removing secondary deltas and other working state. The context after cleanup should be the same as originally requested. However, the current wave number is retained. Otherwise it ends up in endless loop.

Throws:
SchemaException

adopt

public void adopt(PrismContext prismContext)
           throws SchemaException
Throws:
SchemaException

normalize

public void normalize()

clone

public LensContext<F,P> clone()
Overrides:
clone in class Object

copyValues

protected void copyValues(LensContext<F,P> clone)

distributeResource

public void distributeResource()

debugDump

public String debugDump()
Description copied from interface: DebugDumpable
Show the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.

Specified by:
debugDump in interface DebugDumpable
Returns:
content of the object intended for diagnostics by system administrator.

dump

public String dump()
Description copied from interface: Dumpable
Show the content of the object intended for diagnostics by developer. The content may be multi-line, in case of hierarchical objects it may be intended. The use of this method may not be efficient. It is not supposed to be used in normal operation. However, it is very useful in tests or in case of dumping objects in severe error situations.

Specified by:
dump in interface Dumpable
Returns:
content of the object intended for diagnostics.

dump

public String dump(boolean showTriples)

debugDump

public String debugDump(int indent)
Specified by:
debugDump in interface DebugDumpable

debugDump

public String debugDump(int indent,
                        boolean showTriples)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 evolveum. All Rights Reserved.