Class AbstractMappingImpl<V extends PrismValue,D extends ItemDefinition<?>,MBT extends AbstractMappingType>
java.lang.Object
com.evolveum.midpoint.model.common.mapping.AbstractMappingImpl<V,D,MBT>
- Type Parameters:
V- type of mapping output valueD- type of mapping output value definition (property, container, ...)MBT- mapping bean type: MappingType or MetadataMappingType
- All Implemented Interfaces:
Mapping<V,,D> PrismValueDeltaSetTripleProducer<V,,D> DebugDumpable,HumanReadableDescribable,Serializable
- Direct Known Subclasses:
MappingImpl,MetadataMappingImpl
public abstract class AbstractMappingImpl<V extends PrismValue,D extends ItemDefinition<?>,MBT extends AbstractMappingType>
extends Object
implements Mapping<V,D>, DebugDumpable, PrismValueDeltaSetTripleProducer<V,D>
Evaluation of a mapping. It is non-recyclable single-use object. Once evaluated it should not be evaluated again.
It will retain its original inputs and outputs that can be read again and again. But these should not be
changed after evaluation.
TODO document evaluation of time constraints ...
Configuration properties are unmodifiable. They are to be set via Mapping.Builder.
Serializability:
The mapping is technically serializable. However, it is NOT expected to be evaluable after deserialization.
Only already computed results are to be fetched from such mapping object.
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMappingImpl(AbstractMappingBuilder<V, D, MBT, ?> builder) protectedAbstractMappingImpl(AbstractMappingImpl<V, D, MBT> prototype) -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractMappingImpl<V,D, MBT> clone()Shallow clone.protected abstract TransformationValueMetadataComputerdebugDump(int indent) protected abstract booleanbooleanvoidevaluate(Task task, OperationResult parentResult) Evaluate the mapping.voidevaluateTimeValidity(Task task, OperationResult parentResult) Evaluate the time validity.@NotNull ModelCommonBeansgetBeans()Source<?,?> getEtime()Returns elapsed time in milliseconds.@NotNull ExpressionProfileShould be called on prepared mapping.Identifier of this producer; e.g. mapping name.@NotNull MappingSpecificationTypegetNow()Null output triple means "the mapping is not applicable", e.g. due to the condition being false.<T extends Serializable>
TgetStateProperty(String propertyName) @NotNull MappingStrengthTypestatic MappingStrengthTypegetStrength(AbstractMappingType mappingBean) Returns the definition for the target item.@NotNull TaskgetTask()Available only during mapping evaluation.inthashCode()booleanbooleanstatic booleanisApplicableToChannel(AbstractMappingType mappingBean, String channelUri) booleanbooleanReturns true if the condition is at least partially satisfied, i.e. it is not "false -> false".booleanbooleanbooleanbooleanbooleanReturns true if the mapping has no source.booleanvoidprepare(OperationResult parentResult) Prepare mapping for evaluation.<T extends Serializable>
TsetStateProperty(String propertyName, T value) toString()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.model.common.mapping.PrismValueDeltaSetTripleProducer
isNormal, isStrong, isWeak
-
Constructor Details
-
AbstractMappingImpl
-
AbstractMappingImpl
-
-
Method Details
-
getObjectResolver
-
getItemName
-
getOriginObject
-
getDefaultSource
-
getContextDescription
-
getMappingContextDescription
-
getMappingBean
-
getExpressionProfile
Should be called on prepared mapping. -
isSourceless
public boolean isSourceless()Description copied from interface:PrismValueDeltaSetTripleProducerReturns true if the mapping has no source. That means it has to be evaluated for any delta. This really applies only to normal-strength mappings.- Specified by:
isSourcelessin interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getStrength
- Specified by:
getStrengthin interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getStrength
-
isAuthoritative
public boolean isAuthoritative()- Specified by:
isAuthoritativein interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
isExclusive
public boolean isExclusive()- Specified by:
isExclusivein interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
hasTargetRange
public boolean hasTargetRange() -
isApplicableToChannel
-
getNow
-
getNextRecomputeTime
-
isTimeConstraintValid
public boolean isTimeConstraintValid() -
isProfiling
public boolean isProfiling() -
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getEtime
Description copied from interface:MappingReturns elapsed time in milliseconds.- Specified by:
getEtimein interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
getTargetItemName
- Specified by:
getTargetItemNamein interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getStateProperty
- Specified by:
getStatePropertyin interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
setStateProperty
- Specified by:
setStatePropertyin interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
evaluate
public void evaluate(Task task, OperationResult parentResult) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, CommunicationException Evaluate the mapping. Can be called in UNINITIALIZED or PREPARED states only. -
evaluateTimeValidity
public void evaluateTimeValidity(Task task, OperationResult parentResult) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, CommunicationException Evaluate the time validity. Can be called in UNINITIALIZED or PREPARED states only. -
prepare
public void prepare(OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, SecurityViolationException, ConfigurationException, CommunicationException Prepare mapping for evaluation. Parse the values. After this call it can be checked if a mapping is activated (i.e. if the input changes will "trigger" the mapping). -
isActivated
public boolean isActivated() -
isConditionSatisfied
public boolean isConditionSatisfied()Description copied from interface:MappingReturns true if the condition is at least partially satisfied, i.e. it is not "false -> false". Precondition: the condition is evaluated. Otherwise aNullPointerExceptionis thrown.- Specified by:
isConditionSatisfiedin interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
getConditionOutputTriple
-
getOutputDefinition
-
getOutputPath
- Specified by:
getOutputPathin interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
createValueMetadataComputer
protected abstract TransformationValueMetadataComputer createValueMetadataComputer(OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException -
determinePushChangesRequested
protected abstract boolean determinePushChangesRequested() -
getOutputTriple
Description copied from interface:PrismValueDeltaSetTripleProducerNull output triple means "the mapping is not applicable", e.g. due to the condition being false. Empty output triple means "the mapping is applicable but there are no values".- Specified by:
getOutputTriplein interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>> - Specified by:
getOutputTriplein interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getOutput
- Throws:
SchemaException
-
clone
Shallow clone. Only the output is cloned deeply.- Specified by:
clonein interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>> - Overrides:
clonein classObject
-
hashCode
public int hashCode() -
equals
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
toString
-
getIdentifier
Description copied from interface:PrismValueDeltaSetTripleProducerIdentifier of this producer; e.g. mapping name.- Specified by:
getIdentifierin interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
toHumanReadableDescription
- Specified by:
toHumanReadableDescriptionin interfaceHumanReadableDescribable
-
getTask
Available only during mapping evaluation. -
getBeans
-
getMappingSpecification
-
getSourceNames
-
isPushChanges
- Specified by:
isPushChangesin interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getTargetItemDefinition
Description copied from interface:PrismValueDeltaSetTripleProducerReturns the definition for the target item. It is usually present, but there may be border cases where it is not. Please research them if needed.- Specified by:
getTargetItemDefinitionin interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-