Package de.uniluebeck.itm.ncoap.application.server.webservice

Examples of de.uniluebeck.itm.ncoap.application.server.webservice.ObservableWebservice$NotifySingleObserverTask


        }

        if(event.stopsMessageExchange()){
            try{
                observationsLock.writeLock().lock();
                ObservableWebservice webservice = this.observations.remove(remoteEndpoint, token);
                if(webservice != null){
                    log.info("Stopped observation of \"{}\" (remote endpoint: {}, token: {}) due to: {}",
                            new Object[]{webservice.getUriPath(), remoteEndpoint, token, event});
                    webservice.handleMessageTransferEvent(event);
                }
            }
            finally {
                observationsLock.writeLock().unlock();
            }
        }

        else{
            try{
                observationsLock.readLock().lock();
                ObservableWebservice webservice = this.observations.get(remoteEndpoint, token);
                if(webservice != null){
                    webservice.handleMessageTransferEvent(event);
                }
            }
            finally {
                observationsLock.readLock().unlock();
            }
View Full Code Here


                    coapResponse.setMessageID(coapRequest.getMessageID());
                    coapResponse.setToken(coapRequest.getToken());

                    if(coapResponse.isUpdateNotification()){
                        if(webservice instanceof ObservableWebservice && coapRequest.getObserve() == 0){
                            ObservableWebservice observableWebservice = (ObservableWebservice) webservice;
                            observableWebservice.addObservation(remoteEndpoint, coapResponse.getToken(),
                                    coapResponse.getContentFormat());
                            sendUpdateNotification(ctx, remoteEndpoint, coapResponse, observableWebservice);
                        }
                        else{
                            coapResponse.removeOptions(OptionValue.Name.OBSERVE);
View Full Code Here

TOP

Related Classes of de.uniluebeck.itm.ncoap.application.server.webservice.ObservableWebservice$NotifySingleObserverTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.