public static class OutboundJaxrsResponse.Builder extends Response.ResponseBuilder
Response.ResponseBuilder
implementation.
The implementation delegates method calls to an underlying
outbound message context
. Upon a call to a build()
method
a new instance of OutboundJaxrsResponse
is produced.Constructor and Description |
---|
Builder(OutboundMessageContext context)
Create new outbound JAX-RS response builder.
|
newInstance, status
public Builder(OutboundMessageContext context)
context
- underlying outbound message context.public static void setBaseUri(URI baseUri)
baseUri
of the actual request into the InheritableThreadLocal
.
The baseUri
will be used for absolutizing the location header
content in case that only a relative URI is provided.
After resource method invocation when the value is not needed
any more to be stored in ThreadLocal
clearBaseUri()
should be
called for cleanup in order to prevent possible memory leaks.
baseUri
- - baseUri of the actual requestlocation(java.net.URI)
public static void clearBaseUri()
setBaseUri(java.net.URI)
).
Should be called after resource method invocation for cleanup.location(java.net.URI)
public Response build()
build
in class Response.ResponseBuilder
public Response.ResponseBuilder clone()
clone
in class Response.ResponseBuilder
public Response.ResponseBuilder status(Response.StatusType status)
status
in class Response.ResponseBuilder
public Response.ResponseBuilder status(int status, String reasonPhrase)
status
in class Response.ResponseBuilder
public Response.ResponseBuilder status(int code)
status
in class Response.ResponseBuilder
public Response.ResponseBuilder entity(Object entity)
entity
in class Response.ResponseBuilder
public Response.ResponseBuilder entity(Object entity, Annotation[] annotations)
entity
in class Response.ResponseBuilder
public Response.ResponseBuilder type(MediaType type)
type
in class Response.ResponseBuilder
public Response.ResponseBuilder type(String type)
type
in class Response.ResponseBuilder
public Response.ResponseBuilder variant(Variant variant)
variant
in class Response.ResponseBuilder
public Response.ResponseBuilder variants(List<Variant> variants)
variants
in class Response.ResponseBuilder
public Response.ResponseBuilder language(String language)
language
in class Response.ResponseBuilder
public Response.ResponseBuilder language(Locale language)
language
in class Response.ResponseBuilder
public Response.ResponseBuilder location(URI location)
location
in class Response.ResponseBuilder
public Response.ResponseBuilder contentLocation(URI location)
contentLocation
in class Response.ResponseBuilder
public Response.ResponseBuilder encoding(String encoding)
encoding
in class Response.ResponseBuilder
public Response.ResponseBuilder tag(EntityTag tag)
tag
in class Response.ResponseBuilder
public Response.ResponseBuilder tag(String tag)
tag
in class Response.ResponseBuilder
public Response.ResponseBuilder lastModified(Date lastModified)
lastModified
in class Response.ResponseBuilder
public Response.ResponseBuilder cacheControl(CacheControl cacheControl)
cacheControl
in class Response.ResponseBuilder
public Response.ResponseBuilder expires(Date expires)
expires
in class Response.ResponseBuilder
public Response.ResponseBuilder cookie(NewCookie... cookies)
cookie
in class Response.ResponseBuilder
public Response.ResponseBuilder header(String name, Object value)
header
in class Response.ResponseBuilder
public Response.ResponseBuilder variants(Variant... variants)
variants
in class Response.ResponseBuilder
public Response.ResponseBuilder links(Link... links)
links
in class Response.ResponseBuilder
public Response.ResponseBuilder link(URI uri, String rel)
link
in class Response.ResponseBuilder
public Response.ResponseBuilder link(String uri, String rel)
link
in class Response.ResponseBuilder
public Response.ResponseBuilder allow(String... methods)
allow
in class Response.ResponseBuilder
public Response.ResponseBuilder allow(Set<String> methods)
allow
in class Response.ResponseBuilder
public Response.ResponseBuilder replaceAll(MultivaluedMap<String,Object> headers)
replaceAll
in class Response.ResponseBuilder
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.