|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.message.internal.Responses
public final class Responses
Internal Jersey response factory & utility class. Provides various response factory and utility methods.
| Method Summary | |
|---|---|
static Response.ResponseBuilder |
clientError(Request request)
Create a response builder for the request & status code set to Response.Status.BAD_REQUEST. |
static Response.ResponseBuilder |
conflict(Request request)
Create a response builder for the request & status code set to Response.Status.CONFLICT. |
static Response.ResponseBuilder |
empty()
Create a response builder with no response entity & status code set to Response.Status.NO_CONTENT. |
static void |
fillHeaders(Response.ResponseBuilder responseBuilder,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
Add headers to the response builder. |
static Response.ResponseBuilder |
from(int statusCode,
Request request)
Create a response builder for the request with a given status code. |
static Response.ResponseBuilder |
from(int statusCode,
Request request,
java.io.InputStream externalInputStream)
Create a response builder for the request with a given status code. |
static Response.ResponseBuilder |
from(Response.StatusType status,
Request request)
Create a response builder for the request with a given status code. |
static MessageBodyWorkers |
getMessageWorkers(Response response)
Get the MessageBodyWorkers from the response. |
static Response.ResponseBuilder |
methodNotAllowed(Request request)
Create a response builder for the request & status code set to Response.Status.METHOD_NOT_ALLOWED. |
static Response.ResponseBuilder |
noContent(Request request)
Create a response builder for the request & status code set to Response.Status.NO_CONTENT. |
static Response.ResponseBuilder |
notAcceptable(Request request)
Create a response builder for the request & status code set to Response.Status.NOT_ACCEPTABLE. |
static Response.ResponseBuilder |
notFound(Request request)
Create a response builder for the request & status code set to Response.Status.NOT_FOUND. |
static Response.ResponseBuilder |
notModified(EntityTag eTag,
Request request)
Create a response builder for the request & status code set to Response.Status.NOT_MODIFIED. |
static Response.ResponseBuilder |
notModified(Request request)
Create a response builder for the request & status code set to Response.Status.NOT_MODIFIED. |
static Response.ResponseBuilder |
preconditionFailed(Request request)
Create a response builder for the request & status code set to Response.Status.PRECONDITION_FAILED. |
static void |
setMessageWorkers(Response.ResponseBuilder responseBuilder,
MessageBodyWorkers workers)
Set the MessageBodyWorkers to the response builder. |
static Response.ResponseBuilder |
toBuilder(Response response)
Transforms a response to a response builder. |
static Response.ResponseBuilder |
unsupportedMediaType(Request request)
Create a response builder for the request & status code set to Response.Status.UNSUPPORTED_MEDIA_TYPE. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Response.ResponseBuilder empty()
Response.Status.NO_CONTENT.
public static Response.ResponseBuilder from(Response.StatusType status,
Request request)
status - response status code.request - request for which the response is created.
public static Response.ResponseBuilder from(int statusCode,
Request request,
java.io.InputStream externalInputStream)
statusCode - response status code.request - request for which the response is created.externalInputStream - sets the external raw input stream. This input stream is
the stream "from wire" and is not intercepted yet.
public static Response.ResponseBuilder from(int statusCode,
Request request)
statusCode - response status code.request - request for which the response is created.
public static Response.ResponseBuilder toBuilder(Response response)
response - response instance to be transformed into a response builder.
public static void fillHeaders(Response.ResponseBuilder responseBuilder,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
responseBuilder - JAX-RS response builder. It is assumed that the instance
is represented by an internal Jersey response builder type.headers - map of headers. Each header name may be associated with multiple
values stored as a list.
public static Response.ResponseBuilder notModified(EntityTag eTag,
Request request)
Response.Status.NOT_MODIFIED.
eTag - entity tag header value to be set on the response.request - request for which the response is created.
public static Response.ResponseBuilder notModified(Request request)
Response.Status.NOT_MODIFIED.
request - request for which the response is created.
public static Response.ResponseBuilder noContent(Request request)
Response.Status.NO_CONTENT.
request - request for which the response is created.
public static Response.ResponseBuilder clientError(Request request)
Response.Status.BAD_REQUEST.
request - request for which the response is created.
public static Response.ResponseBuilder notFound(Request request)
Response.Status.NOT_FOUND.
request - request for which the response is created.
public static Response.ResponseBuilder methodNotAllowed(Request request)
Response.Status.METHOD_NOT_ALLOWED.
request - request for which the response is created.
public static Response.ResponseBuilder notAcceptable(Request request)
Response.Status.NOT_ACCEPTABLE.
request - request for which the response is created.
public static Response.ResponseBuilder preconditionFailed(Request request)
Response.Status.PRECONDITION_FAILED.
request - request for which the response is created.
public static Response.ResponseBuilder conflict(Request request)
Response.Status.CONFLICT.
request - request for which the response is created.
public static Response.ResponseBuilder unsupportedMediaType(Request request)
Response.Status.UNSUPPORTED_MEDIA_TYPE.
request - request for which the response is created.
public static void setMessageWorkers(Response.ResponseBuilder responseBuilder,
MessageBodyWorkers workers)
MessageBodyWorkers to the response builder.
responseBuilder - JAX-RS response builder. It is assumed that the instance
is represented by an internal Jersey response builder type.workers - message body readers and writers lookup factory.public static MessageBodyWorkers getMessageWorkers(Response response)
MessageBodyWorkers from the response.
response - JAX-RS response. It is assumed that the instance
is represented by an internal Jersey response builder type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||