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:ModelProjectionContextReturns 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:
getSyncDeltain interfaceModelProjectionContext
-
setSyncDelta
public void setSyncDelta(ObjectDelta<ShadowType> syncDelta)
- Specified by:
setSyncDeltain interfaceModelProjectionContext
-
getSecondaryDelta
public ObjectDelta<ShadowType> getSecondaryDelta()
- Specified by:
getSecondaryDeltain interfaceModelElementContext<ShadowType>
-
getAllDeltas
public Collection<ObjectDelta<ShadowType>> getAllDeltas()
Description copied from class:LensElementContextReturns 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:
getAllDeltasin classLensElementContext<ShadowType>
-
getObjectDeltaObject
public ObjectDeltaObject<ShadowType> getObjectDeltaObject() throws SchemaException
- Specified by:
getObjectDeltaObjectin classLensElementContext<ShadowType>- Throws:
SchemaException
-
hasSecondaryDelta
public boolean hasSecondaryDelta()
-
setSecondaryDelta
public void setSecondaryDelta(ObjectDelta<ShadowType> secondaryDelta)
- Specified by:
setSecondaryDeltain interfaceModelElementContext<ShadowType>
-
addSecondaryDelta
public void addSecondaryDelta(ObjectDelta<ShadowType> delta) throws SchemaException
- Throws:
SchemaException
-
swallowToSecondaryDelta
public void swallowToSecondaryDelta(ItemDelta<?,?> itemDelta) throws SchemaException
- Specified by:
swallowToSecondaryDeltain classLensElementContext<ShadowType>- Throws:
SchemaException
-
deleteSecondaryDeltas
public void deleteSecondaryDeltas()
- Specified by:
deleteSecondaryDeltasin classLensElementContext<ShadowType>
-
setOid
public void setOid(String oid)
Description copied from class:LensElementContextSets oid to the field but also to the deltas (if applicable).- Overrides:
setOidin 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:
getResourceShadowDiscriminatorin 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:
isAddin classLensElementContext<ShadowType>
-
isModify
public boolean isModify()
- Overrides:
isModifyin classLensElementContext<ShadowType>
-
isDelete
public boolean isDelete()
- Overrides:
isDeletein 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:
getObjectDefinitionin 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:
isLegalin interfaceModelProjectionContext
-
setLegal
public void setLegal(Boolean isLegal)
-
isLegalOld
public Boolean isLegalOld()
-
setLegalOld
public void setLegalOld(Boolean isLegalOld)
-
isExists
public boolean isExists()
- Specified by:
isExistsin 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:ModelProjectionContextDecision 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:
getSynchronizationPolicyDecisionin 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:
isFullShadowin 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 SchemaExceptionRecomputes 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:
recomputein 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:
getExecutableDeltain interfaceModelProjectionContext- Throws:
SchemaException
-
checkConsistence
public void checkConsistence()
- Overrides:
checkConsistencein classLensElementContext<ShadowType>
-
checkConsistence
public void checkConsistence(String contextDesc)
- Overrides:
checkConsistencein classLensElementContext<ShadowType>
-
checkConsistence
public void checkConsistence(String contextDesc, boolean fresh, boolean force)
-
checkConsistence
protected void checkConsistence(PrismObject<ShadowType> object, String elementDesc, String contextDesc)
- Overrides:
checkConsistencein classLensElementContext<ShadowType>
-
isRequireSecondaryDeltaOid
protected boolean isRequireSecondaryDeltaOid()
- Overrides:
isRequireSecondaryDeltaOidin classLensElementContext<ShadowType>
-
cleanup
public void cleanup()
Description copied from class:LensElementContextCleans up the contexts by removing some of the working state.- Specified by:
cleanupin classLensElementContext<ShadowType>
-
normalize
public void normalize()
- Overrides:
normalizein classLensElementContext<ShadowType>
-
resetSynchronizationPolicyDecision
protected void resetSynchronizationPolicyDecision()
-
adopt
public void adopt(PrismContext prismContext) throws SchemaException
- Overrides:
adoptin classLensElementContext<ShadowType>- Throws:
SchemaException
-
clone
public LensProjectionContext clone(LensContext<? extends ObjectType> lensContext)
- Specified by:
clonein 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:
checkEncryptedin classLensElementContext<ShadowType>
-
getHumanReadableName
public String getHumanReadableName()
- Specified by:
getHumanReadableNamein classLensElementContext<ShadowType>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable
-
debugDump
public String debugDump(int indent, boolean showTriples)
-
getElementDefaultDesc
protected String getElementDefaultDesc()
- Specified by:
getElementDefaultDescin 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:
getElementDescin 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:
forEachDeltain 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)
-
-