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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMappingImpl(AbstractMappingBuilder<V,D,MBT,?> builder)
protected
AbstractMappingImpl(AbstractMappingImpl<V,D,MBT> prototype)
-
Method Summary
-
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 Detail
-
AbstractMappingImpl
protected AbstractMappingImpl(AbstractMappingBuilder<V,D,MBT,?> builder)
-
AbstractMappingImpl
protected AbstractMappingImpl(AbstractMappingImpl<V,D,MBT> prototype)
-
-
Method Detail
-
getObjectResolver
public ObjectResolver getObjectResolver()
-
getItemName
public QName getItemName()
-
getOriginObject
public ObjectType getOriginObject()
-
getDefaultSource
public Source<?,?> getDefaultSource()
-
getSourceContext
public ObjectDeltaObject<?> getSourceContext()
-
getContextDescription
public String getContextDescription()
-
getMappingContextDescription
public String getMappingContextDescription()
-
getMappingBean
@NotNull public MBT getMappingBean()
-
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
public MappingStrengthType getStrength()
- Specified by:
getStrength
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getStrength
public static MappingStrengthType getStrength(AbstractMappingType mappingBean)
-
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
public static boolean isApplicableToChannel(AbstractMappingType mappingType, String channelUri)
-
getNow
public XMLGregorianCalendar getNow()
-
getNextRecomputeTime
public XMLGregorianCalendar getNextRecomputeTime()
-
isTimeConstraintValid
public boolean isTimeConstraintValid()
-
isProfiling
public boolean isProfiling()
-
isEnabled
public boolean isEnabled()
-
getEtime
public Long getEtime()
Description copied from interface:Mapping
Returns elapsed time in milliseconds.- Specified by:
getEtime
in interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
getMappingQName
public QName getMappingQName()
- Specified by:
getMappingQName
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
getStateProperty
public <T extends Serializable> T getStateProperty(String propertyName)
- Specified by:
getStateProperty
in interfaceMapping<V extends PrismValue,D extends ItemDefinition<?>>
-
setStateProperty
public <T extends Serializable> T setStateProperty(String propertyName, T value)
- 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
public PrismValueDeltaSetTriple<PrismPropertyValue<Boolean>> getConditionOutputTriple()
-
getOutputDefinition
public D getOutputDefinition()
-
getOutputPath
public ItemPath 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
public PrismValueDeltaSetTriple<V> 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
public Item<V,D> getOutput() throws SchemaException
- Throws:
SchemaException
-
clone
public abstract AbstractMappingImpl<V,D,MBT> clone()
Shallow clone. Only the output is cloned deeply.- Specified by:
clone
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
- Overrides:
clone
in classObject
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
getIdentifier
public String 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
public String toHumanReadableDescription()
- Specified by:
toHumanReadableDescription
in interfaceHumanReadableDescribable
-
getTask
public Task getTask()
-
getBeans
@NotNull public @NotNull ModelCommonBeans getBeans()
-
getMappingSpecification
@NotNull public @NotNull MappingSpecificationType getMappingSpecification()
-
isPushChanges
@Experimental public boolean isPushChanges()
- Specified by:
isPushChanges
in interfacePrismValueDeltaSetTripleProducer<V extends PrismValue,D extends ItemDefinition<?>>
-
-