public interface KaaChannelManager
class SpecificDataChannel implements KaaDataChannel {...}
...
SpecificDataChannel dataChannel1 = new SpecificDataChannel();
kaaClient.getChannelManager().addChannel(dataChannel1);
The code above registers new data channel in the KaaChannelManager instance.
This channel will be used by each transport abstraction which is supported by
this channel (See KaaDataChannel.getSupportedTransportTypes()
).TransportType
for data transferring. For example, if there are two
KaaDataChannel
implementations ChannelA and ChannelB
such as: ChannelDirection.BIDIRECTIONAL
)
for transport types [TransportType.EVENT
,
TransportType.LOGGING
];ChannelDirection.UP
) for [
TransportType.EVENT
].addChannel(KaaDataChannel)
in the following
order: { @code ChannelA channelA = new ChannelA(); ChannelB channelB = new ChannelB(); kaaClient.getChannelManager().addChannel(channelA); kaaClient.getChannelManager().addChannel(channelB); }then ChannelA instance will be used to receive
TransportType.EVENT
and TransportType.LOGGING
data, but to
transmit only TransportType.LOGGING
data. For
TransportType.EVENT
data transmission will be used ChannelB
instance.removeChannel(KaaDataChannel)
DefaultBootstrapChannel
, DefaultOperationsChannel
and
DefaultOperationHttpChannel
(in given order).removeChannel(KaaDataChannel)
forces KaaChannelManager to
remove given channel and reset TransportType-to-Channel internal mapping with
applicable channel if such exists.clearChannelList()
removes all existing channels.onServerFailed(TransportConnectionInfo)
to switch to another
available server.KaaDataChannel
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 |
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 |
setChannel(org.kaaproject.kaa.common.TransportType transport,
KaaDataChannel channel)
Updates the manager by setting the channel to the specified
TransportType . |
void |
setFailoverManager(FailoverManager failoverManager)
Sets a new failover manager
|
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
|
void setChannel(org.kaaproject.kaa.common.TransportType transport, KaaDataChannel channel) throws KaaInvalidChannelException
TransportType
.transport
- the type of the transport which is going to receive updates
using the specified channel.channel
- the channel to be added.KaaInvalidChannelException
KaaDataChannel
void addChannel(KaaDataChannel channel)
channel
- the channel to be added.KaaDataChannel
void removeChannel(KaaDataChannel channel)
channel
- the channel to be removed.KaaDataChannel
void removeChannel(String id)
id
- the channel's id.KaaDataChannel
List<KaaDataChannel> getChannels()
KaaDataChannel
KaaDataChannel getChannel(String id)
id
- the channel's id.KaaDataChannel
void onServerFailed(TransportConnectionInfo server)
server
- the parameters of server that was not connected.TransportConnectionInfo
void clearChannelList()
void sync(org.kaaproject.kaa.common.TransportType type)
type
- void syncAck(org.kaaproject.kaa.common.TransportType type)
type
- void syncAll(org.kaaproject.kaa.common.TransportType type)
type
- - type that is used to identify active channelTransportConnectionInfo getActiveServer(org.kaaproject.kaa.common.TransportType type)
TransportType
type
- - type that is used to identify active channelvoid setFailoverManager(FailoverManager failoverManager)
failoverManager
- the failover managerCopyright © 2015. All rights reserved.