public interface MessageMapper
ExternalMessage to a Adaptable and vice versa.
Usually a mapper is bound to a content type.
A message mapper is considered to be dynamically instantiated at runtime, it therefore can only be configured at runtime.| Modifier and Type | Method and Description |
|---|---|
void |
configure(MappingConfig mappingConfig,
MessageMapperConfiguration configuration)
Applies configuration for this MessageMapper.
|
static Optional<String> |
findContentType(org.eclipse.ditto.protocoladapter.Adaptable adaptable)
Finds the content-type header from the passed Adaptable.
|
static Optional<String> |
findContentType(ExternalMessage externalMessage)
Finds the content-type header from the passed ExternalMessage.
|
Collection<String> |
getContentTypeBlacklist()
Returns a blacklist of content-types which shall not be handled by this message mapper.
|
default Map<String,String> |
getDefaultOptions() |
String |
getId()
Returns a unique ID of this mapper that can be used in sources and targets to reference this mapper.
|
List<ExternalMessage> |
map(org.eclipse.ditto.protocoladapter.Adaptable adaptable)
Maps an
Adaptable to an ExternalMessage |
List<org.eclipse.ditto.protocoladapter.Adaptable> |
map(ExternalMessage message)
Maps an
ExternalMessage to an Adaptable |
String getId()
Collection<String> getContentTypeBlacklist()
MessageMapperConfiguration in
configure(MappingConfig, MessageMapperConfiguration).void configure(MappingConfig mappingConfig, MessageMapperConfiguration configuration)
mappingConfig - the config scoped to the mapping section "ditto.connectivity.mapping".configuration - the configuration to apply.org.eclipse.ditto.model.connectivity.MessageMapperConfigurationInvalidException - if configuration is invalid.org.eclipse.ditto.model.connectivity.MessageMapperConfigurationFailedException - if the configuration
failed for a mapper specific reason.List<org.eclipse.ditto.protocoladapter.Adaptable> map(ExternalMessage message)
ExternalMessage to an Adaptablemessage - the ExternalMessage to maporg.eclipse.ditto.model.connectivity.MessageMappingFailedException - if the given message can not be mappedorg.eclipse.ditto.model.base.exceptions.DittoRuntimeException - if anything during Ditto Adaptable creation
went wrongList<ExternalMessage> map(org.eclipse.ditto.protocoladapter.Adaptable adaptable)
Adaptable to an ExternalMessageadaptable - the Adaptable to maporg.eclipse.ditto.model.connectivity.MessageMappingFailedException - if the given adaptable can not be mappeddefault Map<String,String> getDefaultOptions()
static Optional<String> findContentType(ExternalMessage externalMessage)
externalMessage - the ExternalMessage to look for the content-type header inCopyright © 2017–2019 Eclipse Foundation. All rights reserved.