Class OutboundJaxrsResponse.Builder
- java.lang.Object
-
- jakarta.ws.rs.core.Response.ResponseBuilder
-
- org.glassfish.jersey.message.internal.OutboundJaxrsResponse.Builder
-
- Enclosing class:
- OutboundJaxrsResponse
public static class OutboundJaxrsResponse.Builder extends jakarta.ws.rs.core.Response.ResponseBuilder
Outbound JAX-RSResponse.ResponseBuilder
implementation. The implementation delegates method calls to anunderlying outbound message context
. Upon a call to abuild()
method a new instance ofOutboundJaxrsResponse
is produced.
-
-
Constructor Summary
Constructors Constructor Description Builder(OutboundMessageContext context)
Create new outbound JAX-RS response builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.Response.ResponseBuilder
allow(String... methods)
jakarta.ws.rs.core.Response.ResponseBuilder
allow(Set<String> methods)
jakarta.ws.rs.core.Response
build()
jakarta.ws.rs.core.Response.ResponseBuilder
cacheControl(jakarta.ws.rs.core.CacheControl cacheControl)
static void
clearBaseUri()
Remove the current thread's value for baseUri thread-local variable (set bysetBaseUri(java.net.URI)
).jakarta.ws.rs.core.Response.ResponseBuilder
clone()
jakarta.ws.rs.core.Response.ResponseBuilder
contentLocation(URI location)
jakarta.ws.rs.core.Response.ResponseBuilder
cookie(jakarta.ws.rs.core.NewCookie... cookies)
jakarta.ws.rs.core.Response.ResponseBuilder
encoding(String encoding)
jakarta.ws.rs.core.Response.ResponseBuilder
entity(Object entity)
jakarta.ws.rs.core.Response.ResponseBuilder
entity(Object entity, Annotation[] annotations)
jakarta.ws.rs.core.Response.ResponseBuilder
expires(Date expires)
jakarta.ws.rs.core.Response.ResponseBuilder
header(String name, Object value)
jakarta.ws.rs.core.Response.ResponseBuilder
language(String language)
jakarta.ws.rs.core.Response.ResponseBuilder
language(Locale language)
jakarta.ws.rs.core.Response.ResponseBuilder
lastModified(Date lastModified)
jakarta.ws.rs.core.Response.ResponseBuilder
link(String uri, String rel)
jakarta.ws.rs.core.Response.ResponseBuilder
link(URI uri, String rel)
jakarta.ws.rs.core.Response.ResponseBuilder
links(jakarta.ws.rs.core.Link... links)
jakarta.ws.rs.core.Response.ResponseBuilder
location(URI location)
jakarta.ws.rs.core.Response.ResponseBuilder
replaceAll(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers)
static void
setBaseUri(URI baseUri)
Set thebaseUri
of the actual request into theInheritableThreadLocal
.jakarta.ws.rs.core.Response.ResponseBuilder
status(int code)
jakarta.ws.rs.core.Response.ResponseBuilder
status(int status, String reasonPhrase)
jakarta.ws.rs.core.Response.ResponseBuilder
status(jakarta.ws.rs.core.Response.StatusType status)
jakarta.ws.rs.core.Response.ResponseBuilder
tag(jakarta.ws.rs.core.EntityTag tag)
jakarta.ws.rs.core.Response.ResponseBuilder
tag(String tag)
jakarta.ws.rs.core.Response.ResponseBuilder
type(jakarta.ws.rs.core.MediaType type)
jakarta.ws.rs.core.Response.ResponseBuilder
type(String type)
jakarta.ws.rs.core.Response.ResponseBuilder
variant(jakarta.ws.rs.core.Variant variant)
jakarta.ws.rs.core.Response.ResponseBuilder
variants(jakarta.ws.rs.core.Variant... variants)
jakarta.ws.rs.core.Response.ResponseBuilder
variants(List<jakarta.ws.rs.core.Variant> variants)
-
-
-
Constructor Detail
-
Builder
public Builder(OutboundMessageContext context)
Create new outbound JAX-RS response builder.- Parameters:
context
- underlying outbound message context.
-
-
Method Detail
-
setBaseUri
public static void setBaseUri(URI baseUri)
Set thebaseUri
of the actual request into theInheritableThreadLocal
.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.- Parameters:
baseUri
- - baseUri of the actual request- Since:
- 2.4
- See Also:
location(java.net.URI)
-
clearBaseUri
public static void clearBaseUri()
Remove the current thread's value for baseUri thread-local variable (set bysetBaseUri(java.net.URI)
). Should be called after resource method invocation for cleanup.- Since:
- 2.4
- See Also:
location(java.net.URI)
-
build
public jakarta.ws.rs.core.Response build()
- Specified by:
build
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
clone
public jakarta.ws.rs.core.Response.ResponseBuilder clone()
- Specified by:
clone
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
status
public jakarta.ws.rs.core.Response.ResponseBuilder status(jakarta.ws.rs.core.Response.StatusType status)
- Overrides:
status
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
status
public jakarta.ws.rs.core.Response.ResponseBuilder status(int status, String reasonPhrase)
- Specified by:
status
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
status
public jakarta.ws.rs.core.Response.ResponseBuilder status(int code)
- Specified by:
status
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
entity
public jakarta.ws.rs.core.Response.ResponseBuilder entity(Object entity)
- Specified by:
entity
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
entity
public jakarta.ws.rs.core.Response.ResponseBuilder entity(Object entity, Annotation[] annotations)
- Specified by:
entity
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
type
public jakarta.ws.rs.core.Response.ResponseBuilder type(jakarta.ws.rs.core.MediaType type)
- Specified by:
type
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
type
public jakarta.ws.rs.core.Response.ResponseBuilder type(String type)
- Specified by:
type
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
variant
public jakarta.ws.rs.core.Response.ResponseBuilder variant(jakarta.ws.rs.core.Variant variant)
- Specified by:
variant
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
variants
public jakarta.ws.rs.core.Response.ResponseBuilder variants(List<jakarta.ws.rs.core.Variant> variants)
- Specified by:
variants
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
language
public jakarta.ws.rs.core.Response.ResponseBuilder language(String language)
- Specified by:
language
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
language
public jakarta.ws.rs.core.Response.ResponseBuilder language(Locale language)
- Specified by:
language
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
location
public jakarta.ws.rs.core.Response.ResponseBuilder location(URI location)
- Specified by:
location
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
contentLocation
public jakarta.ws.rs.core.Response.ResponseBuilder contentLocation(URI location)
- Specified by:
contentLocation
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
encoding
public jakarta.ws.rs.core.Response.ResponseBuilder encoding(String encoding)
- Specified by:
encoding
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
tag
public jakarta.ws.rs.core.Response.ResponseBuilder tag(jakarta.ws.rs.core.EntityTag tag)
- Specified by:
tag
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
tag
public jakarta.ws.rs.core.Response.ResponseBuilder tag(String tag)
- Specified by:
tag
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
lastModified
public jakarta.ws.rs.core.Response.ResponseBuilder lastModified(Date lastModified)
- Specified by:
lastModified
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
cacheControl
public jakarta.ws.rs.core.Response.ResponseBuilder cacheControl(jakarta.ws.rs.core.CacheControl cacheControl)
- Specified by:
cacheControl
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
expires
public jakarta.ws.rs.core.Response.ResponseBuilder expires(Date expires)
- Specified by:
expires
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
cookie
public jakarta.ws.rs.core.Response.ResponseBuilder cookie(jakarta.ws.rs.core.NewCookie... cookies)
- Specified by:
cookie
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
header
public jakarta.ws.rs.core.Response.ResponseBuilder header(String name, Object value)
- Specified by:
header
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
variants
public jakarta.ws.rs.core.Response.ResponseBuilder variants(jakarta.ws.rs.core.Variant... variants)
- Specified by:
variants
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
links
public jakarta.ws.rs.core.Response.ResponseBuilder links(jakarta.ws.rs.core.Link... links)
- Specified by:
links
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
link
public jakarta.ws.rs.core.Response.ResponseBuilder link(URI uri, String rel)
- Specified by:
link
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
link
public jakarta.ws.rs.core.Response.ResponseBuilder link(String uri, String rel)
- Specified by:
link
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
allow
public jakarta.ws.rs.core.Response.ResponseBuilder allow(String... methods)
- Specified by:
allow
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
allow
public jakarta.ws.rs.core.Response.ResponseBuilder allow(Set<String> methods)
- Specified by:
allow
in classjakarta.ws.rs.core.Response.ResponseBuilder
-
-