Class AbstractBuiltResponse
java.lang.Object
jakarta.ws.rs.core.Response
org.jboss.resteasy.specimpl.AbstractBuiltResponse
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
BuiltResponse
public abstract class AbstractBuiltResponse
extends jakarta.ws.rs.core.Response
A response object not attached to a client or server invocation.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Nested classes/interfaces inherited from class jakarta.ws.rs.core.Response
jakarta.ws.rs.core.Response.ResponseBuilder, jakarta.ws.rs.core.Response.Status, jakarta.ws.rs.core.Response.StatusType
-
Field Summary
Modifier and TypeFieldDescriptionprotected Annotation[]
protected byte[]
protected Object
protected Class
protected Type
protected InputStream
protected boolean
protected HeaderValueProcessor
protected String
protected int
protected boolean
protected boolean
-
Constructor Summary
ConstructorDescriptionAbstractBuiltResponse
(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addMethodAnnotations
(Annotation[] methodAnnotations) void
close()
getDate()
protected abstract InputStream
jakarta.ws.rs.core.EntityTag
getHeaderString
(String name) protected HeaderValueProcessor
protected abstract InputStream
int
jakarta.ws.rs.core.Link
jakarta.ws.rs.core.Link.Builder
getLinkBuilder
(String relation) Set
<jakarta.ws.rs.core.Link> getLinks()
jakarta.ws.rs.core.MediaType
int
jakarta.ws.rs.core.Response.StatusType
boolean
boolean
boolean
isClosed()
<T> T
readEntity
(jakarta.ws.rs.core.GenericType<T> entityType) <T> T
readEntity
(jakarta.ws.rs.core.GenericType<T> entityType, Annotation[] annotations) <T> T
readEntity
(Class<T> type) <T> T
readEntity
(Class<T> type, Annotation[] annotations) abstract <T> T
readEntity
(Class<T> type, Type genericType, Annotation[] anns) abstract void
Release underlying connection but do not close.abstract void
releaseConnection
(boolean consumeInputStream) Release underlying connection but do not close.protected void
void
setAnnotations
(Annotation[] annotations) void
void
setEntityClass
(Class entityClass) void
setGenericType
(Type genericType) protected abstract void
void
setMetadata
(jakarta.ws.rs.core.MultivaluedMap<String, Object> metadata) void
setReasonPhrase
(String reason) void
setStatus
(int status) void
void
protected String
toHeaderString
(Object header) Methods inherited from class jakarta.ws.rs.core.Response
accepted, accepted, bufferEntity, created, fromResponse, getHeaders, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, status, temporaryRedirect
-
Field Details
-
entity
-
status
protected int status -
reason
-
metadata
-
annotations
-
entityClass
-
genericType
-
processor
-
isClosed
protected volatile boolean isClosed -
is
-
bufferedEntity
protected byte[] bufferedEntity -
streamRead
protected volatile boolean streamRead -
streamFullyRead
protected volatile boolean streamFullyRead
-
-
Constructor Details
-
AbstractBuiltResponse
public AbstractBuiltResponse() -
AbstractBuiltResponse
public AbstractBuiltResponse(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)
-
-
Method Details
-
getInputStream
-
setInputStream
-
getEntityStream
-
releaseConnection
Release underlying connection but do not close.- Throws:
IOException
- if I/O error occurred
-
releaseConnection
Release underlying connection but do not close.- Parameters:
consumeInputStream
- boolean to indicate either the underlying input stream must be fully read before releasing the connection or not.For most HTTP connection implementations, consuming the underlying input stream before releasing the connection will help to ensure connection reusability with respect of Keep-Alive policy.
- Throws:
IOException
- if I/O error occured
-
getEntityClass
-
setEntityClass
-
getHeaderValueProcessor
-
getEntity
- Specified by:
getEntity
in classjakarta.ws.rs.core.Response
-
getStatus
public int getStatus()- Specified by:
getStatus
in classjakarta.ws.rs.core.Response
-
getReasonPhrase
-
getStatusInfo
public jakarta.ws.rs.core.Response.StatusType getStatusInfo()- Specified by:
getStatusInfo
in classjakarta.ws.rs.core.Response
-
getMetadata
-
setEntity
-
setStatus
public void setStatus(int status) -
setReasonPhrase
-
setMetadata
-
getAnnotations
-
addMethodAnnotations
-
setAnnotations
-
getGenericType
-
setGenericType
-
readEntity
- Specified by:
readEntity
in classjakarta.ws.rs.core.Response
-
readEntity
- Specified by:
readEntity
in classjakarta.ws.rs.core.Response
-
readEntity
- Specified by:
readEntity
in classjakarta.ws.rs.core.Response
-
readEntity
public <T> T readEntity(jakarta.ws.rs.core.GenericType<T> entityType) - Specified by:
readEntity
in classjakarta.ws.rs.core.Response
-
readEntity
-
resetEntity
protected void resetEntity() -
setStreamRead
-
setStreamFullyRead
-
hasEntity
public boolean hasEntity()- Specified by:
hasEntity
in classjakarta.ws.rs.core.Response
-
isClosed
public boolean isClosed()- Overrides:
isClosed
in classjakarta.ws.rs.core.Response
-
abortIfClosed
public void abortIfClosed() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classjakarta.ws.rs.core.Response
-
getLanguage
- Specified by:
getLanguage
in classjakarta.ws.rs.core.Response
-
getLength
public int getLength()- Specified by:
getLength
in classjakarta.ws.rs.core.Response
-
getMediaType
public jakarta.ws.rs.core.MediaType getMediaType()- Specified by:
getMediaType
in classjakarta.ws.rs.core.Response
-
getCookies
-
getEntityTag
public jakarta.ws.rs.core.EntityTag getEntityTag()- Specified by:
getEntityTag
in classjakarta.ws.rs.core.Response
-
getDate
- Specified by:
getDate
in classjakarta.ws.rs.core.Response
-
getLastModified
- Specified by:
getLastModified
in classjakarta.ws.rs.core.Response
-
getAllowedMethods
-
toHeaderString
-
getStringHeaders
-
getHeaderString
-
getLocation
- Specified by:
getLocation
in classjakarta.ws.rs.core.Response
-
getLinks
- Specified by:
getLinks
in classjakarta.ws.rs.core.Response
-
hasLink
- Specified by:
hasLink
in classjakarta.ws.rs.core.Response
-
getLink
- Specified by:
getLink
in classjakarta.ws.rs.core.Response
-
getLinkBuilder
- Specified by:
getLinkBuilder
in classjakarta.ws.rs.core.Response
-