@Override public void onError(Exception e) { if (e instanceof TimeoutException) { // If the timeout expires, this means the client does not respond. presenceService.clientNotResponding(destination); } // Call the user's callback errorCallback.onError(e); } });
@Override public void onError(Exception e) { if (e instanceof TimeoutException) { // If the timeout expires, this means the client does not respond. presenceService.clientNotResponding(destination); } // Call the user's callback errorCallback.onError(e); } });
@Override public void onResponse(Response coapResponse) { LOG.debug("Received coap response: {} for {}", coapResponse, coapRequest); try { cleaningTask.cancel(false); responseCallback.onResponse(coapResponse); } catch (Exception e) { errorCallback.onError(e); } finally { coapRequest.removeMessageObserver(this); } }
@Override public void onCancel() { cancelCleaningTask(); if (responseTimedOut.get()) errorCallback.onError(new org.eclipse.leshan.core.request.exception.TimeoutException("Request %s timed out", coapRequest.getURI())); else errorCallback.onError(new RequestCanceledException("Request %s cancelled", coapRequest.getURI())); }
@Override public void onReject() { cancelCleaningTask(); errorCallback.onError(new RequestRejectedException("Request %s rejected", coapRequest.getURI())); }
@Override public void onSendError(Throwable error) { cancelCleaningTask(); errorCallback.onError(new SendFailedException(error, "Unable to send request %s", coapRequest.getURI())); }
@Override public void onTimeout() { cancelCleaningTask(); errorCallback.onError(new org.eclipse.leshan.core.request.exception.TimeoutException("Request %s timed out", coapRequest.getURI())); }