Class LensProjectionContext
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.lens.LensElementContext<ShadowType>
-
- com.evolveum.midpoint.model.impl.lens.LensProjectionContext
-
- All Implemented Interfaces:
ModelElementContext<ShadowType>
,ModelProjectionContext
,DebugDumpable
,Serializable
public class LensProjectionContext extends LensElementContext<ShadowType> implements ModelProjectionContext
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
-
Methods inherited from class com.evolveum.midpoint.model.impl.lens.LensElementContext
addPolicyRule, addPrimaryDelta, addToExecutedDeltas, addToPendingAssignmentPolicyStateModifications, addToPendingObjectPolicyStateModifications, canRepresent, checkConsistence, clearPendingAssignmentPolicyStateModifications, clearPendingObjectPolicyStateModifications, clearPolicyRules, cloneDelta, copyValues, deltaBuilder, determineOid, finishBuild, fixProvisioningTypeInDelta, forEachObject, getDebugDumpTitle, getDebugDumpTitle, getDelta, getExecutedDeltas, getFixedDelta, getFixedPrimaryDelta, getIteration, getIterationToken, getLensContext, getNotNullPrismContext, getObjectAny, getObjectCurrent, getObjectCurrentOrOld, getObjectNew, getObjectOld, getObjectReadVersion, getObjectTypeClass, getOid, getOperation, getPendingAssignmentPolicyStateModifications, getPendingObjectPolicyStateModifications, getPolicyRules, getPolicySituations, getPrimaryDelta, getPrismContext, getSecurityPolicy, getSynchronizationIntent, hasPrimaryDelta, isFresh, isOfType, markExecutedDeltasAudited, operationMatches, retrieveFromLensElementContextType, setFresh, setIteration, setIterationToken, setLoadedObject, setObjectCurrent, setObjectNew, setObjectOld, setPrimaryDelta, setSecurityPolicy, setSynchronizationIntent, swallowToDelta, swallowToPrimaryDelta, triggerRule, wasAddExecuted
-
Methods inherited from class java.lang.Object
clone, 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.ModelElementContext
addPrimaryDelta, getExecutedDeltas, getObjectCurrent, getObjectNew, getObjectOld, getObjectTypeClass, getOid, getPolicyRules, getPrimaryDelta, isOfType, setObjectNew, setObjectOld, setPrimaryDelta
-
-
-
-
Method Detail
-
getSyncDelta
public ObjectDelta<ShadowType> getSyncDelta()
Description copied from interface:ModelProjectionContext
Returns synchronization delta. Synchronization delta describes changes that have recently happened. MidPoint reacts to these changes by "pulling them in" (e.g. using them in inbound mappings).- Specified by:
getSyncDelta
in interfaceModelProjectionContext
-
setSyncDelta
public void setSyncDelta(ObjectDelta<ShadowType> syncDelta)
- Specified by:
setSyncDelta
in interfaceModelProjectionContext
-
getSecondaryDelta
public ObjectDelta<ShadowType> getSecondaryDelta()
- Specified by:
getSecondaryDelta
in interfaceModelElementContext<ShadowType>
-
getAllDeltas
public Collection<ObjectDelta<ShadowType>> getAllDeltas()
Description copied from class:LensElementContext
Returns collection of all deltas that this element context contains. This is a nice method to use if we want to inspect all deltas (e.g. look for a changed item) but we want to avoid the overhead of merging all the deltas together.- Specified by:
getAllDeltas
in classLensElementContext<ShadowType>
-
getObjectDeltaObject
public ObjectDeltaObject<ShadowType> getObjectDeltaObject() throws SchemaException
- Specified by:
getObjectDeltaObject
in classLensElementContext<ShadowType>
- Throws:
SchemaException
-
hasSecondaryDelta
public boolean hasSecondaryDelta()
-
setSecondaryDelta
public void setSecondaryDelta(ObjectDelta<ShadowType> secondaryDelta)
- Specified by:
setSecondaryDelta
in interfaceModelElementContext<ShadowType>
-
addSecondaryDelta
public void addSecondaryDelta(ObjectDelta<ShadowType> delta) throws SchemaException
- Throws:
SchemaException
-
swallowToSecondaryDelta
public void swallowToSecondaryDelta(ItemDelta<?,?> itemDelta) throws SchemaException
- Specified by:
swallowToSecondaryDelta
in classLensElementContext<ShadowType>
- Throws:
SchemaException
-
deleteSecondaryDeltas
public void deleteSecondaryDeltas()
- Specified by:
deleteSecondaryDeltas
in classLensElementContext<ShadowType>
-
setOid
public void setOid(String oid)
Description copied from class:LensElementContext
Sets oid to the field but also to the deltas (if applicable).- Overrides:
setOid
in classLensElementContext<ShadowType>
-
isSyncAbsoluteTrigger
public boolean isSyncAbsoluteTrigger()
-
setSyncAbsoluteTrigger
public void setSyncAbsoluteTrigger(boolean syncAbsoluteTrigger)
-
getWave
public int getWave()
-
setWave
public void setWave(int wave)
-
isWaveIncomplete
public boolean isWaveIncomplete()
-
setWaveIncomplete
public void setWaveIncomplete(boolean waveIncomplete)
-
isDoReconciliation
public boolean isDoReconciliation()
-
setDoReconciliation
public void setDoReconciliation(boolean doReconciliation)
-
getResourceShadowDiscriminator
public ResourceShadowDiscriminator getResourceShadowDiscriminator()
- Specified by:
getResourceShadowDiscriminator
in interfaceModelProjectionContext
-
markTombstone
public void markTombstone()
-
setResourceShadowDiscriminator
public void setResourceShadowDiscriminator(ResourceShadowDiscriminator resourceShadowDiscriminator)
-
compareResourceShadowDiscriminator
public boolean compareResourceShadowDiscriminator(ResourceShadowDiscriminator rsd, boolean compareOrder)
-
isTombstone
public boolean isTombstone()
-
addAccountSyncDelta
public void addAccountSyncDelta(ObjectDelta<ShadowType> delta) throws SchemaException
- Throws:
SchemaException
-
isAdd
public boolean isAdd()
- Overrides:
isAdd
in classLensElementContext<ShadowType>
-
isModify
public boolean isModify()
- Overrides:
isModify
in classLensElementContext<ShadowType>
-
isDelete
public boolean isDelete()
- Overrides:
isDelete
in classLensElementContext<ShadowType>
-
getResource
public ResourceType getResource()
-
setResource
public void setResource(ResourceType resource)
-
getEntitlementMap
public Map<String,PrismObject<ShadowType>> getEntitlementMap()
-
setEntitlementMap
public void setEntitlementMap(Map<String,PrismObject<ShadowType>> entitlementMap)
-
getObjectDefinition
public PrismObjectDefinition<ShadowType> getObjectDefinition()
- Overrides:
getObjectDefinition
in classLensElementContext<ShadowType>
-
isAssigned
public boolean isAssigned()
-
setAssigned
public void setAssigned(boolean isAssigned)
-
isAssignedOld
public boolean isAssignedOld()
-
setAssignedOld
public void setAssignedOld(boolean isAssignedOld)
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean isActive)
-
isLegal
public Boolean isLegal()
- Specified by:
isLegal
in interfaceModelProjectionContext
-
setLegal
public void setLegal(Boolean isLegal)
-
isLegalOld
public Boolean isLegalOld()
-
setLegalOld
public void setLegalOld(Boolean isLegalOld)
-
isExists
public boolean isExists()
- Specified by:
isExists
in interfaceModelProjectionContext
-
setExists
public void setExists(boolean exists)
-
isShadowExistsInRepo
public boolean isShadowExistsInRepo()
-
setShadowExistsInRepo
public void setShadowExistsInRepo(boolean shadowExistsInRepo)
-
getSynchronizationPolicyDecision
public SynchronizationPolicyDecision getSynchronizationPolicyDecision()
Description copied from interface:ModelProjectionContext
Decision regarding the account. It describes the overall situation of the account e.g. whether account is added, is to be deleted, unliked, etc. If set to null no decision was made yet. Null is also a typical value when the context is created.- Specified by:
getSynchronizationPolicyDecision
in interfaceModelProjectionContext
- See Also:
SynchronizationPolicyDecision
-
setSynchronizationPolicyDecision
public void setSynchronizationPolicyDecision(SynchronizationPolicyDecision policyDecision)
-
getSynchronizationSituationDetected
public SynchronizationSituationType getSynchronizationSituationDetected()
-
setSynchronizationSituationDetected
public void setSynchronizationSituationDetected(SynchronizationSituationType synchronizationSituationDetected)
-
getSynchronizationSituationResolved
public SynchronizationSituationType getSynchronizationSituationResolved()
-
setSynchronizationSituationResolved
public void setSynchronizationSituationResolved(SynchronizationSituationType synchronizationSituationResolved)
-
isFullShadow
public boolean isFullShadow()
- Specified by:
isFullShadow
in interfaceModelProjectionContext
-
hasFullShadow
public boolean hasFullShadow()
Returns true if full shadow is available, either loaded or in a create delta.
-
setFullShadow
public void setFullShadow(boolean fullShadow)
-
getKind
public ShadowKindType getKind()
-
getConstructionDeltaSetTriple
public PrismValueDeltaSetTriple<PrismPropertyValue<Construction>> getConstructionDeltaSetTriple()
-
setConstructionDeltaSetTriple
public void setConstructionDeltaSetTriple(PrismValueDeltaSetTriple<PrismPropertyValue<Construction>> constructionDeltaSetTriple)
-
getOutboundConstruction
public Construction getOutboundConstruction()
-
setOutboundConstruction
public void setOutboundConstruction(Construction outboundConstruction)
-
getSqueezedAttributes
public Map<QName,DeltaSetTriple<ItemValueWithOrigin<PrismPropertyValue<?>,PrismPropertyDefinition<?>>>> getSqueezedAttributes()
-
setSqueezedAttributes
public void setSqueezedAttributes(Map<QName,DeltaSetTriple<ItemValueWithOrigin<PrismPropertyValue<?>,PrismPropertyDefinition<?>>>> squeezedAttributes)
-
getSqueezedAssociations
public Map<QName,DeltaSetTriple<ItemValueWithOrigin<PrismContainerValue<ShadowAssociationType>,PrismContainerDefinition<ShadowAssociationType>>>> getSqueezedAssociations()
-
setSqueezedAssociations
public void setSqueezedAssociations(Map<QName,DeltaSetTriple<ItemValueWithOrigin<PrismContainerValue<ShadowAssociationType>,PrismContainerDefinition<ShadowAssociationType>>>> squeezedAssociations)
-
getSqueezedAuxiliaryObjectClasses
public Map<QName,DeltaSetTriple<ItemValueWithOrigin<PrismPropertyValue<QName>,PrismPropertyDefinition<QName>>>> getSqueezedAuxiliaryObjectClasses()
-
setSqueezedAuxiliaryObjectClasses
public void setSqueezedAuxiliaryObjectClasses(Map<QName,DeltaSetTriple<ItemValueWithOrigin<PrismPropertyValue<QName>,PrismPropertyDefinition<QName>>>> squeezedAuxiliaryObjectClasses)
-
getResourceObjectTypeDefinitionType
public ResourceObjectTypeDefinitionType getResourceObjectTypeDefinitionType()
-
getRefinedResourceSchema
public RefinedResourceSchema getRefinedResourceSchema() throws SchemaException
- Throws:
SchemaException
-
getStructuralObjectClassDefinition
public RefinedObjectClassDefinition getStructuralObjectClassDefinition() throws SchemaException
- Throws:
SchemaException
-
getAuxiliaryObjectClassDefinitions
public Collection<RefinedObjectClassDefinition> getAuxiliaryObjectClassDefinitions() throws SchemaException
- Throws:
SchemaException
-
refreshAuxiliaryObjectClassDefinitions
public void refreshAuxiliaryObjectClassDefinitions() throws SchemaException
- Throws:
SchemaException
-
getCompositeObjectClassDefinition
public CompositeRefinedObjectClassDefinition getCompositeObjectClassDefinition() throws SchemaException
- Throws:
SchemaException
-
findAttributeDefinition
public <T> RefinedAttributeDefinition<T> findAttributeDefinition(QName attrName) throws SchemaException
- Throws:
SchemaException
-
getDependencies
public Collection<ResourceObjectTypeDependencyType> getDependencies()
-
getProjectionSecurityPolicy
public SecurityPolicyType getProjectionSecurityPolicy()
-
setProjectionSecurityPolicy
public void setProjectionSecurityPolicy(SecurityPolicyType projectionSecurityPolicy)
-
setCanProject
public void setCanProject(boolean canProject)
-
isCanProject
public boolean isCanProject()
-
getAssignmentPolicyEnforcementType
public AssignmentPolicyEnforcementType getAssignmentPolicyEnforcementType() throws SchemaException
- Throws:
SchemaException
-
isLegalize
public boolean isLegalize() throws SchemaException
- Throws:
SchemaException
-
recompute
public void recompute() throws SchemaException
Recomputes the new state of account (accountNew). It is computed by applying deltas to the old state (accountOld). Assuming that oldAccount is already set (or is null if it does not exist)- Overrides:
recompute
in classLensElementContext<ShadowType>
- Throws:
SchemaException
-
clearIntermediateResults
public void clearIntermediateResults()
-
distributeResource
public void distributeResource()
Distribute the resource that's in the context into all the prism objects (old, new) and deltas. The resourceRef will not just contain the OID but also full resource object. This may optimize handling of the objects in upper layers (e.g. GUI).
-
getExecutableDelta
public ObjectDelta<ShadowType> getExecutableDelta() throws SchemaException
Returns delta suitable for execution. The primary and secondary deltas may not make complete sense all by themselves. E.g. they may both be MODIFY deltas even in case that the account should be created. The deltas begin to make sense only if combined with sync decision. This method provides the deltas all combined and ready for execution.- Specified by:
getExecutableDelta
in interfaceModelProjectionContext
- Throws:
SchemaException
-
checkConsistence
public void checkConsistence()
- Overrides:
checkConsistence
in classLensElementContext<ShadowType>
-
checkConsistence
public void checkConsistence(String contextDesc)
- Overrides:
checkConsistence
in classLensElementContext<ShadowType>
-
checkConsistence
public void checkConsistence(String contextDesc, boolean fresh, boolean force)
-
checkConsistence
protected void checkConsistence(PrismObject<ShadowType> object, String elementDesc, String contextDesc)
- Overrides:
checkConsistence
in classLensElementContext<ShadowType>
-
isRequireSecondaryDeltaOid
protected boolean isRequireSecondaryDeltaOid()
- Overrides:
isRequireSecondaryDeltaOid
in classLensElementContext<ShadowType>
-
cleanup
public void cleanup()
Description copied from class:LensElementContext
Cleans up the contexts by removing some of the working state.- Specified by:
cleanup
in classLensElementContext<ShadowType>
-
normalize
public void normalize()
- Overrides:
normalize
in classLensElementContext<ShadowType>
-
resetSynchronizationPolicyDecision
protected void resetSynchronizationPolicyDecision()
-
adopt
public void adopt(PrismContext prismContext) throws SchemaException
- Overrides:
adopt
in classLensElementContext<ShadowType>
- Throws:
SchemaException
-
clone
public LensProjectionContext clone(LensContext<? extends ObjectType> lensContext)
- Specified by:
clone
in classLensElementContext<ShadowType>
-
copyValues
protected void copyValues(LensProjectionContext clone, LensContext<? extends ObjectType> lensContext)
-
hasValueForAttribute
public boolean hasValueForAttribute(QName attributeName)
Returns true if the projection has any value for specified attribute.
-
checkEncrypted
public void checkEncrypted()
- Overrides:
checkEncrypted
in classLensElementContext<ShadowType>
-
getHumanReadableName
public String getHumanReadableName()
- Specified by:
getHumanReadableName
in classLensElementContext<ShadowType>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
debugDump
public String debugDump(int indent, boolean showTriples)
-
getElementDefaultDesc
protected String getElementDefaultDesc()
- Specified by:
getElementDefaultDesc
in classLensElementContext<ShadowType>
-
toHumanReadableString
public String toHumanReadableString()
Return a human readable name of the projection object suitable for logs.
-
getHumanReadableKind
public String getHumanReadableKind()
-
getElementDesc
protected String getElementDesc()
- Overrides:
getElementDesc
in classLensElementContext<ShadowType>
-
fromLensProjectionContextType
public static LensProjectionContext fromLensProjectionContextType(LensProjectionContextType projectionContextType, LensContext lensContext, Task task, OperationResult result) throws SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, ExpressionEvaluationException
-
determineFullShadowFlag
public void determineFullShadowFlag(PrismObject<ShadowType> loadedShadow)
-
isToBeArchived
public boolean isToBeArchived()
-
setToBeArchived
public void setToBeArchived(boolean toBeArchived)
-
getResourceOid
public String getResourceOid()
-
getVolatility
public ResourceObjectVolatilityType getVolatility() throws SchemaException
- Throws:
SchemaException
-
hasPendingOperations
public boolean hasPendingOperations()
-
forEachDelta
public void forEachDelta(Consumer<ObjectDelta<ShadowType>> consumer)
- Overrides:
forEachDelta
in classLensElementContext<ShadowType>
-
resolveNameIfKnown
public PolyString resolveNameIfKnown(Class<? extends ObjectType> objectClass, String oid)
-
getResourceName
public String getResourceName()
-
isSynchronizationSource
public boolean isSynchronizationSource()
-
setSynchronizationSource
public void setSynchronizationSource(boolean synchronizationSource)
-
-