@Override public void deliverResponse(Exchange exchange, Response response) { if (exchange == null) throw new NullPointerException(); if (exchange.getRequest() == null) throw new NullPointerException(); if (response == null) throw new NullPointerException(); exchange.getRequest().setResponse(response); } }
@Override public void deliverResponse(Exchange exchange, Response response) { if (exchange == null) throw new NullPointerException(); if (exchange.getRequest() == null) throw new NullPointerException(); if (response == null) throw new NullPointerException(); exchange.getRequest().setResponse(response); } }
@Override public void deliverResponse(Exchange exchange, Response response) { if (response == null) throw new NullPointerException(); if (exchange == null) throw new NullPointerException(); if (exchange.getRequest() == null) throw new NullPointerException(); exchange.getRequest().setResponse(response); } }
@Override public void deliverResponse(Exchange exchange, Response response) { if (response == null) { throw new NullPointerException("Response must not be null"); } else if (exchange == null) { throw new NullPointerException("Exchange must not be null"); } else if (exchange.getRequest() == null) { throw new IllegalArgumentException("Exchange does not contain request"); } else { exchange.getRequest().setResponse(response); } }
@Override public void deliverResponse(Exchange exchange, Response response) { if (response == null) { throw new RuntimeException("Response must not be null"); } else if (exchange == null) { throw new RuntimeException("Exchange must not be null"); } else if (exchange.getRequest() == null) { throw new IllegalArgumentException("Exchange does not contain request"); } else { exchange.getRequest().setResponse(response); } }
@Override public void deliverResponse(Exchange exchange, Response response) { if (response == null) { throw new NullPointerException("Response must not be null"); } else if (exchange == null) { throw new NullPointerException("Exchange must not be null"); } else if (exchange.getRequest() == null) { throw new IllegalArgumentException("Exchange does not contain request"); } else { exchange.getRequest().setResponse(response); } } }
@Override public void deliverResponse(final Exchange exchange, final Response response) { if (response == null) { throw new NullPointerException(); } if (exchange == null) { throw new NullPointerException(); } if (exchange.getRequest() == null) { throw new NullPointerException(); } exchange.getRequest().setResponse(response); } }
@Override public void deliverResponse(final Exchange exchange, final Response response) { if (response == null) { throw new NullPointerException(); } if (exchange == null) { throw new NullPointerException(); } if (exchange.getRequest() == null) { throw new NullPointerException(); } exchange.getRequest().setResponse(response); } }
@Override public void sendResponse(Response response) { // Redirect the response to the HttpStack instead of a normal // CoAP endpoint. // TODO: When we change endpoint to be an interface, we can // redirect the responses a little more elegantly. try { request.setResponse(response); responseProduced(request, response); httpStack.doSendResponse(request, response); LOGGER.info("HTTP returned " + response); } catch (Exception e) { LOGGER.log(Level.WARNING, "Exception while responding to Http request", e); } } };
@Override public void sendResponse(Response response) { // Redirect the response to the HttpStack instead of a normal // CoAP endpoint. // TODO: When we change endpoint to be an interface, we can // redirect the responses a little more elegantly. try { request.setResponse(response); responseProduced(request, response); httpStack.doSendResponse(request, response); } catch (Exception e) { LOGGER.log(Level.WARNING, "Exception while responding to Http request", e); } } };
boolean processed = preDeliverResponse(exchange, response); if (!processed) { exchange.getRequest().setResponse(response);