public ObserveRelation getRelation(InetSocketAddress source, byte[] token) { ObservingEndpoint remote = getObservingEndpoint(source); if (remote!=null) { return remote.getObserveRelation(token); } else { return null; } }
/** * Notifies all CoAP clients that have established an observe relation with * this resource that the state has changed by reprocessing their original * request that has established the relation. * * @param filter filter to select set of relations. * <code>null</code>, if all clients should be notified. */ protected void notifyObserverRelations(final ObserveRelationFilter filter) { notificationOrderer.getNextObserveNumber(); for (ObserveRelation relation:observeRelations) { if (null == filter || filter.accept(relation)) relation.notifyObservers(); } }
/** * Constructs a new CoapObserveRelation with the specified request. * * @param request the request * @param endpoint the endpoint */ protected CoapObserveRelation(Request request, Endpoint endpoint) { this.request = request; this.endpoint = endpoint; this.orderer = new ObserveNotificationOrderer(); }
/** * Cancels all observe relations that this endpoint has established with * resources from this server. */ public void cancelAll() { for (ObserveRelation relation:relations) relation.cancel(); }
private Observation build(org.eclipse.californium.core.observe.Observation cfObs) { if (cfObs == null) return null; return ObserveUtil.createLwM2mObservation(cfObs.getRequest()); }
/** * Cancel all observer relations that this server has established with this' * realtion's endpoint. */ public void cancelAll() { endpoint.cancelAll(); }
/** * Gets the source address of the observing endpoint. * * @return the source address */ public InetSocketAddress getSource() { return endpoint.getAddress(); }
/** * Returns the number of observe relations that this resource has to CoAP * clients. * * @return the observer count */ public int getObserverCount() { return observeRelations.getSize(); }
@Override public void removeObserveRelation(ObserveRelation relation) { observeRelations.remove(relation); for (ResourceObserver obs:observers) obs.removedObserveRelation(relation); }
/** * Cancel all observe relations to CoAP clients. */ public void clearObserveRelations() { for (ObserveRelation relation:observeRelations) { relation.cancel(); } }
/** * Notifies all CoAP clients that have established an observe relation with * this resource that the state has changed by reprocessing their original * request that has established the relation. * * @param filter filter to select set of relations. * <code>null</code>, if all clients should be notified. */ protected void notifyObserverRelations(final ObserveRelationFilter filter) { notificationOrderer.getNextObserveNumber(); for (ObserveRelation relation:observeRelations) { if (null == filter || filter.accept(relation)) relation.notifyObservers(); } }
private Observation build(org.eclipse.californium.core.observe.Observation cfObs) { if (cfObs == null) return null; return ObserveUtil.createLwM2mObservation(cfObs.getRequest()); }
public ObserveRelation getRelation(InetSocketAddress source, byte[] token) { ObservingEndpoint remote = getObservingEndpoint(source); if (remote!=null) { return remote.getObserveRelation(token); } else { return null; } }
/** * Constructs a new CoapObserveRelation with the specified request. * * @param request the request * @param endpoint the endpoint */ protected CoapObserveRelation(Request request, Endpoint endpoint) { this.request = request; this.endpoint = endpoint; this.orderer = new ObserveNotificationOrderer(); }
/** * Cancel all observer relations that this server has established with this' * realtion's endpoint. */ public void cancelAll() { endpoint.cancelAll(); }
/** * Gets the source address of the observing endpoint. * * @return the source address */ public InetSocketAddress getSource() { return endpoint.getAddress(); }
/** * Returns the number of observe relations that this resource has to CoAP * clients. * * @return the observer count */ public int getObserverCount() { return observeRelations.getSize(); }
/** * Cancels all observe relations that this endpoint has established with * resources from this server. */ public void cancelAll() { for (ObserveRelation relation:relations) relation.cancel(); }
private Observation build(org.eclipse.californium.core.observe.Observation cfObs) { if (cfObs == null) return null; return ObserveUtil.createLwM2mObservation(cfObs.getRequest()); }
/** * Cancel all observe relations to CoAP clients. */ public void clearObserveRelations() { for (ObserveRelation relation:observeRelations) { relation.cancel(); } }