use of io.joynr.messaging.info.BounceProxyStatusInformation in project joynr by bmwcarit.
the class BounceProxyEhcacheAdapterTest method testUpdateChannelAssignmentForAlreadyAssignedChannel.
@Test
public void testUpdateChannelAssignmentForAlreadyAssignedChannel() {
ControlledBounceProxyInformation bpInfo1 = new ControlledBounceProxyInformation("bp1.0", URI.create("http://www.joynr1.de/bp1/"));
cache.addBounceProxy(bpInfo1);
cache.updateChannelAssignment("channel-123", bpInfo1);
List<BounceProxyStatusInformation> assignableBounceProxies = cache.getBounceProxyStatusInformation();
assertEquals(1, assignableBounceProxies.size());
BounceProxyRecord bpRecord1 = cache.getBounceProxy("bp1.0");
assertEquals("bp1.0", bpRecord1.getBounceProxyId());
assertEquals(1, bpRecord1.getNumberOfAssignedChannels());
cache.updateChannelAssignment("channel-123", bpInfo1);
bpRecord1 = cache.getBounceProxy("bp1.0");
assertEquals("bp1.0", bpRecord1.getBounceProxyId());
assertEquals(1, bpRecord1.getNumberOfAssignedChannels());
}
use of io.joynr.messaging.info.BounceProxyStatusInformation in project joynr by bmwcarit.
the class BounceProxyEhcacheAdapter method getBounceProxyStatusInformation.
@Override
public List<BounceProxyStatusInformation> getBounceProxyStatusInformation() {
if (log.isTraceEnabled()) {
log.trace("getBounceProxyStatusInformation from cache {}", cacheName);
tracePeers();
}
List<BounceProxyStatusInformation> result = new LinkedList<BounceProxyStatusInformation>();
Cache cache = manager.getCache(cacheName);
@SuppressWarnings("rawtypes") List keys = cache.getKeys();
Map<Object, Element> elements = cache.getAll(keys);
for (Element element : elements.values()) {
result.add(getBounceProxyRecordFromElement(element));
}
return result;
}
Aggregations