use of io.joynr.messaging.info.ChannelInformation in project joynr by bmwcarit.
the class LongPollingMessagingDelegate method listChannels.
/**
* Gets a list of all channel information.
*
* @return list of all channel informations
*/
public List<ChannelInformation> listChannels() {
LinkedList<ChannelInformation> entries = new LinkedList<ChannelInformation>();
Collection<Broadcaster> broadcasters = BroadcasterFactory.getDefault().lookupAll();
String name;
for (Broadcaster broadcaster : broadcasters) {
if (broadcaster instanceof BounceProxyBroadcaster) {
name = ((BounceProxyBroadcaster) broadcaster).getName();
} else {
name = broadcaster.getClass().getSimpleName();
}
Integer cachedSize = null;
entries.add(new ChannelInformation(name, broadcaster.getAtmosphereResources().size(), cachedSize));
}
return entries;
}
use of io.joynr.messaging.info.ChannelInformation in project joynr by bmwcarit.
the class ChannelServiceImpl method listChannels.
/*
* (non-Javadoc)
*
* @see io.joynr.messaging.service.ChannelServiceDelegate#listChannels()
*/
@Override
public List<ChannelInformation> listChannels() {
List<Channel> channels = channelDirectory.getChannels();
List<ChannelInformation> channelInformationList = new LinkedList<ChannelInformation>();
for (Channel channel : channels) {
ChannelInformation channelInfo = new ChannelInformation(channel.getChannelId(), 0, 0);
channelInformationList.add(channelInfo);
}
return channelInformationList;
}
Aggregations