public class DefaultOperationsChannel extends Object implements KaaDataChannel, RawDataProcessor
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
DefaultOperationsChannel(AbstractKaaClient client,
KaaClientState state) |
Modifier and Type | Method and Description |
---|---|
protected ScheduledExecutorService |
createExecutor() |
LinkedHashMap<String,byte[]> |
createRequest(Map<org.kaaproject.kaa.common.TransportType,ChannelDirection> types) |
String |
getId()
Retrieves the channel's id.
|
ServerType |
getServerType()
Retrieves the channel's server type (i.e.
|
Map<org.kaaproject.kaa.common.TransportType,ChannelDirection> |
getSupportedTransportTypes()
Retrieves the map of transport types and their directions supported by this channel.
|
org.kaaproject.kaa.common.bootstrap.gen.ChannelType |
getType()
Retrieves the channel's type (i.e.
|
void |
onResponse(byte[] response) |
void |
onServerError(ServerInfo info) |
void |
pause()
Pauses the channel's workflow.
|
void |
resume()
Resumes the channel's workflow.
|
void |
setConnectivityChecker(ConnectivityChecker checker)
Sets connectivity checker to the current channel.
|
void |
setDemultiplexer(KaaDataDemultiplexer demultiplexer)
Sets the response demultiplexer for this channel.
|
void |
setMultiplexer(KaaDataMultiplexer multiplexer)
Sets the request multiplexer for this channel.
|
void |
setServer(ServerInfo server)
Sets the server's parameters for the current channel.
|
void |
shutdown()
Shuts down the channel instance.
|
void |
sync(org.kaaproject.kaa.common.TransportType type)
Updates the channel's state of the specific service.
|
void |
syncAck(org.kaaproject.kaa.common.TransportType type)
Notifies channel about successful acknowledgment of the sync only in case of smth change.
|
void |
syncAll()
Updates the channel's state of all supported services.
|
public DefaultOperationsChannel(AbstractKaaClient client, KaaClientState state)
protected ScheduledExecutorService createExecutor()
public LinkedHashMap<String,byte[]> createRequest(Map<org.kaaproject.kaa.common.TransportType,ChannelDirection> types)
createRequest
in interface RawDataProcessor
public void onResponse(byte[] response)
onResponse
in interface RawDataProcessor
public void onServerError(ServerInfo info)
onServerError
in interface RawDataProcessor
public void sync(org.kaaproject.kaa.common.TransportType type)
KaaDataChannel
sync
in interface KaaDataChannel
type
- transport type of the service.TransportType
public void syncAll()
KaaDataChannel
syncAll
in interface KaaDataChannel
public void syncAck(org.kaaproject.kaa.common.TransportType type)
KaaDataChannel
syncAck
in interface KaaDataChannel
type
- transport type of the service.TransportType
public String getId()
KaaDataChannel
getId
in interface KaaDataChannel
public org.kaaproject.kaa.common.bootstrap.gen.ChannelType getType()
KaaDataChannel
getType
in interface KaaDataChannel
ChannelType
public ServerType getServerType()
KaaDataChannel
getServerType
in interface KaaDataChannel
ServerType
public void setDemultiplexer(KaaDataDemultiplexer demultiplexer)
KaaDataChannel
setDemultiplexer
in interface KaaDataChannel
demultiplexer
- demultiplexer instance to be set.KaaDataDemultiplexer
public void setMultiplexer(KaaDataMultiplexer multiplexer)
KaaDataChannel
setMultiplexer
in interface KaaDataChannel
multiplexer
- multiplexer instance to be set.KaaDataMultiplexer
public void setServer(ServerInfo server)
KaaDataChannel
setServer
in interface KaaDataChannel
server
- server's parameters.ServerInfo
public void setConnectivityChecker(ConnectivityChecker checker)
KaaDataChannel
setConnectivityChecker
in interface KaaDataChannel
checker
- platform-dependent connectivity checker.ConnectivityChecker
public void shutdown()
KaaDataChannel
shutdown
in interface KaaDataChannel
public void pause()
KaaDataChannel
pause
in interface KaaDataChannel
public void resume()
KaaDataChannel
resume
in interface KaaDataChannel
public Map<org.kaaproject.kaa.common.TransportType,ChannelDirection> getSupportedTransportTypes()
KaaDataChannel
getSupportedTransportTypes
in interface KaaDataChannel
TransportType
,
ChannelDirection
Copyright © 2014. All rights reserved.