/** * Find the ObservingEndpoint for the specified endpoint address or create * a new one if none exists yet. Does not return null. * * @param address the address * @return the ObservingEndpoint for the address */ public ObservingEndpoint findObservingEndpoint(InetSocketAddress address) { ObservingEndpoint ep = endpoints.get(address); if (ep == null) ep = createObservingEndpoint(address); return ep; }
public ObserveRelation getRelation(InetSocketAddress source, byte[] token) { ObservingEndpoint remote = getObservingEndpoint(source); if (remote!=null) { return remote.getObserveRelation(token); } else { return null; } }
final ObservingEndpoint remote = observeManager.findObservingEndpoint(source); final ObserveRelation relation = new ObserveRelation(remote, resource, exchange); remote.addObserveRelation(relation); final ObserveRelation relation = observeManager.getRelation(source, request.getToken()); if (relation != null) { relation.cancel();
"Initiate an observe relation between {0}:{1} and resource {2}", new Object[]{request.getSource(), request.getSourcePort(), resource.getURI()}); ObservingEndpoint remote = observeManager.findObservingEndpoint(source); ObserveRelation relation = new ObserveRelation(remote, resource, exchange); remote.addObserveRelation(relation); ObserveRelation relation = observeManager.getRelation(source, request.getToken()); if (relation != null) { relation.cancel();
ObservingEndpoint remote = observeManager.findObservingEndpoint(source); ObserveRelation relation = new ObserveRelation(remote, resource, exchange); remote.addObserveRelation(relation); ObserveRelation relation = observeManager.getRelation(source, request.getToken()); if (relation!=null) relation.cancel();
public ObserveRelation getRelation(InetSocketAddress source, byte[] token) { ObservingEndpoint remote = getObservingEndpoint(source); if (remote!=null) { return remote.getObserveRelation(token); } else { return null; } }
/** * Find the ObservingEndpoint for the specified endpoint address or create * a new one if none exists yet. Does not return null. * * @param address the address * @return the ObservingEndpoint for the address */ public ObservingEndpoint findObservingEndpoint(InetSocketAddress address) { ObservingEndpoint ep = endpoints.get(address); if (ep == null) ep = createObservingEndpoint(address); return ep; }
final ObservingEndpoint remote = observeManager.findObservingEndpoint(source); final ObserveRelation relation = new ObserveRelation(remote, resource, exchange); remote.addObserveRelation(relation); final ObserveRelation relation = observeManager.getRelation(source, request.getToken()); if (relation != null) { relation.cancel();
"Initiate an observe relation between {0}:{1} and resource {2}", new Object[]{request.getSource(), request.getSourcePort(), resource.getURI()}); ObservingEndpoint remote = observeManager.findObservingEndpoint(source); ObserveRelation relation = new ObserveRelation(remote, resource, exchange); remote.addObserveRelation(relation); ObserveRelation relation = observeManager.getRelation(source, request.getToken()); if (relation != null) { relation.cancel();