public abstract class AbstractBuiltResponse
extends javax.ws.rs.core.Response
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractBuiltResponse.InputStreamWrapper<T extends BuiltResponse> |
| Modifier and Type | Field and Description |
|---|---|
protected Annotation[] |
annotations |
protected byte[] |
bufferedEntity |
protected Object |
entity |
protected Class |
entityClass |
protected Type |
genericType |
protected InputStream |
is |
protected boolean |
isClosed |
protected Headers<Object> |
metadata |
protected HeaderValueProcessor |
processor |
protected String |
reason |
protected int |
status |
protected boolean |
streamFullyRead |
protected boolean |
streamRead |
| Constructor and Description |
|---|
AbstractBuiltResponse() |
AbstractBuiltResponse(int status,
String reason,
Headers<Object> metadata,
Object entity,
Annotation[] entityAnnotations) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortIfClosed() |
void |
addMethodAnnotations(Annotation[] methodAnnotations) |
void |
close() |
Set<String> |
getAllowedMethods() |
Annotation[] |
getAnnotations() |
Map<String,javax.ws.rs.core.NewCookie> |
getCookies() |
Date |
getDate() |
Object |
getEntity() |
Class |
getEntityClass() |
protected abstract InputStream |
getEntityStream() |
javax.ws.rs.core.EntityTag |
getEntityTag() |
Type |
getGenericType() |
String |
getHeaderString(String name) |
protected HeaderValueProcessor |
getHeaderValueProcessor() |
protected abstract InputStream |
getInputStream() |
Locale |
getLanguage() |
Date |
getLastModified() |
int |
getLength() |
javax.ws.rs.core.Link |
getLink(String relation) |
javax.ws.rs.core.Link.Builder |
getLinkBuilder(String relation) |
Set<javax.ws.rs.core.Link> |
getLinks() |
URI |
getLocation() |
javax.ws.rs.core.MediaType |
getMediaType() |
javax.ws.rs.core.MultivaluedMap<String,Object> |
getMetadata() |
String |
getReasonPhrase() |
int |
getStatus() |
javax.ws.rs.core.Response.StatusType |
getStatusInfo() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getStringHeaders() |
boolean |
hasEntity() |
boolean |
hasLink(String relation) |
boolean |
isClosed() |
<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) |
<T> T |
readEntity(javax.ws.rs.core.GenericType<T> entityType) |
<T> T |
readEntity(javax.ws.rs.core.GenericType<T> entityType,
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 |
setAnnotations(Annotation[] annotations) |
void |
setEntity(Object entity) |
void |
setEntityClass(Class entityClass) |
void |
setGenericType(Type genericType) |
protected abstract void |
setInputStream(InputStream is) |
void |
setMetadata(javax.ws.rs.core.MultivaluedMap<String,Object> metadata) |
void |
setReasonPhrase(String reason) |
void |
setStatus(int status) |
void |
setStreamFullyRead(Boolean b) |
void |
setStreamRead(Boolean b) |
protected String |
toHeaderString(Object header) |
protected Object entity
protected int status
protected String reason
protected Annotation[] annotations
protected Class entityClass
protected Type genericType
protected HeaderValueProcessor processor
protected volatile boolean isClosed
protected InputStream is
protected byte[] bufferedEntity
protected volatile boolean streamRead
protected volatile boolean streamFullyRead
public AbstractBuiltResponse()
public AbstractBuiltResponse(int status,
String reason,
Headers<Object> metadata,
Object entity,
Annotation[] entityAnnotations)
protected abstract InputStream getInputStream()
protected abstract void setInputStream(InputStream is)
protected abstract InputStream getEntityStream()
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 Class getEntityClass()
public void setEntityClass(Class entityClass)
protected HeaderValueProcessor getHeaderValueProcessor()
public Object getEntity()
getEntity in class javax.ws.rs.core.Responsepublic int getStatus()
getStatus in class javax.ws.rs.core.Responsepublic String getReasonPhrase()
public javax.ws.rs.core.Response.StatusType getStatusInfo()
getStatusInfo in class javax.ws.rs.core.Responsepublic javax.ws.rs.core.MultivaluedMap<String,Object> getMetadata()
getMetadata in class javax.ws.rs.core.Responsepublic void setEntity(Object entity)
public void setStatus(int status)
public void setReasonPhrase(String reason)
public Annotation[] getAnnotations()
public void addMethodAnnotations(Annotation[] methodAnnotations)
public void setAnnotations(Annotation[] annotations)
public Type getGenericType()
public void setGenericType(Type genericType)
public <T> T readEntity(Class<T> type, Annotation[] annotations)
readEntity in class javax.ws.rs.core.Responsepublic <T> T readEntity(javax.ws.rs.core.GenericType<T> entityType,
Annotation[] annotations)
readEntity in class javax.ws.rs.core.Responsepublic <T> T readEntity(Class<T> type)
readEntity in class javax.ws.rs.core.Responsepublic <T> T readEntity(javax.ws.rs.core.GenericType<T> entityType)
readEntity in class javax.ws.rs.core.Responsepublic abstract <T> T readEntity(Class<T> type, Type genericType, Annotation[] anns)
protected void resetEntity()
public void setStreamRead(Boolean b)
public void setStreamFullyRead(Boolean b)
public boolean hasEntity()
hasEntity in class javax.ws.rs.core.Responsepublic boolean isClosed()
public void abortIfClosed()
public void close()
close in interface AutoCloseableclose in class javax.ws.rs.core.Responsepublic Locale getLanguage()
getLanguage in class javax.ws.rs.core.Responsepublic int getLength()
getLength in class javax.ws.rs.core.Responsepublic javax.ws.rs.core.MediaType getMediaType()
getMediaType in class javax.ws.rs.core.Responsepublic Map<String,javax.ws.rs.core.NewCookie> getCookies()
getCookies in class javax.ws.rs.core.Responsepublic javax.ws.rs.core.EntityTag getEntityTag()
getEntityTag in class javax.ws.rs.core.Responsepublic Date getDate()
getDate in class javax.ws.rs.core.Responsepublic Date getLastModified()
getLastModified in class javax.ws.rs.core.Responsepublic Set<String> getAllowedMethods()
getAllowedMethods in class javax.ws.rs.core.Responsepublic javax.ws.rs.core.MultivaluedMap<String,String> getStringHeaders()
getStringHeaders in class javax.ws.rs.core.Responsepublic String getHeaderString(String name)
getHeaderString in class javax.ws.rs.core.Responsepublic URI getLocation()
getLocation in class javax.ws.rs.core.Responsepublic Set<javax.ws.rs.core.Link> getLinks()
getLinks in class javax.ws.rs.core.Responsepublic boolean hasLink(String relation)
hasLink in class javax.ws.rs.core.Responsepublic javax.ws.rs.core.Link getLink(String relation)
getLink in class javax.ws.rs.core.Responsepublic javax.ws.rs.core.Link.Builder getLinkBuilder(String relation)
getLinkBuilder in class javax.ws.rs.core.ResponseCopyright © 2019 JBoss by Red Hat. All rights reserved.