use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class BounceProxyDatabase method getAssignableBounceProxies.
@Override
public List<BounceProxyRecord> getAssignableBounceProxies() {
logger.trace("getAssignableBounceProxies()");
List<BounceProxyRecord> bounceProxyList = new LinkedList<BounceProxyRecord>();
for (BounceProxyEntity entity : getBounceProxyEntityList(getSqlWhereClauseForAssignableBounceProxies())) {
bounceProxyList.add(entity.convertToBounceProxyRecord());
}
logger.debug("found {} assignable bounce proxies", bounceProxyList.size());
return bounceProxyList;
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class BounceProxyEhcacheAdapter method getAssignableBounceProxies.
@Override
public List<BounceProxyRecord> getAssignableBounceProxies() {
if (log.isTraceEnabled()) {
log.trace("Retrieving assignable bounce proxies from cache {}", cacheName);
tracePeers();
}
List<BounceProxyRecord> result = new LinkedList<BounceProxyRecord>();
Cache cache = manager.getCache(cacheName);
@SuppressWarnings("rawtypes") List keys = cache.getKeys();
Map<Object, Element> elements = cache.getAll(keys);
for (Element element : elements.values()) {
BounceProxyRecord bounceProxyRecord = getBounceProxyRecordFromElement(element);
if (bounceProxyRecord.getStatus().isAssignable()) {
result.add(bounceProxyRecord);
}
}
return result;
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class BounceProxyEhcacheAdapter method addBounceProxy.
@Override
public void addBounceProxy(ControlledBounceProxyInformation bpInfo) throws IllegalArgumentException {
if (log.isTraceEnabled()) {
log.trace("addBounceProxy {} to cache {}", bpInfo.getId(), cacheName);
tracePeers();
}
Cache cache = manager.getCache(cacheName);
Element element = new Element(bpInfo.getId(), new BounceProxyRecord(bpInfo));
cache.put(element);
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class MonitoringServiceImpl method updateStatus.
@Override
public void updateStatus(String bpId, BounceProxyStatus status) {
BounceProxyRecord bounceProxyRecord = bounceProxyDirectory.getBounceProxy(bpId);
bounceProxyRecord.setStatus(status);
bounceProxyDirectory.updateBounceProxy(bounceProxyRecord);
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class MonitoringServiceImpl method update.
@Override
public void update(String bpId, String urlForCc, String urlForBpc) {
BounceProxyRecord bounceProxyRecord = bounceProxyDirectory.getBounceProxy(bpId);
bounceProxyRecord.getInfo().setLocation(URI.create(urlForCc));
bounceProxyRecord.getInfo().setLocationForBpc(URI.create(urlForBpc));
bounceProxyRecord.setStatus(BounceProxyStatus.ALIVE);
bounceProxyDirectory.updateBounceProxy(bounceProxyRecord);
}
Aggregations