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
ConstructorsModifierConstructorDescriptionprotected
AbstractMappingImpl
(AbstractMappingBuilder<V, D, MBT, ?> builder) protected
AbstractMappingImpl
(AbstractMappingImpl<V, D, MBT> prototype) -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractMappingImpl<V,
D, MBT> clone()
Shallow clone.protected abstract TransformationValueMetadataComputer
debugDump
(int indent) protected abstract boolean
boolean
void
evaluate
(Task task, OperationResult parentResult) Evaluate the mapping.void
evaluateTimeValidity
(Task task, OperationResult parentResult) Evaluate the time validity.@NotNull ModelCommonBeans
getBeans()
Source<?,
?> getEtime()
Returns elapsed time in milliseconds.@NotNull ExpressionProfile
Should be called on prepared mapping.Identifier of this producer; e.g.@NotNull MappingSpecificationType
getNow()
Null output triple means "the mapping is not applicable", e.g.<T extends Serializable>
TgetStateProperty
(String propertyName) static MappingStrengthType
getStrength
(AbstractMappingType mappingBean) @NotNull Task
getTask()
Available only during mapping evaluation.int
hashCode()
boolean
boolean
static boolean
isApplicableToChannel
(AbstractMappingType mappingBean, String channelUri) boolean
boolean
Returns true if the condition is at least partially satisfied, i.e.boolean
boolean
boolean
boolean
boolean
Returns true if the mapping has no source.boolean
void
prepare
(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, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.model.common.mapping.PrismValueDeltaSetTripleProducer
isNormal, isStrong, isWeak
-
Constructor Details
-
AbstractMappingImpl
-
AbstractMappingImpl
-
-
Method Details
-
getObjectResolver
-
getItemName
-
getOriginObject
-
getDefaultSource
-
getSourceContext
-
getContextDescription
-
getMappingContextDescription
-
getMappingBean
-
getExpressionProfile
Should be called on prepared mapping. -
isSourceless
public boolean isSourceless()Description copied from interface:PrismValueDeltaSetTripleProducer
Returns 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:
isSourceless
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-
getStrength
- Specified by:
getStrength
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-
getStrength
-
isAuthoritative
public boolean isAuthoritative()- Specified by:
isAuthoritative
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-
isExclusive
public boolean isExclusive()- Specified by:
isExclusive
in 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() -
getEtime
Description copied from interface:Mapping
Returns elapsed time in milliseconds.- Specified by:
getEtime
in interfaceMapping<V extends PrismValue,
D extends ItemDefinition<?>>
-
getMappingQName
- Specified by:
getMappingQName
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-
getStateProperty
- Specified by:
getStateProperty
in interfaceMapping<V extends PrismValue,
D extends ItemDefinition<?>>
-
setStateProperty
- Specified by:
setStateProperty
in 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:Mapping
Returns true if the condition is at least partially satisfied, i.e. it is not "false -> false". Precondition: the condition is evaluated. Otherwise aNullPointerException
is thrown.- Specified by:
isConditionSatisfied
in interfaceMapping<V extends PrismValue,
D extends ItemDefinition<?>>
-
getConditionOutputTriple
-
getOutputDefinition
-
getOutputPath
- Specified by:
getOutputPath
in 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:PrismValueDeltaSetTripleProducer
Null 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:
getOutputTriple
in interfaceMapping<V extends PrismValue,
D extends ItemDefinition<?>> - Specified by:
getOutputTriple
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-
getOutput
- Throws:
SchemaException
-
clone
Shallow clone. Only the output is cloned deeply.- Specified by:
clone
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>> - Overrides:
clone
in classObject
-
hashCode
public int hashCode() -
equals
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
toString
-
getIdentifier
Description copied from interface:PrismValueDeltaSetTripleProducer
Identifier of this producer; e.g. mapping name.- Specified by:
getIdentifier
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-
toHumanReadableDescription
- Specified by:
toHumanReadableDescription
in interfaceHumanReadableDescribable
-
getTask
Available only during mapping evaluation. -
getBeans
-
getMappingSpecification
-
getSourceNames
-
isPushChanges
- Specified by:
isPushChanges
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,
D extends ItemDefinition<?>>
-