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);