public final class DittoProtocolAdapter extends Object implements ProtocolAdapter
| Modifier | Constructor and Description |
|---|---|
protected |
DittoProtocolAdapter(org.eclipse.ditto.signals.base.ErrorRegistry<org.eclipse.ditto.model.base.exceptions.DittoRuntimeException> errorRegistry,
HeaderTranslator headerTranslator) |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.ditto.signals.base.Signal<?> |
fromAdaptable(Adaptable adaptable)
Maps the given
adaptable to the corresponding Signal, which can be a Command,
CommandResponse or an Event. |
static HeaderTranslator |
getHeaderTranslator()
Creates a default header translator for this protocol adapter.
|
HeaderTranslator |
headerTranslator()
Retrieve the header translator responsible for this protocol adapter.
|
static DittoProtocolAdapter |
newInstance()
Creates a new
DittoProtocolAdapter instance. |
static DittoProtocolAdapter |
of(HeaderTranslator headerTranslator)
Creates a new
DittoProtocolAdapter instance with the given header translator. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.base.Command<?> command)
Maps the given
command to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.base.Command<?> command,
TopicPath.Channel channel)
Maps the given
command to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.base.CommandResponse<?> commandResponse)
Maps the given
CommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.base.CommandResponse<?> commandResponse,
TopicPath.Channel channel)
Maps the given
CommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.events.base.Event<?> event)
Maps the given
event to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.events.base.Event<?> event,
TopicPath.Channel channel)
Maps the given
event to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.messages.MessageCommand<?,?> messageCommand)
Maps the given
messageCommand to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.messages.MessageCommandResponse<?,?> messageCommandResponse)
Maps the given
messageCommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.base.Signal<?> signal)
Maps the given
Signal to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.ThingCommandResponse<?> thingCommandResponse)
Maps the given
ThingCommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.ThingCommandResponse<?> thingCommandResponse,
TopicPath.Channel channel)
Maps the given
ThingCommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.ThingErrorResponse thingErrorResponse,
TopicPath.Channel channel)
Maps the given
thingErrorResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.events.things.ThingEvent<?> thingEvent)
Maps the given
thingEvent to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.events.things.ThingEvent<?> thingEvent,
TopicPath.Channel channel)
Maps the given
thingEvent to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommand<?> thingModifyCommand)
Maps the given
thingModifyCommand to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommand<?> thingModifyCommand,
TopicPath.Channel channel)
Maps the given
thingModifyCommand to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommandResponse<?> thingModifyCommandResponse)
Maps the given
thingModifyCommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommandResponse<?> thingModifyCommandResponse,
TopicPath.Channel channel)
Maps the given
thingModifyCommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommand<?> thingQueryCommand)
Maps the given
thingQueryCommand to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommand<?> thingQueryCommand,
TopicPath.Channel channel)
Maps the given
thingQueryCommand to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommandResponse<?> thingQueryCommandResponse)
Maps the given
thingQueryCommandResponse to an Adaptable. |
Adaptable |
toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommandResponse<?> thingQueryCommandResponse,
TopicPath.Channel channel)
Maps the given
thingQueryCommandResponse to an Adaptable. |
protected DittoProtocolAdapter(org.eclipse.ditto.signals.base.ErrorRegistry<org.eclipse.ditto.model.base.exceptions.DittoRuntimeException> errorRegistry,
HeaderTranslator headerTranslator)
public static DittoProtocolAdapter of(HeaderTranslator headerTranslator)
DittoProtocolAdapter instance with the given header translator.headerTranslator - translator between external and Ditto headers.public static DittoProtocolAdapter newInstance()
DittoProtocolAdapter instance.public static HeaderTranslator getHeaderTranslator()
public org.eclipse.ditto.signals.base.Signal<?> fromAdaptable(Adaptable adaptable)
ProtocolAdapteradaptable to the corresponding Signal, which can be a Command,
CommandResponse or an Event.fromAdaptable in interface ProtocolAdapteradaptable - the adaptable.public Adaptable toAdaptable(org.eclipse.ditto.signals.base.Signal<?> signal)
ProtocolAdapterSignal to an Adaptable.toAdaptable in interface ProtocolAdaptersignal - the signal.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.base.CommandResponse<?> commandResponse)
ProtocolAdapterCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdaptercommandResponse - the response.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.base.CommandResponse<?> commandResponse, TopicPath.Channel channel)
ProtocolAdapterCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdaptercommandResponse - the response.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.ThingCommandResponse<?> thingCommandResponse)
ProtocolAdapterThingCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingCommandResponse - the response.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.ThingCommandResponse<?> thingCommandResponse, TopicPath.Channel channel)
ProtocolAdapterThingCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingCommandResponse - the response.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.messages.MessageCommand<?,?> messageCommand)
ProtocolAdaptermessageCommand to an Adaptable.toAdaptable in interface ProtocolAdaptermessageCommand - the messageCommand.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.messages.MessageCommandResponse<?,?> messageCommandResponse)
ProtocolAdaptermessageCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdaptermessageCommandResponse - the messageCommandResponse.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.base.Command<?> command)
ProtocolAdaptercommand to an Adaptable.toAdaptable in interface ProtocolAdaptercommand - the command.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.base.Command<?> command, TopicPath.Channel channel)
ProtocolAdaptercommand to an Adaptable.toAdaptable in interface ProtocolAdaptercommand - the command.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommand<?> thingModifyCommand)
ProtocolAdapterthingModifyCommand to an Adaptable.toAdaptable in interface ProtocolAdapterthingModifyCommand - the command.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommand<?> thingModifyCommand, TopicPath.Channel channel)
ProtocolAdapterthingModifyCommand to an Adaptable.toAdaptable in interface ProtocolAdapterthingModifyCommand - the command.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommandResponse<?> thingModifyCommandResponse)
ProtocolAdapterthingModifyCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingModifyCommandResponse - the response.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.modify.ThingModifyCommandResponse<?> thingModifyCommandResponse, TopicPath.Channel channel)
ProtocolAdapterthingModifyCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingModifyCommandResponse - the response.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommand<?> thingQueryCommand)
ProtocolAdapterthingQueryCommand to an Adaptable.toAdaptable in interface ProtocolAdapterthingQueryCommand - the command.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommand<?> thingQueryCommand, TopicPath.Channel channel)
ProtocolAdapterthingQueryCommand to an Adaptable.toAdaptable in interface ProtocolAdapterthingQueryCommand - the command.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommandResponse<?> thingQueryCommandResponse)
ProtocolAdapterthingQueryCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingQueryCommandResponse - the response.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.query.ThingQueryCommandResponse<?> thingQueryCommandResponse, TopicPath.Channel channel)
ProtocolAdapterthingQueryCommandResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingQueryCommandResponse - the response.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.commands.things.ThingErrorResponse thingErrorResponse, TopicPath.Channel channel)
ProtocolAdapterthingErrorResponse to an Adaptable.toAdaptable in interface ProtocolAdapterthingErrorResponse - the error response.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.events.base.Event<?> event)
ProtocolAdapterevent to an Adaptable.toAdaptable in interface ProtocolAdapterevent - the event.public Adaptable toAdaptable(org.eclipse.ditto.signals.events.base.Event<?> event, TopicPath.Channel channel)
ProtocolAdapterevent to an Adaptable.toAdaptable in interface ProtocolAdapterevent - the event.channel - the Channel (Twin/Live) to use.public Adaptable toAdaptable(org.eclipse.ditto.signals.events.things.ThingEvent<?> thingEvent)
ProtocolAdapterthingEvent to an Adaptable.toAdaptable in interface ProtocolAdapterthingEvent - the event.public Adaptable toAdaptable(org.eclipse.ditto.signals.events.things.ThingEvent<?> thingEvent, TopicPath.Channel channel)
ProtocolAdapterthingEvent to an Adaptable.toAdaptable in interface ProtocolAdapterthingEvent - the event.channel - the Channel (Twin/Live) to use.public HeaderTranslator headerTranslator()
ProtocolAdapterheaderTranslator in interface ProtocolAdapterCopyright © 2017–2019 Eclipse Foundation. All rights reserved.