Class BuiltResponse
java.lang.Object
jakarta.ws.rs.core.Response
org.jboss.resteasy.specimpl.AbstractBuiltResponse
org.jboss.resteasy.specimpl.BuiltResponse
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
BuiltResponseEntityNotBacked
,ClientResponse
,ServerResponse
A response object not attached to a client or server invocation.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse
AbstractBuiltResponse.InputStreamWrapper<T extends BuiltResponse>
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
Fields inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse
annotations, bufferedEntity, entity, entityClass, genericType, is, isClosed, metadata, processor, reason, status, streamFullyRead, streamRead
-
Constructor Summary
ConstructorDescriptionBuiltResponse
(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations) BuiltResponse
(int status, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations) -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected InputStream
protected InputStream
<T> T
readEntity
(Class<T> type, Type genericType, Annotation[] anns) protected <T> Object
readFrom
(Class<T> type, Type genericType, jakarta.ws.rs.core.MediaType media, Annotation[] annotations) void
Release underlying connection but do not close.void
releaseConnection
(boolean consumeInputStream) Release underlying connection but do not close.protected void
Methods inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse
abortIfClosed, addMethodAnnotations, close, getAllowedMethods, getAnnotations, getCookies, getDate, getEntity, getEntityClass, getEntityTag, getGenericType, getHeaderString, getHeaderValueProcessor, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getMetadata, getReasonPhrase, getStatus, getStatusInfo, getStringHeaders, hasEntity, hasLink, isClosed, readEntity, readEntity, readEntity, readEntity, resetEntity, setAnnotations, setEntity, setEntityClass, setGenericType, setMetadata, setReasonPhrase, setStatus, setStreamFullyRead, setStreamRead, toHeaderString
Methods inherited from class jakarta.ws.rs.core.Response
accepted, accepted, created, fromResponse, getHeaders, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, status, temporaryRedirect
-
Constructor Details
-
BuiltResponse
public BuiltResponse() -
BuiltResponse
public BuiltResponse(int status, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations) -
BuiltResponse
public BuiltResponse(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)
-
-
Method Details
-
readEntity
- Specified by:
readEntity
in classAbstractBuiltResponse
-
readFrom
protected <T> Object readFrom(Class<T> type, Type genericType, jakarta.ws.rs.core.MediaType media, Annotation[] annotations) -
getEntityStream
- Specified by:
getEntityStream
in classAbstractBuiltResponse
-
setInputStream
- Specified by:
setInputStream
in classAbstractBuiltResponse
-
getInputStream
- Specified by:
getInputStream
in classAbstractBuiltResponse
-
releaseConnection
Description copied from class:AbstractBuiltResponse
Release underlying connection but do not close.- Specified by:
releaseConnection
in classAbstractBuiltResponse
- Throws:
IOException
- if I/O error occurred
-
releaseConnection
Description copied from class:AbstractBuiltResponse
Release underlying connection but do not close.- Specified by:
releaseConnection
in classAbstractBuiltResponse
- 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
-
bufferEntity
public boolean bufferEntity()- Specified by:
bufferEntity
in classjakarta.ws.rs.core.Response
-