@Immutable public final class DefaultMessageMapperFactory extends Object implements MessageMapperFactory
MessageMapper objects.
As the message mapper instantiation is usually triggered by an actor, there are only limited possibilities of logging fine grained errors and at the same time keep all responsibility for mapper instantiation behavior away of the actor.
Due to this, the factory can be instantiated with a reference to the actors log adapter and will log problems to the debug and warning level (no info and error). Setting a log adapter does not change factory behaviour!
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
hashCode() |
Optional<MessageMapper> |
mapperOf(String mapperId,
org.eclipse.ditto.model.connectivity.MappingContext mappingContext)
Creates an configures a
MessageMapper instance of
the given context. |
static DefaultMessageMapperFactory |
of(org.eclipse.ditto.model.connectivity.ConnectionId connectionId,
akka.actor.ActorSystem actorSystem,
MappingConfig mappingConfig,
akka.event.LoggingAdapter log)
Creates a new factory and returns the instance
|
MessageMapperRegistry |
registryOf(org.eclipse.ditto.model.connectivity.MappingContext defaultContext,
org.eclipse.ditto.model.connectivity.PayloadMappingDefinition payloadMappingDefinition)
Creates a
MessageMapperRegistry. |
public static DefaultMessageMapperFactory of(org.eclipse.ditto.model.connectivity.ConnectionId connectionId, akka.actor.ActorSystem actorSystem, MappingConfig mappingConfig, akka.event.LoggingAdapter log)
connectionId - ID of the connection.actorSystem - the actor system to use for mapping config + dynamicAccess.mappingConfig - the configuration of the mapping behaviour.log - the log adapter used for debug and warning logs.NullPointerException - if any argument is null.public Optional<MessageMapper> mapperOf(String mapperId, org.eclipse.ditto.model.connectivity.MappingContext mappingContext)
MessageMapperFactoryMessageMapper instance of
the given context. It is possible, that there is no mapper available for a specific context.mapperOf in interface MessageMapperFactorymapperId - the id of this mappermappingContext - the mapping context containing the type and configuration of the mapperpublic MessageMapperRegistry registryOf(org.eclipse.ditto.model.connectivity.MappingContext defaultContext, org.eclipse.ditto.model.connectivity.PayloadMappingDefinition payloadMappingDefinition)
MessageMapperFactoryMessageMapperRegistry. Mappers that are not available will not be added to the registry.registryOf in interface MessageMapperFactorydefaultContext - the context used to instantiate the default mapperpayloadMappingDefinition - the mapping definitions used to instantiate the registry mapperCopyright © 2017–2019 Eclipse Foundation. All rights reserved.