public class DefaultChannelManager extends Object implements KaaChannelManager, PingServerStorage
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.
|
KaaDataChannel |
getChannel(String id)
Retrieves channel by the unique channel id.
|
KaaDataChannel |
getChannelByTransportType(org.kaaproject.kaa.common.TransportType type)
Retrieves a list of channels by the specific transport type.
|
List<KaaDataChannel> |
getChannels()
Retrieves the list of current channels.
|
IPTransportInfo |
getCurrentPingServer() |
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 |
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 |
shutdown()
Shuts down the manager and all registered channels.
|
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 KaaDataChannel getChannelByTransportType(org.kaaproject.kaa.common.TransportType type)
KaaChannelManager
getChannelByTransportType
in interface KaaChannelManager
type
- the transport's type.TransportType
,
KaaDataChannel
public KaaDataChannel getChannel(String id)
KaaChannelManager
getChannel
in interface KaaChannelManager
id
- the channel's id.KaaDataChannel
public void onTransportConnectionInfoUpdated(TransportConnectionInfo newServer)
KaaChannelManager
onTransportConnectionInfoUpdated
in interface KaaChannelManager
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)
KaaChannelManager
setConnectivityChecker
in interface KaaChannelManager
checker
- platform-dependent connectivity checker.ConnectivityChecker
public IPTransportInfo getCurrentPingServer()
getCurrentPingServer
in interface PingServerStorage
public void shutdown()
KaaChannelManager
shutdown
in interface KaaChannelManager
public void pause()
KaaChannelManager
pause
in interface KaaChannelManager
public void resume()
KaaChannelManager
resume
in interface KaaChannelManager
Copyright © 2015. All rights reserved.