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>
attributes
Deprecated.protected java.lang.Object
body
Deprecated.protected java.lang.annotation.Annotation[]
bodyAnnotations
Deprecated.protected javax.ws.rs.core.MediaType
bodyContentType
Deprecated.protected java.lang.reflect.Type
bodyGenericType
Deprecated.protected java.lang.Class
bodyType
Deprecated.private static java.lang.String
defaultExecutorClasss
Deprecated.protected ClientExecutor
executor
Deprecated.protected java.lang.String
finalUri
Deprecated.protected boolean
followRedirects
Deprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
formParameters
Deprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object>
headers
Deprecated.protected java.lang.String
httpMethod
Deprecated.protected LinkHeader
linkHeader
Deprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
matrixParameters
Deprecated.protected java.util.List<java.lang.String>
pathParameterList
Deprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
pathParameters
Deprecated.protected ResteasyProviderFactory
providerFactory
Deprecated.protected javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
queryParameters
Deprecated.protected ResteasyUriBuilder
uri
Deprecated.
-
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 ClientRequest
accept(java.lang.String accept)
Deprecated.ClientRequest
accept(javax.ws.rs.core.MediaType accepts)
Deprecated.ClientRequest
addLink(java.lang.String title, java.lang.String rel, java.lang.String href, java.lang.String type)
Deprecated.ClientRequest
addLink(Link link)
Deprecated.ClientRequest
body(java.lang.String contentType, java.lang.Object data)
Deprecated.ClientRequest
body(javax.ws.rs.core.MediaType contentType, java.lang.Object data)
Deprecated.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.ClientRequest
body(javax.ws.rs.core.MediaType contentType, java.lang.Object data, java.lang.reflect.Type genericType)
Deprecated.ClientRequest
body(javax.ws.rs.core.MediaType contentType, java.lang.Object data, GenericType genericType)
Deprecated.void
clear()
Deprecated.Clear this request's state so that it can be re-usedClientRequest
cookie(java.lang.String cookieName, java.lang.Object value)
Deprecated.ClientRequest
cookie(javax.ws.rs.core.Cookie cookie)
Deprecated.Link
create()
Deprecated.Automatically does POST/Create pattern.ClientRequest
createSubsequentRequest(java.net.URI uri)
Deprecated.ClientResponse
delete()
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.ClientResponse
execute()
Deprecated.boolean
followRedirects()
Deprecated.ClientRequest
followRedirects(boolean followRedirects)
Deprecated.ClientRequest
formParameter(java.lang.String parameterName, java.lang.Object value)
Deprecated.ClientResponse
get()
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.Object
getBody()
Deprecated.java.lang.annotation.Annotation[]
getBodyAnnotations()
Deprecated.javax.ws.rs.core.MediaType
getBodyContentType()
Deprecated.java.lang.reflect.Type
getBodyGenericType()
Deprecated.java.lang.Class
getBodyType()
Deprecated.private static javax.ws.rs.core.UriBuilder
getBuilder(java.lang.String uriTemplate)
Deprecated.static ClientExecutor
getDefaultExecutor()
Deprecated.ClientExecutor
getExecutor()
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.String
getHttpMethod()
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.ResteasyProviderFactory
getProviderFactory()
Deprecated.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String>
getQueryParameters()
Deprecated.<T> T
getTarget(java.lang.Class<T> returnType)
Deprecated.Tries to automatically unmarshal to target type.java.lang.String
getUri()
Deprecated.This method populates all path, matrix, and query parameters and saves it internally.ClientResponse
head()
Deprecated.ClientRequest
header(java.lang.String headerName, java.lang.Object value)
Deprecated.ClientResponse
httpMethod(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.ClientRequest
matrixParameter(java.lang.String parameterName, java.lang.Object value)
Deprecated.ClientResponse
options()
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.void
overrideUri(java.net.URI uri)
Deprecated.ClientRequest
pathParameter(java.lang.String parameterName, java.lang.Object value)
Deprecated.ClientRequest
pathParameters(java.lang.Object... values)
Deprecated.ClientResponse
post()
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> T
postTarget(java.lang.Class<T> returnType)
Deprecated.ClientResponse
put()
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.ClientRequest
queryParameter(java.lang.String parameterName, java.lang.Object value)
Deprecated.static void
setDefaultExecutorClass(java.lang.String classname)
Deprecated.Set the default executor class name.void
setHttpMethod(java.lang.String httpMethod)
Deprecated.protected java.lang.String
toHeaderString(java.lang.Object object)
Deprecated.protected java.lang.String
toString(java.lang.Object object)
Deprecated.void
writeRequestBody(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.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.
-
-