Package org.jboss.resteasy.client
Class ClientRequest
- java.lang.Object
-
- org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl
-
- org.jboss.resteasy.client.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 Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>attributesDeprecated.protected java.lang.ObjectbodyDeprecated.protected java.lang.annotation.Annotation[]bodyAnnotationsDeprecated.protected javax.ws.rs.core.MediaTypebodyContentTypeDeprecated.protected java.lang.reflect.TypebodyGenericTypeDeprecated.protected java.lang.ClassbodyTypeDeprecated.private static java.lang.StringdefaultExecutorClasssDeprecated.protected ClientExecutorexecutorDeprecated.protected java.lang.StringfinalUriDeprecated.protected booleanfollowRedirectsDeprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>formParametersDeprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object>headersDeprecated.protected java.lang.StringhttpMethodDeprecated.protected LinkHeaderlinkHeaderDeprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>matrixParametersDeprecated.protected java.util.List<java.lang.String>pathParameterListDeprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>pathParametersDeprecated.protected ResteasyProviderFactoryproviderFactoryDeprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>queryParametersDeprecated.protected ResteasyUriBuilderuriDeprecated.
-
Constructor Summary
Constructors Constructor Description ClientRequest(java.lang.String uriTemplate)Deprecated.ClientRequest(java.lang.String uriTemplate, ClientExecutor executor)Deprecated.ClientRequest(javax.ws.rs.core.UriBuilder uri, ClientExecutor executor)Deprecated.ClientRequest(javax.ws.rs.core.UriBuilder uri, ClientExecutor executor, ResteasyProviderFactory providerFactory)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ClientRequestaccept(java.lang.String accept)Deprecated.ClientRequestaccept(javax.ws.rs.core.MediaType accepts)Deprecated.ClientRequestaddLink(java.lang.String title, java.lang.String rel, java.lang.String href, java.lang.String type)Deprecated.ClientRequestaddLink(Link link)Deprecated.ClientRequestbody(java.lang.String contentType, java.lang.Object data)Deprecated.ClientRequestbody(javax.ws.rs.core.MediaType contentType, java.lang.Object data)Deprecated.ClientRequestbody(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.ClientRequestbody(javax.ws.rs.core.MediaType contentType, java.lang.Object data, java.lang.reflect.Type genericType)Deprecated.ClientRequestbody(javax.ws.rs.core.MediaType contentType, java.lang.Object data, GenericType genericType)Deprecated.voidclear()Deprecated.Clear this request's state so that it can be re-usedClientRequestcookie(java.lang.String cookieName, java.lang.Object value)Deprecated.ClientRequestcookie(javax.ws.rs.core.Cookie cookie)Deprecated.Linkcreate()Deprecated.Automatically does POST/Create pattern.ClientRequestcreateSubsequentRequest(java.net.URI uri)Deprecated.ClientResponsedelete()Deprecated.<T> ClientResponse<T>delete(java.lang.Class<T> returnType)Deprecated.<T> ClientResponse<T>delete(java.lang.Class<T> returnType, java.lang.reflect.Type genericType)Deprecated.<T> ClientResponse<T>delete(GenericType type)Deprecated.ClientResponseexecute()Deprecated.booleanfollowRedirects()Deprecated.ClientRequestfollowRedirects(boolean followRedirects)Deprecated.ClientRequestformParameter(java.lang.String parameterName, java.lang.Object value)Deprecated.ClientResponseget()Deprecated.<T> ClientResponse<T>get(java.lang.Class<T> returnType)Deprecated.Templates the returned ClientResponse for easy access to returned entity<T> ClientResponse<T>get(java.lang.Class<T> returnType, java.lang.reflect.Type genericType)Deprecated.<T> ClientResponse<T>get(GenericType type)Deprecated.java.util.Map<java.lang.String,java.lang.Object>getAttributes()Deprecated.java.lang.ObjectgetBody()Deprecated.java.lang.annotation.Annotation[]getBodyAnnotations()Deprecated.javax.ws.rs.core.MediaTypegetBodyContentType()Deprecated.java.lang.reflect.TypegetBodyGenericType()Deprecated.java.lang.ClassgetBodyType()Deprecated.private static javax.ws.rs.core.UriBuildergetBuilder(java.lang.String uriTemplate)Deprecated.static ClientExecutorgetDefaultExecutor()Deprecated.ClientExecutorgetExecutor()Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>getFormParameters()Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>getHeaders()Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object>getHeadersAsObjects()Deprecated.java.lang.StringgetHttpMethod()Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>getMatrixParameters()Deprecated.java.util.List<java.lang.String>getPathParameterList()Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>getPathParameters()Deprecated.ResteasyProviderFactorygetProviderFactory()Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>getQueryParameters()Deprecated.<T> TgetTarget(java.lang.Class<T> returnType)Deprecated.Tries to automatically unmarshal to target type.java.lang.StringgetUri()Deprecated.This method populates all path, matrix, and query parameters and saves it internally.ClientResponsehead()Deprecated.ClientRequestheader(java.lang.String headerName, java.lang.Object value)Deprecated.ClientResponsehttpMethod(java.lang.String httpMethod)Deprecated.<T> ClientResponse<T>httpMethod(java.lang.String method, java.lang.Class<T> returnType)Deprecated.<T> ClientResponse<T>httpMethod(java.lang.String method, java.lang.Class<T> returnType, java.lang.reflect.Type genericType)Deprecated.<T> ClientResponse<T>httpMethod(java.lang.String method, GenericType type)Deprecated.ClientRequestmatrixParameter(java.lang.String parameterName, java.lang.Object value)Deprecated.ClientResponseoptions()Deprecated.<T> ClientResponse<T>options(java.lang.Class<T> returnType)Deprecated.<T> ClientResponse<T>options(java.lang.Class<T> returnType, java.lang.reflect.Type genericType)Deprecated.<T> ClientResponse<T>options(GenericType type)Deprecated.voidoverrideUri(java.net.URI uri)Deprecated.ClientRequestpathParameter(java.lang.String parameterName, java.lang.Object value)Deprecated.ClientRequestpathParameters(java.lang.Object... values)Deprecated.ClientResponsepost()Deprecated.<T> ClientResponse<T>post(java.lang.Class<T> returnType)Deprecated.<T> ClientResponse<T>post(java.lang.Class<T> returnType, java.lang.reflect.Type genericType)Deprecated.<T> ClientResponse<T>post(GenericType type)Deprecated.<T> TpostTarget(java.lang.Class<T> returnType)Deprecated.ClientResponseput()Deprecated.<T> ClientResponse<T>put(java.lang.Class<T> returnType)Deprecated.<T> ClientResponse<T>put(java.lang.Class<T> returnType, java.lang.reflect.Type genericType)Deprecated.<T> ClientResponse<T>put(GenericType type)Deprecated.ClientRequestqueryParameter(java.lang.String parameterName, java.lang.Object value)Deprecated.static voidsetDefaultExecutorClass(java.lang.String classname)Deprecated.Set the default executor class name.voidsetHttpMethod(java.lang.String httpMethod)Deprecated.protected java.lang.StringtoHeaderString(java.lang.Object object)Deprecated.protected java.lang.StringtoString(java.lang.Object object)Deprecated.voidwriteRequestBody(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers, java.io.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
-
-
-
-
Field Detail
-
providerFactory
protected ResteasyProviderFactory providerFactory
Deprecated.
-
uri
protected ResteasyUriBuilder uri
Deprecated.
-
executor
protected ClientExecutor executor
Deprecated.
-
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.
-
ClientRequest
public ClientRequest(javax.ws.rs.core.UriBuilder uri, ClientExecutor executor, ResteasyProviderFactory providerFactory)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(Link link)
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.
-
getProviderFactory
public ResteasyProviderFactory getProviderFactory()
Deprecated.
-
getExecutor
public ClientExecutor getExecutor()
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.IOExceptionDeprecated.- 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.ExceptionDeprecated.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.ExceptionDeprecated.- 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.ExceptionClientResponseFailure
-
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.ExceptionDeprecated.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.
-
-