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 Response.ResponseBuilder
Outbound JAX-RSResponse.ResponseBuilderimplementation. The implementation delegates method calls to anunderlying outbound message context. Upon a call to abuild()method a new instance ofOutboundJaxrsResponseis produced.
-
-
Constructor Summary
Constructors Constructor Description Builder(OutboundMessageContext context)Create new outbound JAX-RS response builder.
-
Method Summary
-
Methods inherited from class jakarta.ws.rs.core.Response.ResponseBuilder
newInstance, status
-
-
-
-
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 thebaseUriof the actual request into theInheritableThreadLocal.The
baseUriwill 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
ThreadLocalclearBaseUri()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 Response build()
- Specified by:
buildin classResponse.ResponseBuilder
-
clone
public Response.ResponseBuilder clone()
- Specified by:
clonein classResponse.ResponseBuilder
-
status
public Response.ResponseBuilder status(Response.StatusType status)
- Overrides:
statusin classResponse.ResponseBuilder
-
status
public Response.ResponseBuilder status(int status, String reasonPhrase)
- Specified by:
statusin classResponse.ResponseBuilder
-
status
public Response.ResponseBuilder status(int code)
- Specified by:
statusin classResponse.ResponseBuilder
-
entity
public Response.ResponseBuilder entity(Object entity)
- Specified by:
entityin classResponse.ResponseBuilder
-
entity
public Response.ResponseBuilder entity(Object entity, Annotation[] annotations)
- Specified by:
entityin classResponse.ResponseBuilder
-
type
public Response.ResponseBuilder type(MediaType type)
- Specified by:
typein classResponse.ResponseBuilder
-
type
public Response.ResponseBuilder type(String type)
- Specified by:
typein classResponse.ResponseBuilder
-
variant
public Response.ResponseBuilder variant(Variant variant)
- Specified by:
variantin classResponse.ResponseBuilder
-
variants
public Response.ResponseBuilder variants(List<Variant> variants)
- Specified by:
variantsin classResponse.ResponseBuilder
-
language
public Response.ResponseBuilder language(String language)
- Specified by:
languagein classResponse.ResponseBuilder
-
language
public Response.ResponseBuilder language(Locale language)
- Specified by:
languagein classResponse.ResponseBuilder
-
location
public Response.ResponseBuilder location(URI location)
- Specified by:
locationin classResponse.ResponseBuilder
-
contentLocation
public Response.ResponseBuilder contentLocation(URI location)
- Specified by:
contentLocationin classResponse.ResponseBuilder
-
encoding
public Response.ResponseBuilder encoding(String encoding)
- Specified by:
encodingin classResponse.ResponseBuilder
-
tag
public Response.ResponseBuilder tag(EntityTag tag)
- Specified by:
tagin classResponse.ResponseBuilder
-
tag
public Response.ResponseBuilder tag(String tag)
- Specified by:
tagin classResponse.ResponseBuilder
-
lastModified
public Response.ResponseBuilder lastModified(Date lastModified)
- Specified by:
lastModifiedin classResponse.ResponseBuilder
-
cacheControl
public Response.ResponseBuilder cacheControl(CacheControl cacheControl)
- Specified by:
cacheControlin classResponse.ResponseBuilder
-
expires
public Response.ResponseBuilder expires(Date expires)
- Specified by:
expiresin classResponse.ResponseBuilder
-
cookie
public Response.ResponseBuilder cookie(NewCookie... cookies)
- Specified by:
cookiein classResponse.ResponseBuilder
-
header
public Response.ResponseBuilder header(String name, Object value)
- Specified by:
headerin classResponse.ResponseBuilder
-
variants
public Response.ResponseBuilder variants(Variant... variants)
- Specified by:
variantsin classResponse.ResponseBuilder
-
links
public Response.ResponseBuilder links(Link... links)
- Specified by:
linksin classResponse.ResponseBuilder
-
link
public Response.ResponseBuilder link(URI uri, String rel)
- Specified by:
linkin classResponse.ResponseBuilder
-
link
public Response.ResponseBuilder link(String uri, String rel)
- Specified by:
linkin classResponse.ResponseBuilder
-
allow
public Response.ResponseBuilder allow(String... methods)
- Specified by:
allowin classResponse.ResponseBuilder
-
allow
public Response.ResponseBuilder allow(Set<String> methods)
- Specified by:
allowin classResponse.ResponseBuilder
-
replaceAll
public Response.ResponseBuilder replaceAll(MultivaluedMap<String,Object> headers)
- Specified by:
replaceAllin classResponse.ResponseBuilder
-
-