org.jboss.resteasy.client
Class ClientRequest

java.lang.Object
  extended by org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl
      extended by org.jboss.resteasy.client.ClientRequest
All Implemented Interfaces:
Cloneable, ClientInterceptorRepository

Deprecated.

@Deprecated
public class ClientRequest
extends ClientInterceptorRepositoryImpl
implements Cloneable

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 $
Author:
Solomon Duskis, Bill Burke

Field Summary
protected  Map<String,Object> attributes
          Deprecated.  
protected  Object body
          Deprecated.  
protected  Annotation[] bodyAnnotations
          Deprecated.  
protected  MediaType bodyContentType
          Deprecated.  
protected  Type bodyGenericType
          Deprecated.  
protected  Class bodyType
          Deprecated.  
protected  ClientExecutor executor
          Deprecated.  
protected  String finalUri
          Deprecated.  
protected  boolean followRedirects
          Deprecated.  
protected  MultivaluedMap<String,String> formParameters
          Deprecated.  
protected  MultivaluedMap<String,Object> headers
          Deprecated.  
protected  String httpMethod
          Deprecated.  
protected  LinkHeader linkHeader
          Deprecated.  
protected  MultivaluedMap<String,String> matrixParameters
          Deprecated.  
protected  List<String> pathParameterList
          Deprecated.  
protected  MultivaluedMap<String,String> pathParameters
          Deprecated.  
protected  ResteasyProviderFactory providerFactory
          Deprecated.  
protected  MultivaluedMap<String,String> queryParameters
          Deprecated.  
protected  UriBuilderImpl uri
          Deprecated.  
 
Constructor Summary
ClientRequest(String uriTemplate)
          Deprecated.  
ClientRequest(String uriTemplate, ClientExecutor executor)
          Deprecated.  
ClientRequest(UriBuilder uri, ClientExecutor executor)
          Deprecated.  
ClientRequest(UriBuilder uri, ClientExecutor executor, ResteasyProviderFactory providerFactory)
          Deprecated.  
 
Method Summary
 ClientRequest accept(MediaType accepts)
          Deprecated.  
 ClientRequest accept(String accept)
          Deprecated.  
 ClientRequest addLink(Link link)
          Deprecated.  
 ClientRequest addLink(String title, String rel, String href, String type)
          Deprecated.  
 ClientRequest body(MediaType contentType, Object data)
          Deprecated.  
 ClientRequest body(MediaType contentType, Object data, Class type, Type genericType, Annotation[] annotations)
          Deprecated.  
 ClientRequest body(MediaType contentType, Object data, GenericType genericType)
          Deprecated.  
 ClientRequest body(MediaType contentType, Object data, Type genericType)
          Deprecated.  
 ClientRequest body(String contentType, Object data)
          Deprecated.  
 void clear()
          Deprecated. Clear this request's state so that it can be re-used
 ClientRequest cookie(Cookie cookie)
          Deprecated.  
 ClientRequest cookie(String cookieName, Object value)
          Deprecated.  
 Link create()
          Deprecated. Automatically does POST/Create pattern.
 ClientRequest createSubsequentRequest(URI uri)
          Deprecated.  
 ClientResponse delete()
          Deprecated.  
<T> ClientResponse<T>
delete(Class<T> returnType)
          Deprecated.  
<T> ClientResponse<T>
delete(Class<T> returnType, Type genericType)
          Deprecated.  
<T> ClientResponse<T>
delete(GenericType type)
          Deprecated.  
 ClientResponse execute()
          Deprecated.  
 boolean followRedirects()
          Deprecated.  
 ClientRequest followRedirects(boolean followRedirects)
          Deprecated.  
 ClientRequest formParameter(String parameterName, Object value)
          Deprecated.  
 ClientResponse get()
          Deprecated.  
<T> ClientResponse<T>
get(Class<T> returnType)
          Deprecated. Templates the returned ClientResponse for easy access to returned entity
<T> ClientResponse<T>
get(Class<T> returnType, Type genericType)
          Deprecated.  
<T> ClientResponse<T>
get(GenericType type)
          Deprecated.  
 Map<String,Object> getAttributes()
          Deprecated.  
 Object getBody()
          Deprecated.  
 Annotation[] getBodyAnnotations()
          Deprecated.  
 MediaType getBodyContentType()
          Deprecated.  
 Type getBodyGenericType()
          Deprecated.  
 Class getBodyType()
          Deprecated.  
static ClientExecutor getDefaultExecutor()
          Deprecated.  
 ClientExecutor getExecutor()
          Deprecated.  
 MultivaluedMap<String,String> getFormParameters()
          Deprecated.  
 MultivaluedMap<String,String> getHeaders()
          Deprecated.  
 MultivaluedMap<String,Object> getHeadersAsObjects()
          Deprecated.  
 String getHttpMethod()
          Deprecated.  
 MultivaluedMap<String,String> getMatrixParameters()
          Deprecated.  
 List<String> getPathParameterList()
          Deprecated.  
 MultivaluedMap<String,String> getPathParameters()
          Deprecated.  
 ResteasyProviderFactory getProviderFactory()
          Deprecated.  
 MultivaluedMap<String,String> getQueryParameters()
          Deprecated.  
<T> T
getTarget(Class<T> returnType)
          Deprecated. Tries to automatically unmarshal to target type.
 String getUri()
          Deprecated. This method populates all path, matrix, and query parameters and saves it internally.
 ClientResponse head()
          Deprecated.  
 ClientRequest header(String headerName, Object value)
          Deprecated.  
 ClientResponse httpMethod(String httpMethod)
          Deprecated.  
<T> ClientResponse<T>
httpMethod(String method, Class<T> returnType)
          Deprecated.  
<T> ClientResponse<T>
httpMethod(String method, Class<T> returnType, Type genericType)
          Deprecated.  
<T> ClientResponse<T>
httpMethod(String method, GenericType type)
          Deprecated.  
 ClientRequest matrixParameter(String parameterName, Object value)
          Deprecated.  
 ClientResponse options()
          Deprecated.  
<T> ClientResponse<T>
options(Class<T> returnType)
          Deprecated.  
<T> ClientResponse<T>
options(Class<T> returnType, Type genericType)
          Deprecated.  
<T> ClientResponse<T>
options(GenericType type)
          Deprecated.  
 void overrideUri(URI uri)
          Deprecated.  
 ClientRequest pathParameter(String parameterName, Object value)
          Deprecated.  
 ClientRequest pathParameters(Object... values)
          Deprecated.  
 ClientResponse post()
          Deprecated.  
<T> ClientResponse<T>
post(Class<T> returnType)
          Deprecated.  
<T> ClientResponse<T>
post(Class<T> returnType, Type genericType)
          Deprecated.  
<T> ClientResponse<T>
post(GenericType type)
          Deprecated.  
<T> T
postTarget(Class<T> returnType)
          Deprecated.  
 ClientResponse put()
          Deprecated.  
<T> ClientResponse<T>
put(Class<T> returnType)
          Deprecated.  
<T> ClientResponse<T>
put(Class<T> returnType, Type genericType)
          Deprecated.  
<T> ClientResponse<T>
put(GenericType type)
          Deprecated.  
 ClientRequest queryParameter(String parameterName, Object value)
          Deprecated.  
static void setDefaultExecutorClass(String classname)
          Deprecated. Set the default executor class name.
 void setHttpMethod(String httpMethod)
          Deprecated.  
protected  String toHeaderString(Object object)
          Deprecated.  
protected  String toString(Object object)
          Deprecated.  
 void writeRequestBody(MultivaluedMap<String,Object> headers, OutputStream outputStream)
          Deprecated.  
 
Methods inherited from class org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl
copyClientInterceptorsTo, getExecutionInterceptorList, getExecutionInterceptors, getInterceptors, getInterceptors, getReaderInterceptorList, getReaderInterceptors, getWriterInterceptorList, getWriterInterceptors, prefixClientInterceptorsTo, registerInterceptor, setExecutionInterceptors, setExecutionInterceptors, setReaderInterceptors, setWriterInterceptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

providerFactory

protected ResteasyProviderFactory providerFactory
Deprecated. 

uri

protected UriBuilderImpl uri
Deprecated. 

executor

protected ClientExecutor executor
Deprecated. 

headers

protected MultivaluedMap<String,Object> headers
Deprecated. 

queryParameters

protected MultivaluedMap<String,String> queryParameters
Deprecated. 

formParameters

protected MultivaluedMap<String,String> formParameters
Deprecated. 

pathParameters

protected MultivaluedMap<String,String> pathParameters
Deprecated. 

matrixParameters

protected MultivaluedMap<String,String> matrixParameters
Deprecated. 

body

protected Object body
Deprecated. 

bodyType

protected Class bodyType
Deprecated. 

bodyGenericType

protected Type bodyGenericType
Deprecated. 

bodyAnnotations

protected Annotation[] bodyAnnotations
Deprecated. 

bodyContentType

protected MediaType bodyContentType
Deprecated. 

followRedirects

protected boolean followRedirects
Deprecated. 

httpMethod

protected String httpMethod
Deprecated. 

finalUri

protected String finalUri
Deprecated. 

pathParameterList

protected List<String> pathParameterList
Deprecated. 

linkHeader

protected LinkHeader linkHeader
Deprecated. 

attributes

protected Map<String,Object> attributes
Deprecated. 
Constructor Detail

ClientRequest

public ClientRequest(String uriTemplate)
Deprecated. 

ClientRequest

public ClientRequest(String uriTemplate,
                     ClientExecutor executor)
Deprecated. 

ClientRequest

public ClientRequest(UriBuilder uri,
                     ClientExecutor executor)
Deprecated. 

ClientRequest

public ClientRequest(UriBuilder uri,
                     ClientExecutor executor,
                     ResteasyProviderFactory providerFactory)
Deprecated. 
Method Detail

setDefaultExecutorClass

public static void setDefaultExecutorClass(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


followRedirects

public boolean followRedirects()
Deprecated. 

getAttributes

public Map<String,Object> getAttributes()
Deprecated. 

followRedirects

public ClientRequest followRedirects(boolean followRedirects)
Deprecated. 

accept

public ClientRequest accept(MediaType accepts)
Deprecated. 

accept

public ClientRequest accept(String accept)
Deprecated. 

toString

protected String toString(Object object)
Deprecated. 

toHeaderString

protected String toHeaderString(Object object)
Deprecated. 

addLink

public ClientRequest addLink(Link link)
Deprecated. 

addLink

public ClientRequest addLink(String title,
                             String rel,
                             String href,
                             String type)
Deprecated. 

formParameter

public ClientRequest formParameter(String parameterName,
                                   Object value)
Deprecated. 

queryParameter

public ClientRequest queryParameter(String parameterName,
                                    Object value)
Deprecated. 

matrixParameter

public ClientRequest matrixParameter(String parameterName,
                                     Object value)
Deprecated. 

header

public ClientRequest header(String headerName,
                            Object value)
Deprecated. 

cookie

public ClientRequest cookie(String cookieName,
                            Object value)
Deprecated. 

cookie

public ClientRequest cookie(Cookie cookie)
Deprecated. 

pathParameter

public ClientRequest pathParameter(String parameterName,
                                   Object value)
Deprecated. 

pathParameters

public ClientRequest pathParameters(Object... values)
Deprecated. 

body

public ClientRequest body(String contentType,
                          Object data)
Deprecated. 

body

public ClientRequest body(MediaType contentType,
                          Object data)
Deprecated. 

body

public ClientRequest body(MediaType contentType,
                          Object data,
                          GenericType genericType)
Deprecated. 

body

public ClientRequest body(MediaType contentType,
                          Object data,
                          Type genericType)
Deprecated. 

body

public ClientRequest body(MediaType contentType,
                          Object data,
                          Class type,
                          Type genericType,
                          Annotation[] annotations)
Deprecated. 

getProviderFactory

public ResteasyProviderFactory getProviderFactory()
Deprecated. 

getExecutor

public ClientExecutor getExecutor()
Deprecated. 

getHeaders

public MultivaluedMap<String,String> getHeaders()
Deprecated. 
Returns:
a copy of all header objects converted to a string

getHeadersAsObjects

public MultivaluedMap<String,Object> getHeadersAsObjects()
Deprecated. 

getQueryParameters

public MultivaluedMap<String,String> getQueryParameters()
Deprecated. 

getFormParameters

public MultivaluedMap<String,String> getFormParameters()
Deprecated. 

getPathParameters

public MultivaluedMap<String,String> getPathParameters()
Deprecated. 

getPathParameterList

public List<String> getPathParameterList()
Deprecated. 

getMatrixParameters

public MultivaluedMap<String,String> getMatrixParameters()
Deprecated. 

getBody

public Object getBody()
Deprecated. 

getBodyType

public Class getBodyType()
Deprecated. 

getBodyGenericType

public Type getBodyGenericType()
Deprecated. 

getBodyAnnotations

public Annotation[] getBodyAnnotations()
Deprecated. 

getBodyContentType

public MediaType getBodyContentType()
Deprecated. 

getHttpMethod

public String getHttpMethod()
Deprecated. 

setHttpMethod

public void setHttpMethod(String httpMethod)
Deprecated. 

execute

public ClientResponse execute()
                       throws Exception
Deprecated. 
Throws:
Exception

writeRequestBody

public void writeRequestBody(MultivaluedMap<String,Object> headers,
                             OutputStream outputStream)
                      throws IOException
Deprecated. 
Throws:
IOException

get

public ClientResponse get()
                   throws Exception
Deprecated. 
Throws:
Exception

getTarget

public <T> T getTarget(Class<T> returnType)
            throws Exception
Deprecated. 
Tries to automatically unmarshal to target type.

Type Parameters:
T -
Parameters:
returnType -
Returns:
Throws:
Exception

get

public <T> ClientResponse<T> get(Class<T> returnType)
                      throws Exception
Deprecated. 
Templates the returned ClientResponse for easy access to returned entity

Type Parameters:
T -
Parameters:
returnType -
Returns:
Throws:
Exception

get

public <T> ClientResponse<T> get(Class<T> returnType,
                                 Type genericType)
                      throws Exception
Deprecated. 
Throws:
Exception

get

public <T> ClientResponse<T> get(GenericType type)
                      throws Exception
Deprecated. 
Throws:
Exception

head

public ClientResponse head()
                    throws Exception
Deprecated. 
Throws:
Exception

put

public ClientResponse put()
                   throws Exception
Deprecated. 
Throws:
Exception

put

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

put

public <T> ClientResponse<T> put(Class<T> returnType,
                                 Type genericType)
                      throws Exception
Deprecated. 
Throws:
Exception

put

public <T> ClientResponse<T> put(GenericType type)
                      throws Exception
Deprecated. 
Throws:
Exception

post

public ClientResponse post()
                    throws Exception
Deprecated. 
Throws:
Exception

post

public <T> ClientResponse<T> post(Class<T> returnType)
                       throws Exception
Deprecated. 
Throws:
Exception

postTarget

public <T> T postTarget(Class<T> returnType)
             throws Exception
Deprecated. 
Throws:
Exception

post

public <T> ClientResponse<T> post(Class<T> returnType,
                                  Type genericType)
                       throws Exception
Deprecated. 
Throws:
Exception

post

public <T> ClientResponse<T> post(GenericType type)
                       throws Exception
Deprecated. 
Throws:
Exception

create

public Link create()
            throws 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:
Exception, - ClientResponseFailure
Exception
ClientResponseFailure

delete

public ClientResponse delete()
                      throws Exception
Deprecated. 
Throws:
Exception

delete

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

delete

public <T> ClientResponse<T> delete(Class<T> returnType,
                                    Type genericType)
                         throws Exception
Deprecated. 
Throws:
Exception

delete

public <T> ClientResponse<T> delete(GenericType type)
                         throws Exception
Deprecated. 
Throws:
Exception

options

public ClientResponse options()
                       throws Exception
Deprecated. 
Throws:
Exception

options

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

options

public <T> ClientResponse<T> options(Class<T> returnType,
                                     Type genericType)
                          throws Exception
Deprecated. 
Throws:
Exception

options

public <T> ClientResponse<T> options(GenericType type)
                          throws Exception
Deprecated. 
Throws:
Exception

httpMethod

public ClientResponse httpMethod(String httpMethod)
                          throws Exception
Deprecated. 
Throws:
Exception

httpMethod

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

httpMethod

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

httpMethod

public <T> ClientResponse<T> httpMethod(String method,
                                        GenericType type)
                             throws Exception
Deprecated. 
Throws:
Exception

overrideUri

public void overrideUri(URI uri)
Deprecated. 

getUri

public String getUri()
              throws 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:
Exception

createSubsequentRequest

public ClientRequest createSubsequentRequest(URI uri)
Deprecated. 


Copyright © 2012. All Rights Reserved.