public class DefaultChannelManager extends Object implements KaaInternalChannelManager
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
DefaultChannelManager(BootstrapManager manager,
Map<TransportProtocolId,List<TransportConnectionInfo>> bootststrapServers) |
Modifier and Type | Method and Description |
---|---|
void |
addChannel(KaaDataChannel channel)
Updates the manager by adding the channel.
|
void |
clearChannelList()
Clears the list of channels.
|
TransportConnectionInfo |
getActiveServer(org.kaaproject.kaa.common.TransportType type)
Returns information about server that is used for data transfer for specified
TransportType |
KaaDataChannel |
getChannel(String id)
Retrieves channel by the unique channel id.
|
List<KaaDataChannel> |
getChannels()
Retrieves the list of current channels.
|
void |
onServerFailed(TransportConnectionInfo server)
Reports to Channel Manager in case link with server was not established.
|
void |
onTransportConnectionInfoUpdated(TransportConnectionInfo newServer)
Reports to Channel Manager about the new server.
|
void |
pause()
Pauses all active channels.
|
void |
removeChannel(KaaDataChannel channel)
Updates the manager by removing the channel from the manager.
|
void |
removeChannel(String id)
Updates the manager by removing the channel from the manager.
|
void |
resume()
Restores channels' activity.
|
void |
setBootstrapDemultiplexer(KaaDataDemultiplexer demultiplexer) |
void |
setBootstrapMultiplexer(KaaDataMultiplexer multiplexer) |
void |
setChannel(org.kaaproject.kaa.common.TransportType transport,
KaaDataChannel channel)
Updates the manager by setting the channel to the specified
TransportType . |
void |
setConnectivityChecker(ConnectivityChecker checker)
Sets connectivity checker to the existing channels.
|
void |
setOperationDemultiplexer(KaaDataDemultiplexer demultiplexer) |
void |
setOperationMultiplexer(KaaDataMultiplexer multiplexer) |
void |
shutdown()
Shuts down the manager and all registered channels.
|
void |
sync(org.kaaproject.kaa.common.TransportType type)
Invoke sync on active channel by specified transport type
|
void |
syncAck(org.kaaproject.kaa.common.TransportType type)
Invoke sync acknowledgement on active channel by specified transport type
|
void |
syncAll(org.kaaproject.kaa.common.TransportType type)
Invoke sync acknowledgement on active channel
|
public DefaultChannelManager(BootstrapManager manager, Map<TransportProtocolId,List<TransportConnectionInfo>> bootststrapServers)
public void setChannel(org.kaaproject.kaa.common.TransportType transport, KaaDataChannel channel) throws KaaInvalidChannelException
KaaChannelManager
TransportType
.setChannel
in interface KaaChannelManager
transport
- the type of the transport which is going to receive updates
using the specified channel.channel
- the channel to be added.KaaInvalidChannelException
KaaDataChannel
public void addChannel(KaaDataChannel channel)
KaaChannelManager
addChannel
in interface KaaChannelManager
channel
- the channel to be added.KaaDataChannel
public void removeChannel(KaaDataChannel channel)
KaaChannelManager
removeChannel
in interface KaaChannelManager
channel
- the channel to be removed.KaaDataChannel
public void removeChannel(String id)
KaaChannelManager
removeChannel
in interface KaaChannelManager
id
- the channel's id.KaaDataChannel
public List<KaaDataChannel> getChannels()
KaaChannelManager
getChannels
in interface KaaChannelManager
KaaDataChannel
public TransportConnectionInfo getActiveServer(org.kaaproject.kaa.common.TransportType type)
KaaChannelManager
TransportType
getActiveServer
in interface KaaChannelManager
type
- - type that is used to identify active channelpublic void sync(org.kaaproject.kaa.common.TransportType type)
KaaChannelManager
sync
in interface KaaChannelManager
public void syncAck(org.kaaproject.kaa.common.TransportType type)
KaaChannelManager
syncAck
in interface KaaChannelManager
public void syncAll(org.kaaproject.kaa.common.TransportType type)
KaaChannelManager
syncAll
in interface KaaChannelManager
type
- - type that is used to identify active channelpublic KaaDataChannel getChannel(String id)
KaaChannelManager
getChannel
in interface KaaChannelManager
id
- the channel's id.KaaDataChannel
public void onTransportConnectionInfoUpdated(TransportConnectionInfo newServer)
KaaInternalChannelManager
onTransportConnectionInfoUpdated
in interface KaaInternalChannelManager
newServer
- the parameters of the new server.TransportConnectionInfo
public void onServerFailed(TransportConnectionInfo server)
KaaChannelManager
onServerFailed
in interface KaaChannelManager
server
- the parameters of server that was not connected.TransportConnectionInfo
public void clearChannelList()
KaaChannelManager
clearChannelList
in interface KaaChannelManager
public void setConnectivityChecker(ConnectivityChecker checker)
KaaInternalChannelManager
setConnectivityChecker
in interface KaaInternalChannelManager
checker
- platform-dependent connectivity checker.ConnectivityChecker
public void shutdown()
KaaInternalChannelManager
shutdown
in interface KaaInternalChannelManager
public void pause()
KaaInternalChannelManager
pause
in interface KaaInternalChannelManager
public void resume()
KaaInternalChannelManager
resume
in interface KaaInternalChannelManager
public void setOperationMultiplexer(KaaDataMultiplexer multiplexer)
setOperationMultiplexer
in interface KaaInternalChannelManager
public void setOperationDemultiplexer(KaaDataDemultiplexer demultiplexer)
setOperationDemultiplexer
in interface KaaInternalChannelManager
public void setBootstrapMultiplexer(KaaDataMultiplexer multiplexer)
setBootstrapMultiplexer
in interface KaaInternalChannelManager
public void setBootstrapDemultiplexer(KaaDataDemultiplexer demultiplexer)
setBootstrapDemultiplexer
in interface KaaInternalChannelManager
Copyright © 2015. All rights reserved.