public abstract class ClientResponse extends BuiltResponse
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
bufferedEntity |
protected ClientConfiguration |
configuration |
protected Map<String,Object> |
properties |
protected boolean |
streamFullyRead |
annotations, entity, entityClass, genericType, isClosed, metadata, processor, reason, status| Modifier | Constructor and Description |
|---|---|
protected |
ClientResponse(ClientConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortIfClosed() |
boolean |
bufferEntity() |
void |
close() |
protected void |
finalize() |
Object |
getEntity() |
Class<?> |
getEntityClass() |
protected InputStream |
getEntityStream() |
protected HeaderValueProcessor |
getHeaderValueProcessor() |
protected abstract InputStream |
getInputStream() |
Map<String,Object> |
getProperties() |
boolean |
hasEntity() |
void |
noReleaseConnection()
In case of an InputStream or Reader and a invocation that returns no Response object, we need to make
sure the GC does not close the returned InputStream or Reader
|
<T> T |
readEntity(Class<T> type,
Type genericType,
Annotation[] anns) |
protected <T> Object |
readFrom(Class<T> type,
Type genericType,
javax.ws.rs.core.MediaType media,
Annotation[] annotations) |
abstract void |
releaseConnection()
Release underlying connection but do not close.
|
abstract void |
releaseConnection(boolean consumeInputStream)
Release underlying connection but do not close.
|
protected void |
resetEntity() |
void |
setClientConfiguration(ClientConfiguration configuration) |
void |
setHeaders(javax.ws.rs.core.MultivaluedMap<String,String> headers) |
protected abstract void |
setInputStream(InputStream is) |
void |
setProperties(Map<String,Object> properties) |
addMethodAnnotations, getAllowedMethods, getAnnotations, getCookies, getDate, getEntityTag, getGenericType, getHeaderString, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinkHeaders, getLinks, getLocation, getMediaType, getMetadata, getReasonPhrase, getStatus, getStatusInfo, getStringHeaders, hasLink, isClosed, readEntity, readEntity, readEntity, readEntity, setAnnotations, setEntity, setEntityClass, setGenericType, setMetadata, setReasonPhrase, setStatus, toHeaderStringprotected ClientConfiguration configuration
protected byte[] bufferedEntity
protected boolean streamFullyRead
protected ClientResponse(ClientConfiguration configuration)
public void setClientConfiguration(ClientConfiguration configuration)
public Object getEntity()
getEntity in class BuiltResponsepublic Class<?> getEntityClass()
getEntityClass in class BuiltResponsepublic boolean hasEntity()
hasEntity in class BuiltResponsepublic void noReleaseConnection()
public void close()
close in interface AutoCloseableclose in class BuiltResponseprotected void finalize()
throws Throwable
protected HeaderValueProcessor getHeaderValueProcessor()
getHeaderValueProcessor in class BuiltResponseprotected abstract InputStream getInputStream()
protected InputStream getEntityStream()
protected abstract void setInputStream(InputStream is)
public abstract void releaseConnection()
throws IOException
IOException - if I/O error occurredpublic abstract void releaseConnection(boolean consumeInputStream)
throws IOException
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.
IOException - if I/O error occuredpublic <T> T readEntity(Class<T> type, Type genericType, Annotation[] anns)
readEntity in class BuiltResponseprotected <T> Object readFrom(Class<T> type, Type genericType, javax.ws.rs.core.MediaType media, Annotation[] annotations)
public boolean bufferEntity()
bufferEntity in class BuiltResponseprotected void resetEntity()
public void abortIfClosed()
abortIfClosed in class BuiltResponseCopyright © 2018 JBoss by Red Hat. All rights reserved.