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