@Override public javax.ws.rs.core.Response build() { StatusType st = status; if (st == null) { st = context.hasEntity() ? Status.OK : Status.NO_CONTENT; } return new OutboundJaxrsResponse(st, new OutboundMessageContext(context)); }
this.headers(OutboundJaxrsResponse.from(response).getContext().getStringHeaders());
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ ContainerResponse(final ContainerRequest requestContext, final OutboundJaxrsResponse response) { this.requestContext = requestContext; this.requestContext.inResponseProcessing(); this.status = response.getStatusInfo(); this.messageContext = response.getContext(); final String varyValue = requestContext.getVaryValue(); if (varyValue != null && !this.messageContext.getHeaders().containsKey(HttpHeaders.VARY)) { /** * Add a Vary header using the value computed in the request if present * and if the Vary header was not explicitly set in the response already. */ this.messageContext.getHeaders().add(HttpHeaders.VARY, varyValue); } }
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ public ContainerResponse(final ContainerRequest requestContext, final Response response) { this(requestContext, OutboundJaxrsResponse.from(response)); }
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ public ContainerResponse(final ContainerRequest requestContext, final Response response) { this(requestContext, OutboundJaxrsResponse.from(response)); }
this.headers(OutboundJaxrsResponse.from(response).getContext().getStringHeaders());
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ ContainerResponse(final ContainerRequest requestContext, final OutboundJaxrsResponse response) { this.requestContext = requestContext; this.requestContext.inResponseProcessing(); this.status = response.getStatusInfo(); this.messageContext = response.getContext(); final String varyValue = requestContext.getVaryValue(); if (varyValue != null && !this.messageContext.getHeaders().containsKey(HttpHeaders.VARY)) { /** * Add a Vary header using the value computed in the request if present * and if the Vary header was not explicitly set in the response already. */ this.messageContext.getHeaders().add(HttpHeaders.VARY, varyValue); } }
@Override public javax.ws.rs.core.Response build() { StatusType st = status; if (st == null) { st = context.hasEntity() ? Status.OK : Status.NO_CONTENT; } return new OutboundJaxrsResponse(st, new OutboundMessageContext(context)); }
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ public ContainerResponse(final ContainerRequest requestContext, final Response response) { this(requestContext, OutboundJaxrsResponse.from(response)); }
this.headers(OutboundJaxrsResponse.from(response).getContext().getStringHeaders());
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ ContainerResponse(final ContainerRequest requestContext, final OutboundJaxrsResponse response) { this.requestContext = requestContext; this.requestContext.inResponseProcessing(); this.status = response.getStatusInfo(); this.messageContext = response.getContext(); final String varyValue = requestContext.getVaryValue(); if (varyValue != null && !this.messageContext.getHeaders().containsKey(HttpHeaders.VARY)) { /** * Add a Vary header using the value computed in the request if present * and if the Vary header was not explicitly set in the response already. */ this.messageContext.getHeaders().add(HttpHeaders.VARY, varyValue); } }
/** * Get an OutboundJaxrsResponse instance for a given JAX-RS response. * * @param response response instance to from. * @return corresponding {@code OutboundJaxrsResponse} instance. */ public static OutboundJaxrsResponse from(javax.ws.rs.core.Response response) { if (response instanceof OutboundJaxrsResponse) { return (OutboundJaxrsResponse) response; } else { final StatusType status = response.getStatusInfo(); final OutboundMessageContext context = new OutboundMessageContext(); context.getHeaders().putAll(response.getMetadata()); context.setEntity(response.getEntity()); return new OutboundJaxrsResponse(status, context); } }
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ public ContainerResponse(final ContainerRequest requestContext, final Response response) { this(requestContext, OutboundJaxrsResponse.from(response)); }
this.headers(OutboundJaxrsResponse.from(response).getContext().getStringHeaders());
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ ContainerResponse(final ContainerRequest requestContext, final OutboundJaxrsResponse response) { this.requestContext = requestContext; this.requestContext.inResponseProcessing(); this.status = response.getStatusInfo(); this.messageContext = response.getContext(); final String varyValue = requestContext.getVaryValue(); if (varyValue != null && !this.messageContext.getHeaders().containsKey(HttpHeaders.VARY)) { /** * Add a Vary header using the value computed in the request if present * and if the Vary header was not explicitly set in the response already. */ this.messageContext.getHeaders().add(HttpHeaders.VARY, varyValue); } }
/** * Get an OutboundJaxrsResponse instance for a given JAX-RS response. * * @param response response instance to from. * @return corresponding {@code OutboundJaxrsResponse} instance. */ public static OutboundJaxrsResponse from(javax.ws.rs.core.Response response) { if (response instanceof OutboundJaxrsResponse) { return (OutboundJaxrsResponse) response; } else { final StatusType status = response.getStatusInfo(); final OutboundMessageContext context = new OutboundMessageContext(); context.getHeaders().putAll(response.getMetadata()); context.setEntity(response.getEntity()); return new OutboundJaxrsResponse(status, context); } }
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ public ContainerResponse(final ContainerRequest requestContext, final Response response) { this(requestContext, OutboundJaxrsResponse.from(response)); }
this.headers(OutboundJaxrsResponse.from(response).getContext().getStringHeaders());
/** * Create a new Jersey container response context. * * @param requestContext associated container request context. * @param response response instance initializing the response context. */ ContainerResponse(final ContainerRequest requestContext, final OutboundJaxrsResponse response) { this.requestContext = requestContext; this.requestContext.inResponseProcessing(); this.status = response.getStatusInfo(); this.messageContext = response.getContext(); final String varyValue = requestContext.getVaryValue(); if (varyValue != null && !this.messageContext.getHeaders().containsKey(HttpHeaders.VARY)) { /** * Add a Vary header using the value computed in the request if present * and if the Vary header was not explicitly set in the response already. */ this.messageContext.getHeaders().add(HttpHeaders.VARY, varyValue); } }
@Override public void setResponseStatus(final int code) { StatusType type = Response.Status.fromStatusCode(code); if (type == null) { type = new StatusType() { @Override public int getStatusCode() { return code; } @Override public String getReasonPhrase() { return null; } @Override public Family getFamily() { return Family.familyOf(code); } }; } response = new OutboundJaxrsResponse(type, context); }