Package org.glassfish.jersey.client
Class InboundJaxrsResponse
- java.lang.Object
-
- javax.ws.rs.core.Response
-
- org.glassfish.jersey.client.InboundJaxrsResponse
-
- All Implemented Interfaces:
java.lang.AutoCloseable
class InboundJaxrsResponse extends javax.ws.rs.core.ResponseImplementation of an inbound client-side JAX-RSResponsemessage.This response delegates method calls to the underlying
client response contextand ensures that all request-scoped method invocations are run in the proper request scope.
-
-
Field Summary
Fields Modifier and Type Field Description private ClientResponsecontextprivate RequestContextrequestContextprivate RequestScopescope
-
Constructor Summary
Constructors Constructor Description InboundJaxrsResponse(ClientResponse context, RequestScope scope)Create new scoped client response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbufferEntity()voidclose()java.util.Set<java.lang.String>getAllowedMethods()java.util.Map<java.lang.String,javax.ws.rs.core.NewCookie>getCookies()java.util.DategetDate()java.lang.ObjectgetEntity()javax.ws.rs.core.EntityTaggetEntityTag()java.lang.StringgetHeaderString(java.lang.String name)java.util.LocalegetLanguage()java.util.DategetLastModified()intgetLength()javax.ws.rs.core.LinkgetLink(java.lang.String relation)javax.ws.rs.core.Link.BuildergetLinkBuilder(java.lang.String relation)java.util.Set<javax.ws.rs.core.Link>getLinks()java.net.URIgetLocation()javax.ws.rs.core.MediaTypegetMediaType()javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object>getMetadata()intgetStatus()javax.ws.rs.core.Response.StatusTypegetStatusInfo()javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>getStringHeaders()booleanhasEntity()booleanhasLink(java.lang.String relation)<T> TreadEntity(java.lang.Class<T> entityType)<T> TreadEntity(java.lang.Class<T> entityType, java.lang.annotation.Annotation[] annotations)<T> TreadEntity(javax.ws.rs.core.GenericType<T> entityType)<T> TreadEntity(javax.ws.rs.core.GenericType<T> entityType, java.lang.annotation.Annotation[] annotations)private <T> TrunInScopeIfPossible(Producer<T> producer)java.lang.StringtoString()
-
-
-
Field Detail
-
context
private final ClientResponse context
-
scope
private final RequestScope scope
-
requestContext
private final RequestContext requestContext
-
-
Constructor Detail
-
InboundJaxrsResponse
public InboundJaxrsResponse(ClientResponse context, RequestScope scope)
Create new scoped client response.- Parameters:
context- jersey client response context.scope- request scope instance.
-
-
Method Detail
-
getStatus
public int getStatus()
- Specified by:
getStatusin classjavax.ws.rs.core.Response
-
getStatusInfo
public javax.ws.rs.core.Response.StatusType getStatusInfo()
- Specified by:
getStatusInfoin classjavax.ws.rs.core.Response
-
getEntity
public java.lang.Object getEntity() throws java.lang.IllegalStateException- Specified by:
getEntityin classjavax.ws.rs.core.Response- Throws:
java.lang.IllegalStateException
-
readEntity
public <T> T readEntity(java.lang.Class<T> entityType) throws javax.ws.rs.ProcessingException, java.lang.IllegalStateException- Specified by:
readEntityin classjavax.ws.rs.core.Response- Throws:
javax.ws.rs.ProcessingExceptionjava.lang.IllegalStateException
-
readEntity
public <T> T readEntity(javax.ws.rs.core.GenericType<T> entityType) throws javax.ws.rs.ProcessingException, java.lang.IllegalStateException- Specified by:
readEntityin classjavax.ws.rs.core.Response- Throws:
javax.ws.rs.ProcessingExceptionjava.lang.IllegalStateException
-
readEntity
public <T> T readEntity(java.lang.Class<T> entityType, java.lang.annotation.Annotation[] annotations) throws javax.ws.rs.ProcessingException, java.lang.IllegalStateException- Specified by:
readEntityin classjavax.ws.rs.core.Response- Throws:
javax.ws.rs.ProcessingExceptionjava.lang.IllegalStateException
-
readEntity
public <T> T readEntity(javax.ws.rs.core.GenericType<T> entityType, java.lang.annotation.Annotation[] annotations) throws javax.ws.rs.ProcessingException, java.lang.IllegalStateException- Specified by:
readEntityin classjavax.ws.rs.core.Response- Throws:
javax.ws.rs.ProcessingExceptionjava.lang.IllegalStateException
-
hasEntity
public boolean hasEntity()
- Specified by:
hasEntityin classjavax.ws.rs.core.Response
-
bufferEntity
public boolean bufferEntity() throws javax.ws.rs.ProcessingException- Specified by:
bufferEntityin classjavax.ws.rs.core.Response- Throws:
javax.ws.rs.ProcessingException
-
close
public void close() throws javax.ws.rs.ProcessingException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein classjavax.ws.rs.core.Response- Throws:
javax.ws.rs.ProcessingException
-
getHeaderString
public java.lang.String getHeaderString(java.lang.String name)
- Specified by:
getHeaderStringin classjavax.ws.rs.core.Response
-
getStringHeaders
public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getStringHeaders()
- Specified by:
getStringHeadersin classjavax.ws.rs.core.Response
-
getMediaType
public javax.ws.rs.core.MediaType getMediaType()
- Specified by:
getMediaTypein classjavax.ws.rs.core.Response
-
getLanguage
public java.util.Locale getLanguage()
- Specified by:
getLanguagein classjavax.ws.rs.core.Response
-
getLength
public int getLength()
- Specified by:
getLengthin classjavax.ws.rs.core.Response
-
getCookies
public java.util.Map<java.lang.String,javax.ws.rs.core.NewCookie> getCookies()
- Specified by:
getCookiesin classjavax.ws.rs.core.Response
-
getEntityTag
public javax.ws.rs.core.EntityTag getEntityTag()
- Specified by:
getEntityTagin classjavax.ws.rs.core.Response
-
getDate
public java.util.Date getDate()
- Specified by:
getDatein classjavax.ws.rs.core.Response
-
getLastModified
public java.util.Date getLastModified()
- Specified by:
getLastModifiedin classjavax.ws.rs.core.Response
-
getAllowedMethods
public java.util.Set<java.lang.String> getAllowedMethods()
- Specified by:
getAllowedMethodsin classjavax.ws.rs.core.Response
-
getLocation
public java.net.URI getLocation()
- Specified by:
getLocationin classjavax.ws.rs.core.Response
-
getLinks
public java.util.Set<javax.ws.rs.core.Link> getLinks()
- Specified by:
getLinksin classjavax.ws.rs.core.Response
-
hasLink
public boolean hasLink(java.lang.String relation)
- Specified by:
hasLinkin classjavax.ws.rs.core.Response
-
getLink
public javax.ws.rs.core.Link getLink(java.lang.String relation)
- Specified by:
getLinkin classjavax.ws.rs.core.Response
-
getLinkBuilder
public javax.ws.rs.core.Link.Builder getLinkBuilder(java.lang.String relation)
- Specified by:
getLinkBuilderin classjavax.ws.rs.core.Response
-
getMetadata
public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> getMetadata()
- Specified by:
getMetadatain classjavax.ws.rs.core.Response
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
runInScopeIfPossible
private <T> T runInScopeIfPossible(Producer<T> producer)
-
-