Class ClientRequest

  • All Implemented Interfaces:
    java.lang.Cloneable, ClientInterceptorRepository

    @Deprecated
    public class ClientRequest
    extends ClientInterceptorRepositoryImpl
    implements java.lang.Cloneable
    Deprecated.
    The Resteasy client framework in resteasy-jaxrs is replaced by the JAX-RS 2.0 compliant resteasy-client module.
    Create a hand coded request to send to the server. You call methods like accept(), body(), pathParameter() etc. to create the state of the request. Then you call a get(), post(), etc. method to execute the request. After an execution of a request, the internal state remains the same. You can invoke the request again. You can clear the request with the clear() method.
    Version:
    $Revision: 1 $
    See Also:
    Invocation
    • Field Detail

      • headers

        protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> headers
        Deprecated.
      • queryParameters

        protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> queryParameters
        Deprecated.
      • formParameters

        protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> formParameters
        Deprecated.
      • pathParameters

        protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> pathParameters
        Deprecated.
      • matrixParameters

        protected javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> matrixParameters
        Deprecated.
      • body

        protected java.lang.Object body
        Deprecated.
      • bodyType

        protected java.lang.Class bodyType
        Deprecated.
      • bodyGenericType

        protected java.lang.reflect.Type bodyGenericType
        Deprecated.
      • bodyAnnotations

        protected java.lang.annotation.Annotation[] bodyAnnotations
        Deprecated.
      • bodyContentType

        protected javax.ws.rs.core.MediaType bodyContentType
        Deprecated.
      • followRedirects

        protected boolean followRedirects
        Deprecated.
      • httpMethod

        protected java.lang.String httpMethod
        Deprecated.
      • finalUri

        protected java.lang.String finalUri
        Deprecated.
      • pathParameterList

        protected java.util.List<java.lang.String> pathParameterList
        Deprecated.
      • linkHeader

        protected LinkHeader linkHeader
        Deprecated.
      • attributes

        protected java.util.Map<java.lang.String,​java.lang.Object> attributes
        Deprecated.
      • defaultExecutorClasss

        private static java.lang.String defaultExecutorClasss
        Deprecated.
    • Constructor Detail

      • ClientRequest

        public ClientRequest​(java.lang.String uriTemplate)
        Deprecated.
      • ClientRequest

        public ClientRequest​(java.lang.String uriTemplate,
                             ClientExecutor executor)
        Deprecated.
      • ClientRequest

        public ClientRequest​(javax.ws.rs.core.UriBuilder uri,
                             ClientExecutor executor)
        Deprecated.
    • Method Detail

      • setDefaultExecutorClass

        public static void setDefaultExecutorClass​(java.lang.String classname)
        Deprecated.
        Set the default executor class name.
        Parameters:
        classname -
      • getDefaultExecutor

        public static ClientExecutor getDefaultExecutor()
        Deprecated.
      • clear

        public void clear()
        Deprecated.
        Clear this request's state so that it can be re-used
      • getBuilder

        private static javax.ws.rs.core.UriBuilder getBuilder​(java.lang.String uriTemplate)
        Deprecated.
      • followRedirects

        public boolean followRedirects()
        Deprecated.
      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Deprecated.
      • followRedirects

        public ClientRequest followRedirects​(boolean followRedirects)
        Deprecated.
      • accept

        public ClientRequest accept​(javax.ws.rs.core.MediaType accepts)
        Deprecated.
      • accept

        public ClientRequest accept​(java.lang.String accept)
        Deprecated.
      • toString

        protected java.lang.String toString​(java.lang.Object object)
        Deprecated.
      • toHeaderString

        protected java.lang.String toHeaderString​(java.lang.Object object)
        Deprecated.
      • addLink

        public ClientRequest addLink​(java.lang.String title,
                                     java.lang.String rel,
                                     java.lang.String href,
                                     java.lang.String type)
        Deprecated.
      • formParameter

        public ClientRequest formParameter​(java.lang.String parameterName,
                                           java.lang.Object value)
        Deprecated.
      • queryParameter

        public ClientRequest queryParameter​(java.lang.String parameterName,
                                            java.lang.Object value)
        Deprecated.
      • matrixParameter

        public ClientRequest matrixParameter​(java.lang.String parameterName,
                                             java.lang.Object value)
        Deprecated.
      • header

        public ClientRequest header​(java.lang.String headerName,
                                    java.lang.Object value)
        Deprecated.
      • cookie

        public ClientRequest cookie​(java.lang.String cookieName,
                                    java.lang.Object value)
        Deprecated.
      • cookie

        public ClientRequest cookie​(javax.ws.rs.core.Cookie cookie)
        Deprecated.
      • pathParameter

        public ClientRequest pathParameter​(java.lang.String parameterName,
                                           java.lang.Object value)
        Deprecated.
      • pathParameters

        public ClientRequest pathParameters​(java.lang.Object... values)
        Deprecated.
      • body

        public ClientRequest body​(java.lang.String contentType,
                                  java.lang.Object data)
        Deprecated.
      • body

        public ClientRequest body​(javax.ws.rs.core.MediaType contentType,
                                  java.lang.Object data)
        Deprecated.
      • body

        public ClientRequest body​(javax.ws.rs.core.MediaType contentType,
                                  java.lang.Object data,
                                  GenericType genericType)
        Deprecated.
      • body

        public ClientRequest body​(javax.ws.rs.core.MediaType contentType,
                                  java.lang.Object data,
                                  java.lang.reflect.Type genericType)
        Deprecated.
      • body

        public ClientRequest body​(javax.ws.rs.core.MediaType contentType,
                                  java.lang.Object data,
                                  java.lang.Class type,
                                  java.lang.reflect.Type genericType,
                                  java.lang.annotation.Annotation[] annotations)
        Deprecated.
      • getHeaders

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getHeaders()
        Deprecated.
        Returns:
        a copy of all header objects converted to a string
      • getHeadersAsObjects

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> getHeadersAsObjects()
        Deprecated.
      • getQueryParameters

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getQueryParameters()
        Deprecated.
      • getFormParameters

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getFormParameters()
        Deprecated.
      • getPathParameters

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getPathParameters()
        Deprecated.
      • getPathParameterList

        public java.util.List<java.lang.String> getPathParameterList()
        Deprecated.
      • getMatrixParameters

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getMatrixParameters()
        Deprecated.
      • getBody

        public java.lang.Object getBody()
        Deprecated.
      • getBodyType

        public java.lang.Class getBodyType()
        Deprecated.
      • getBodyGenericType

        public java.lang.reflect.Type getBodyGenericType()
        Deprecated.
      • getBodyAnnotations

        public java.lang.annotation.Annotation[] getBodyAnnotations()
        Deprecated.
      • getBodyContentType

        public javax.ws.rs.core.MediaType getBodyContentType()
        Deprecated.
      • getHttpMethod

        public java.lang.String getHttpMethod()
        Deprecated.
      • setHttpMethod

        public void setHttpMethod​(java.lang.String httpMethod)
        Deprecated.
      • execute

        public ClientResponse execute()
                               throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • writeRequestBody

        public void writeRequestBody​(javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> headers,
                                     java.io.OutputStream outputStream)
                              throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • get

        public ClientResponse get()
                           throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • getTarget

        public <T> T getTarget​(java.lang.Class<T> returnType)
                        throws java.lang.Exception
        Deprecated.
        Tries to automatically unmarshal to target type.
        Type Parameters:
        T -
        Parameters:
        returnType -
        Returns:
        Throws:
        java.lang.Exception
      • get

        public <T> ClientResponse<T> get​(java.lang.Class<T> returnType)
                                  throws java.lang.Exception
        Deprecated.
        Templates the returned ClientResponse for easy access to returned entity
        Type Parameters:
        T -
        Parameters:
        returnType -
        Returns:
        Throws:
        java.lang.Exception
      • get

        public <T> ClientResponse<T> get​(java.lang.Class<T> returnType,
                                         java.lang.reflect.Type genericType)
                                  throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • get

        public <T> ClientResponse<T> get​(GenericType type)
                                  throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • head

        public ClientResponse head()
                            throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • put

        public ClientResponse put()
                           throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • put

        public <T> ClientResponse<T> put​(java.lang.Class<T> returnType)
                                  throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • put

        public <T> ClientResponse<T> put​(java.lang.Class<T> returnType,
                                         java.lang.reflect.Type genericType)
                                  throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • put

        public <T> ClientResponse<T> put​(GenericType type)
                                  throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • post

        public ClientResponse post()
                            throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • post

        public <T> ClientResponse<T> post​(java.lang.Class<T> returnType)
                                   throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • postTarget

        public <T> T postTarget​(java.lang.Class<T> returnType)
                         throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • post

        public <T> ClientResponse<T> post​(java.lang.Class<T> returnType,
                                          java.lang.reflect.Type genericType)
                                   throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • post

        public <T> ClientResponse<T> post​(GenericType type)
                                   throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • create

        public Link create()
                    throws java.lang.Exception,
                           ClientResponseFailure
        Deprecated.
        Automatically does POST/Create pattern. Will throw a ClientResponseFailure if status is something other than 201
        Returns:
        Link to created resource
        Throws:
        java.lang.Exception
        ClientResponseFailure
      • delete

        public ClientResponse delete()
                              throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • delete

        public <T> ClientResponse<T> delete​(java.lang.Class<T> returnType)
                                     throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • delete

        public <T> ClientResponse<T> delete​(java.lang.Class<T> returnType,
                                            java.lang.reflect.Type genericType)
                                     throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • delete

        public <T> ClientResponse<T> delete​(GenericType type)
                                     throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • options

        public ClientResponse options()
                               throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • options

        public <T> ClientResponse<T> options​(java.lang.Class<T> returnType)
                                      throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • options

        public <T> ClientResponse<T> options​(java.lang.Class<T> returnType,
                                             java.lang.reflect.Type genericType)
                                      throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • options

        public <T> ClientResponse<T> options​(GenericType type)
                                      throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • httpMethod

        public ClientResponse httpMethod​(java.lang.String httpMethod)
                                  throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • httpMethod

        public <T> ClientResponse<T> httpMethod​(java.lang.String method,
                                                java.lang.Class<T> returnType)
                                         throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • httpMethod

        public <T> ClientResponse<T> httpMethod​(java.lang.String method,
                                                java.lang.Class<T> returnType,
                                                java.lang.reflect.Type genericType)
                                         throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • httpMethod

        public <T> ClientResponse<T> httpMethod​(java.lang.String method,
                                                GenericType type)
                                         throws java.lang.Exception
        Deprecated.
        Throws:
        java.lang.Exception
      • overrideUri

        public void overrideUri​(java.net.URI uri)
        Deprecated.
      • getUri

        public java.lang.String getUri()
                                throws java.lang.Exception
        Deprecated.
        This method populates all path, matrix, and query parameters and saves it internally. Once its called once it returns the cached value.
        Returns:
        Throws:
        java.lang.Exception
      • createSubsequentRequest

        public ClientRequest createSubsequentRequest​(java.net.URI uri)
        Deprecated.