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
,Cloneable
public class LensProjectionContext extends LensElementContext<ShadowType> implements ModelProjectionContext
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.model.impl.lens.LensElementContext
lensContext, state
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
-
Methods inherited from class com.evolveum.midpoint.model.impl.lens.LensElementContext
addObjectPolicyRule, addToExecutedDeltas, addToPendingAssignmentPolicyStateModifications, addToPendingObjectPolicyStateModifications, addToPrimaryDelta, checkConsistence, clearCurrentObject, clearObjectPolicyRules, clearPendingPolicyStateModifications, deleteNonTransientComputationResults, forEachObject, getArchivedSecondaryDeltas, getCredentialsPolicy, getCurrentDelta, getDebugDumpTitle, getDebugDumpTitle, getExecutedDeltas, getIteration, getIterationToken, getLensContext, getObjectAny, getObjectCurrent, getObjectCurrentOrNew, getObjectDefinition, getObjectNew, getObjectNewOrCurrentRequired, getObjectOld, getObjectPolicyRules, getObjectReadVersion, getObjectTypeClass, getOid, getOperation, getPendingAssignmentPolicyStateModifications, getPendingObjectPolicyStateModifications, getPolicyRuleCounter, getPrimaryDelta, getSecondaryDelta, getSecurityPolicy, getSummaryDelta, initializeElementState, isFresh, isOfType, modifyPrimaryDelta, operationMatches, recompute, rememberElementState, replaceOldAndCurrentObject, represents, restoreElementState, setAnyDeltasExecutedFlag, setCurrentObject, setCurrentObjectAndOid, setEstimatedOldValuesInPrimaryDelta, setFresh, setInitialObject, setInitialObject, setIteration, setIterationToken, setOid, setPolicyRuleCounter, setPrimaryDelta, setPrimaryDeltaAfterStart, setSecurityPolicy, swallowToPrimaryDelta, swallowToSecondaryDelta, swallowToSecondaryDelta, swallowToSecondaryDeltaUnchecked, 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
addToPrimaryDelta, getCurrentDelta, getExecutedDeltas, getObjectAny, getObjectCurrent, getObjectNew, getObjectOld, getObjectPolicyRules, getObjectTypeClass, getOid, getPrimaryDelta, getSecondaryDelta, getSummaryDelta, isOfType, setPrimaryDelta
-
Methods inherited from interface com.evolveum.midpoint.model.api.context.ModelProjectionContext
isTombstone
-
-
-
-
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
-
setLoadedObject
public void setLoadedObject(@NotNull @NotNull PrismObject<ShadowType> object)
Description copied from class:LensElementContext
Sets current and possibly also old object. This method is used with freshly loaded object. The object is set as current object. If the old object should be initialized, then the object is also set as old object. Should be used only from the context loader!- Specified by:
setLoadedObject
in classLensElementContext<ShadowType>
-
getObjectDeltaObject
public ObjectDeltaObject<ShadowType> getObjectDeltaObject() throws SchemaException
ReturnsObjectDeltaObject
to be used e.g. expression evaluation regarding this projection. We useElementState.getRelativeObjectDeltaObject()
, although the "absolute" version should provide more or less the same results. Projections are not updated iteratively, unlike the focus.- Throws:
SchemaException
-
getSummarySecondaryDelta
public ObjectDelta<ShadowType> getSummarySecondaryDelta()
Description copied from interface:ModelElementContext
Returns all secondary deltas, merged together. (Can take some time to compute. So use with care.) The returned object is (kind of) immutable. Changing it may do strange things, but most likely the changes will be lost.- Specified by:
getSummarySecondaryDelta
in interfaceModelElementContext<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
-
markGone
public void markGone()
-
setResourceShadowDiscriminator
public void setResourceShadowDiscriminator(ResourceShadowDiscriminator resourceShadowDiscriminator)
-
compareResourceShadowDiscriminator
public boolean compareResourceShadowDiscriminator(ResourceShadowDiscriminator rsd, boolean compareOrder)
-
isGone
public boolean isGone()
- Specified by:
isGone
in interfaceModelProjectionContext
-
isReaping
public boolean isReaping()
-
addAccountSyncDelta
public void addAccountSyncDelta(ObjectDelta<ShadowType> delta) throws SchemaException
- Throws:
SchemaException
-
isAdd
public boolean isAdd()
Description copied from interface:ModelElementContext
Returns true if the object (focus or projection) is to be added.- Specified by:
isAdd
in interfaceModelElementContext<ShadowType>
- Specified by:
isAdd
in classLensElementContext<ShadowType>
-
isModify
public boolean isModify()
Description copied from class:LensElementContext
TODO description- Overrides:
isModify
in classLensElementContext<ShadowType>
-
isDelete
public boolean isDelete()
Description copied from interface:ModelElementContext
Returns true if the object (focus or projection) is to be deleted.- Specified by:
isDelete
in interfaceModelElementContext<ShadowType>
- Specified by:
isDelete
in classLensElementContext<ShadowType>
-
getArchetype
public ArchetypeType getArchetype()
- Specified by:
getArchetype
in interfaceModelElementContext<ShadowType>
- Returns:
- Determined archetype of the object. Currently not supported for projections. Since 4.4 structural archetype is returned
-
getArchetypes
public List<ArchetypeType> getArchetypes()
- Specified by:
getArchetypes
in interfaceModelElementContext<ShadowType>
- Returns:
- All archetypes (structural and auxiliary)
-
getResource
public ResourceType getResource()
-
setResource
public void setResource(ResourceType resource)
-
getEntitlementMap
public Map<String,PrismObject<ShadowType>> getEntitlementMap()
-
isAssigned
public Boolean isAssigned()
-
setAssigned
public void setAssigned(boolean isAssigned)
-
isAssignedOld
public Boolean isAssignedOld()
-
setAssignedOld
public void setAssignedOld(Boolean isAssignedOld)
-
setAssignedOldIfUnknown
public void setAssignedOldIfUnknown(Boolean value)
We want to set "assigned in old state" only once - in projection wave 0 where real "old" values are known. TODO: what should we do with projections that appear later?
-
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)
-
setLegalOldIfUnknown
public void setLegalOldIfUnknown(Boolean value)
We want to set "legal in old state" only once - in projection wave 0 where real "old" values are known. TODO: what should we do with projections that appear later?
-
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)
-
getSynchronizationIntent
public SynchronizationIntent getSynchronizationIntent()
Description copied from interface:ModelProjectionContext
Initial intent regarding the account. It indicates what the initiator of the operation _wants to do_ with the context. If set to null then the decision is left to "the engine". Null is also a typical value when the context is created. It may be pre-set under some circumstances, e.g. if an account is being unlinked.- Specified by:
getSynchronizationIntent
in interfaceModelProjectionContext
-
setSynchronizationIntent
public void setSynchronizationIntent(SynchronizationIntent synchronizationIntent)
-
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)
-
setBroken
public void setBroken()
-
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()
-
getEvaluatedAssignedConstructionDeltaSetTriple
public <AH extends AssignmentHolderType> DeltaSetTriple<EvaluatedAssignedResourceObjectConstructionImpl<AH>> getEvaluatedAssignedConstructionDeltaSetTriple()
-
setEvaluatedAssignedConstructionDeltaSetTriple
public <AH extends AssignmentHolderType> void setEvaluatedAssignedConstructionDeltaSetTriple(DeltaSetTriple<EvaluatedAssignedResourceObjectConstructionImpl<AH>> evaluatedAssignedConstructionDeltaSetTriple)
-
getEvaluatedPlainConstruction
public <AH extends AssignmentHolderType> PlainResourceObjectConstruction<AH> getEvaluatedPlainConstruction()
-
setEvaluatedPlainConstruction
public void setEvaluatedPlainConstruction(PlainResourceObjectConstruction<?> evaluatedPlainConstruction)
-
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
-
clearIntermediateResults
public void clearIntermediateResults()
-
getExecutableDelta
public ObjectDelta<ShadowType> getExecutableDelta() throws SchemaException
Description copied from interface:ModelProjectionContext
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(String contextDesc)
- Specified by:
checkConsistence
in classLensElementContext<ShadowType>
-
checkConsistence
public void checkConsistence(String contextDesc, boolean fresh, boolean force)
-
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>
-
adopt
public void adopt(PrismContext prismContext) throws SchemaException
- Overrides:
adopt
in classLensElementContext<ShadowType>
- Throws:
SchemaException
-
clone
public 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)
-
getCurrentShadowState
public ShadowLifecycleStateType getCurrentShadowState()
-
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>
-
determineFullShadowFlag
public void determineFullShadowFlag(PrismObject<ShadowType> loadedShadow)
Sets the full shadow flag, based on the situation (including the fetch result).
-
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>
-
getResourceName
public String getResourceName()
-
isSynchronizationSource
public boolean isSynchronizationSource()
-
setSynchronizationSource
public void setSynchronizationSource(boolean synchronizationSource)
-
getDescription
public String getDescription()
-
isCurrentForProjection
@Experimental public boolean isCurrentForProjection()
- Returns:
- True if the projection is "current" i.e. it was not completed and its wave is either not yet determined or equal to the current projection wave.
-
isCompleted
public boolean isCompleted()
-
setCompleted
public void setCompleted(boolean completed)
-
rot
public void rot()
- Overrides:
rot
in classLensElementContext<ShadowType>
-
getCachedValueMetadata
public ValueMetadataType getCachedValueMetadata()
-
setCachedValueMetadata
public void setCachedValueMetadata(ValueMetadataType cachedValueMetadata)
-
isHigherOrder
public boolean isHigherOrder()
-
isBroken
public boolean isBroken()
-
updateCoordinates
public void updateCoordinates(Task task, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Updates basic "coordinates": resource shadow discriminator, resource OID (and resource itself), and shadow OID.
-
setDoReconciliationFlagIfVolatile
public void setDoReconciliationFlagIfVolatile()
We set reconciliation:=TRUE for volatile accounts. This is to ensure that the changes on such resources will be read back to midPoint. (It is a bit of hack but it looks OK.) See also MID-2436 - volatile objects.
-
rotWithDeltaDeletion
public void rotWithDeltaDeletion()
TODO
-
isInMaintenance
public boolean isInMaintenance()
Assumes that the resource is loaded.
-
-