/** * Sends the specified response over the same endpoint as the request has * arrived. * * @param response the response */ public void sendResponse(Response response) { response.setDestination(request.getSource()); response.setDestinationPort(request.getSourcePort()); setResponse(response); endpoint.sendResponse(this, response); }
/** * Sends the specified response over the same endpoint as the request has * arrived. * * @param response the response */ public void sendResponse(Response response) { response.setDestination(request.getSource()); response.setDestinationPort(request.getSourcePort()); setResponse(response); endpoint.sendResponse(this, response); }
/** * Creates a response to the specified request with the specified response * code. The destination address of the response is the source address of * the request. * Type and MID are usually set automatically by the {@link ReliabilityLayer}. * The token is set automatically by the {@link Matcher}. * * @param request * the request * @param code * the code * @return the response */ public static Response createResponse(Request request, ResponseCode code) { Response response = new Response(code); response.setDestination(request.getSource()); response.setDestinationPort(request.getSourcePort()); return response; }
/** * Creates a response to the specified request with the specified response * code. The destination address of the response is the source address of * the request. * Type and MID are usually set automatically by the {@link ReliabilityLayer}. * The token is set automatically by the {@link Matcher}. * * @param request * the request * @param code * the code * @return the response */ public static Response createResponse(Request request, ResponseCode code) { Response response = new Response(code); response.setDestination(request.getSource()); response.setDestinationPort(request.getSourcePort()); return response; }
@Override public void go() { Response response = new Response(code); if (destination != null) { response.setDestination(destination.getAddress()); response.setDestinationPort(destination.getPort()); } setProperties(response); RawData raw = serializer.serializeResponse(response); send(raw); } }
private static Response responseFor(final Request request) { Response response = new Response(ResponseCode.CONTENT); response.setMID(request.getMID()); response.setToken(request.getToken()); response.setBytes(new byte[]{}); response.setSource(request.getDestination()); response.setSourcePort(request.getDestinationPort()); response.setDestination(request.getSource()); response.setDestinationPort(request.getSourcePort()); return response; } }
private Response responseFor(final Request request) { Response response = new Response(ResponseCode.CONTENT); response.setMID(request.getMID()); response.setToken(request.getToken()); response.setBytes(new byte[]{}); response.setSource(request.getDestination()); response.setSourcePort(request.getDestinationPort()); response.setDestination(request.getSource()); response.setDestinationPort(request.getSourcePort()); return response; } }
} else { block = new Response(response.getCode()); block.setDestination(response.getDestination()); block.setDestinationPort(response.getDestinationPort()); block.setOptions(new OptionSet(response.getOptions()));
} else { block = new Response(response.getCode()); block.setDestination(response.getDestination()); block.setDestinationPort(response.getDestinationPort()); block.setOptions(new OptionSet(response.getOptions()));