public static class OutboundJaxrsResponse.Builder
extends javax.ws.rs.core.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.
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response.ResponseBuilder |
allow(Set<String> methods) |
javax.ws.rs.core.Response.ResponseBuilder |
allow(String... methods) |
javax.ws.rs.core.Response |
build() |
javax.ws.rs.core.Response.ResponseBuilder |
cacheControl(javax.ws.rs.core.CacheControl cacheControl) |
static void |
clearBaseUri()
Remove the current thread's value for baseUri thread-local variable (set by
setBaseUri(java.net.URI) ). |
javax.ws.rs.core.Response.ResponseBuilder |
clone() |
javax.ws.rs.core.Response.ResponseBuilder |
contentLocation(URI location) |
javax.ws.rs.core.Response.ResponseBuilder |
cookie(javax.ws.rs.core.NewCookie... cookies) |
javax.ws.rs.core.Response.ResponseBuilder |
encoding(String encoding) |
javax.ws.rs.core.Response.ResponseBuilder |
entity(Object entity) |
javax.ws.rs.core.Response.ResponseBuilder |
entity(Object entity,
Annotation[] annotations) |
javax.ws.rs.core.Response.ResponseBuilder |
expires(Date expires) |
javax.ws.rs.core.Response.ResponseBuilder |
header(String name,
Object value) |
javax.ws.rs.core.Response.ResponseBuilder |
language(Locale language) |
javax.ws.rs.core.Response.ResponseBuilder |
language(String language) |
javax.ws.rs.core.Response.ResponseBuilder |
lastModified(Date lastModified) |
javax.ws.rs.core.Response.ResponseBuilder |
link(String uri,
String rel) |
javax.ws.rs.core.Response.ResponseBuilder |
link(URI uri,
String rel) |
javax.ws.rs.core.Response.ResponseBuilder |
links(javax.ws.rs.core.Link... links) |
javax.ws.rs.core.Response.ResponseBuilder |
location(URI location) |
javax.ws.rs.core.Response.ResponseBuilder |
replaceAll(javax.ws.rs.core.MultivaluedMap<String,Object> headers) |
static void |
setBaseUri(URI baseUri)
Set the
baseUri of the actual request into the InheritableThreadLocal . |
javax.ws.rs.core.Response.ResponseBuilder |
status(int code) |
javax.ws.rs.core.Response.ResponseBuilder |
status(int status,
String reasonPhrase) |
javax.ws.rs.core.Response.ResponseBuilder |
status(javax.ws.rs.core.Response.StatusType status) |
javax.ws.rs.core.Response.ResponseBuilder |
tag(javax.ws.rs.core.EntityTag tag) |
javax.ws.rs.core.Response.ResponseBuilder |
tag(String tag) |
javax.ws.rs.core.Response.ResponseBuilder |
type(javax.ws.rs.core.MediaType type) |
javax.ws.rs.core.Response.ResponseBuilder |
type(String type) |
javax.ws.rs.core.Response.ResponseBuilder |
variant(javax.ws.rs.core.Variant variant) |
javax.ws.rs.core.Response.ResponseBuilder |
variants(List<javax.ws.rs.core.Variant> variants) |
javax.ws.rs.core.Response.ResponseBuilder |
variants(javax.ws.rs.core.Variant... variants) |
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 javax.ws.rs.core.Response build()
build
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder clone()
clone
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder status(javax.ws.rs.core.Response.StatusType status)
status
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder status(int status, String reasonPhrase)
status
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder status(int code)
status
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder entity(Object entity)
entity
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder entity(Object entity, Annotation[] annotations)
entity
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder type(javax.ws.rs.core.MediaType type)
type
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder type(String type)
type
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder variant(javax.ws.rs.core.Variant variant)
variant
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder variants(List<javax.ws.rs.core.Variant> variants)
variants
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder language(String language)
language
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder language(Locale language)
language
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder location(URI location)
location
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder contentLocation(URI location)
contentLocation
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder encoding(String encoding)
encoding
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder tag(javax.ws.rs.core.EntityTag tag)
tag
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder tag(String tag)
tag
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder lastModified(Date lastModified)
lastModified
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder cacheControl(javax.ws.rs.core.CacheControl cacheControl)
cacheControl
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder expires(Date expires)
expires
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder cookie(javax.ws.rs.core.NewCookie... cookies)
cookie
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder header(String name, Object value)
header
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder variants(javax.ws.rs.core.Variant... variants)
variants
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder links(javax.ws.rs.core.Link... links)
links
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder link(URI uri, String rel)
link
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder link(String uri, String rel)
link
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder allow(String... methods)
allow
in class javax.ws.rs.core.Response.ResponseBuilder
public javax.ws.rs.core.Response.ResponseBuilder allow(Set<String> methods)
allow
in class javax.ws.rs.core.Response.ResponseBuilder
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.