|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl org.jboss.resteasy.client.ClientRequest
public class ClientRequest
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl |
---|
ClientInterceptorRepositoryImpl.InterceptorType |
Field Summary | |
---|---|
protected ResteasyProviderFactory |
providerFactory
|
Constructor Summary | |
---|---|
ClientRequest(java.lang.String uriTemplate)
|
|
ClientRequest(java.lang.String uriTemplate,
ClientExecutor executor)
|
|
ClientRequest(UriBuilder uri,
ClientExecutor executor)
|
|
ClientRequest(UriBuilder uri,
ClientExecutor executor,
ResteasyProviderFactory providerFactory)
|
Method Summary | ||
---|---|---|
ClientRequest |
accept(MediaType accepts)
|
|
ClientRequest |
accept(java.lang.String accept)
|
|
ClientRequest |
addLink(Link link)
|
|
ClientRequest |
addLink(java.lang.String title,
java.lang.String rel,
java.lang.String href,
java.lang.String type)
|
|
ClientRequest |
body(MediaType contentType,
java.lang.Object data)
|
|
ClientRequest |
body(MediaType contentType,
java.lang.Object data,
java.lang.Class type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations)
|
|
ClientRequest |
body(MediaType contentType,
java.lang.Object data,
GenericType genericType)
|
|
ClientRequest |
body(MediaType contentType,
java.lang.Object data,
java.lang.reflect.Type genericType)
|
|
ClientRequest |
body(java.lang.String contentType,
java.lang.Object data)
|
|
void |
clear()
Clear this request's state so that it can be re-used |
|
ClientRequest |
cookie(Cookie cookie)
|
|
ClientRequest |
cookie(java.lang.String cookieName,
java.lang.Object value)
|
|
Link |
create()
Automatically does POST/Create pattern. |
|
ClientResponse |
delete()
|
|
|
delete(java.lang.Class<T> returnType)
|
|
|
delete(java.lang.Class<T> returnType,
java.lang.reflect.Type genericType)
|
|
|
delete(GenericType type)
|
|
ClientResponse |
execute()
|
|
boolean |
followRedirects()
|
|
ClientRequest |
followRedirects(boolean followRedirects)
|
|
ClientRequest |
formParameter(java.lang.String parameterName,
java.lang.Object value)
|
|
ClientResponse |
get()
|
|
|
get(java.lang.Class<T> returnType)
Templates the returned ClientResponse for easy access to returned entity |
|
|
get(java.lang.Class<T> returnType,
java.lang.reflect.Type genericType)
|
|
|
get(GenericType type)
|
|
java.lang.Object |
getBody()
|
|
java.lang.annotation.Annotation[] |
getBodyAnnotations()
|
|
MediaType |
getBodyContentType()
|
|
java.lang.reflect.Type |
getBodyGenericType()
|
|
java.lang.Class |
getBodyType()
|
|
static ClientExecutor |
getDefaultExecutor()
|
|
ClientExecutor |
getExecutor()
|
|
MultivaluedMap<java.lang.String,java.lang.String> |
getFormParameters()
|
|
MultivaluedMap<java.lang.String,java.lang.String> |
getHeaders()
|
|
java.lang.String |
getHttpMethod()
|
|
MultivaluedMap<java.lang.String,java.lang.String> |
getMatrixParameters()
|
|
java.util.List<java.lang.String> |
getPathParameterList()
|
|
MultivaluedMap<java.lang.String,java.lang.String> |
getPathParameters()
|
|
ResteasyProviderFactory |
getProviderFactory()
|
|
MultivaluedMap<java.lang.String,java.lang.String> |
getQueryParameters()
|
|
|
getTarget(java.lang.Class<T> returnType)
Tries to automatically unmarshal to target type. |
|
java.lang.String |
getUri()
This method populates all path, matrix, and query parameters and saves it internally. |
|
ClientResponse |
head()
|
|
ClientRequest |
header(java.lang.String headerName,
java.lang.Object value)
|
|
ClientResponse |
httpMethod(java.lang.String httpMethod)
|
|
|
httpMethod(java.lang.String method,
java.lang.Class<T> returnType)
|
|
|
httpmethod(java.lang.String method,
java.lang.Class<T> returnType,
java.lang.reflect.Type genericType)
|
|
|
httpMethod(java.lang.String method,
GenericType type)
|
|
ClientRequest |
matrixParameter(java.lang.String parameterName,
java.lang.Object value)
|
|
ClientResponse |
options()
|
|
|
options(java.lang.Class<T> returnType)
|
|
|
options(java.lang.Class<T> returnType,
java.lang.reflect.Type genericType)
|
|
|
options(GenericType type)
|
|
void |
overrideUri(java.net.URI uri)
|
|
ClientRequest |
pathParameter(java.lang.String parameterName,
java.lang.Object value)
|
|
ClientRequest |
pathParameters(java.lang.Object... values)
|
|
ClientResponse |
post()
|
|
|
post(java.lang.Class<T> returnType)
|
|
|
post(java.lang.Class<T> returnType,
java.lang.reflect.Type genericType)
|
|
|
post(GenericType type)
|
|
|
postTarget(java.lang.Class<T> returnType)
|
|
ClientResponse |
put()
|
|
|
put(java.lang.Class<T> returnType)
|
|
|
put(java.lang.Class<T> returnType,
java.lang.reflect.Type genericType)
|
|
|
put(GenericType type)
|
|
ClientRequest |
queryParameter(java.lang.String parameterName,
java.lang.Object value)
|
|
static void |
setDefaultExecutorClass(java.lang.String classname,
boolean createPerRequestInstance)
Set the default executor class name. |
|
void |
setHttpMethod(java.lang.String httpMethod)
|
|
protected java.lang.String |
toHeaderString(java.lang.Object object)
|
|
protected java.lang.String |
toString(java.lang.Object object)
|
|
void |
writeRequestBody(MultivaluedMap<java.lang.String,java.lang.Object> headers,
java.io.OutputStream outputStream)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResteasyProviderFactory providerFactory
Constructor Detail |
---|
public ClientRequest(java.lang.String uriTemplate)
public ClientRequest(java.lang.String uriTemplate, ClientExecutor executor)
public ClientRequest(UriBuilder uri, ClientExecutor executor)
public ClientRequest(UriBuilder uri, ClientExecutor executor, ResteasyProviderFactory providerFactory)
Method Detail |
---|
public static void setDefaultExecutorClass(java.lang.String classname, boolean createPerRequestInstance)
classname
- createPerRequestInstance
- whether the instance can be used by every requestpublic static ClientExecutor getDefaultExecutor()
public void clear()
public boolean followRedirects()
public ClientRequest followRedirects(boolean followRedirects)
public ClientRequest accept(MediaType accepts)
public ClientRequest accept(java.lang.String accept)
protected java.lang.String toString(java.lang.Object object)
protected java.lang.String toHeaderString(java.lang.Object object)
public ClientRequest addLink(Link link)
public ClientRequest addLink(java.lang.String title, java.lang.String rel, java.lang.String href, java.lang.String type)
public ClientRequest formParameter(java.lang.String parameterName, java.lang.Object value)
public ClientRequest queryParameter(java.lang.String parameterName, java.lang.Object value)
public ClientRequest matrixParameter(java.lang.String parameterName, java.lang.Object value)
public ClientRequest header(java.lang.String headerName, java.lang.Object value)
public ClientRequest cookie(java.lang.String cookieName, java.lang.Object value)
public ClientRequest cookie(Cookie cookie)
public ClientRequest pathParameter(java.lang.String parameterName, java.lang.Object value)
public ClientRequest pathParameters(java.lang.Object... values)
public ClientRequest body(java.lang.String contentType, java.lang.Object data)
public ClientRequest body(MediaType contentType, java.lang.Object data)
public ClientRequest body(MediaType contentType, java.lang.Object data, GenericType genericType)
public ClientRequest body(MediaType contentType, java.lang.Object data, java.lang.reflect.Type genericType)
public ClientRequest body(MediaType contentType, java.lang.Object data, java.lang.Class type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations)
public ResteasyProviderFactory getProviderFactory()
public ClientExecutor getExecutor()
public MultivaluedMap<java.lang.String,java.lang.String> getHeaders()
public MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters()
public MultivaluedMap<java.lang.String,java.lang.String> getFormParameters()
public MultivaluedMap<java.lang.String,java.lang.String> getPathParameters()
public java.util.List<java.lang.String> getPathParameterList()
public MultivaluedMap<java.lang.String,java.lang.String> getMatrixParameters()
public java.lang.Object getBody()
public java.lang.Class getBodyType()
public java.lang.reflect.Type getBodyGenericType()
public java.lang.annotation.Annotation[] getBodyAnnotations()
public MediaType getBodyContentType()
public java.lang.String getHttpMethod()
public void setHttpMethod(java.lang.String httpMethod)
public ClientResponse execute() throws java.lang.Exception
java.lang.Exception
public void writeRequestBody(MultivaluedMap<java.lang.String,java.lang.Object> headers, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public ClientResponse get() throws java.lang.Exception
java.lang.Exception
public <T> T getTarget(java.lang.Class<T> returnType) throws java.lang.Exception
T
- returnType
-
java.lang.Exception
public <T> ClientResponse<T> get(java.lang.Class<T> returnType) throws java.lang.Exception
T
- returnType
-
java.lang.Exception
public <T> ClientResponse<T> get(java.lang.Class<T> returnType, java.lang.reflect.Type genericType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> get(GenericType type) throws java.lang.Exception
java.lang.Exception
public ClientResponse head() throws java.lang.Exception
java.lang.Exception
public ClientResponse put() throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> put(java.lang.Class<T> returnType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> put(java.lang.Class<T> returnType, java.lang.reflect.Type genericType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> put(GenericType type) throws java.lang.Exception
java.lang.Exception
public ClientResponse post() throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> post(java.lang.Class<T> returnType) throws java.lang.Exception
java.lang.Exception
public <T> T postTarget(java.lang.Class<T> returnType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> post(java.lang.Class<T> returnType, java.lang.reflect.Type genericType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> post(GenericType type) throws java.lang.Exception
java.lang.Exception
public Link create() throws java.lang.Exception, ClientResponseFailure
Exception,
- ClientResponseFailure
java.lang.Exception
ClientResponseFailure
public ClientResponse delete() throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> delete(java.lang.Class<T> returnType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> delete(java.lang.Class<T> returnType, java.lang.reflect.Type genericType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> delete(GenericType type) throws java.lang.Exception
java.lang.Exception
public ClientResponse options() throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> options(java.lang.Class<T> returnType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> options(java.lang.Class<T> returnType, java.lang.reflect.Type genericType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> options(GenericType type) throws java.lang.Exception
java.lang.Exception
public ClientResponse httpMethod(java.lang.String httpMethod) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> httpMethod(java.lang.String method, java.lang.Class<T> returnType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> httpmethod(java.lang.String method, java.lang.Class<T> returnType, java.lang.reflect.Type genericType) throws java.lang.Exception
java.lang.Exception
public <T> ClientResponse<T> httpMethod(java.lang.String method, GenericType type) throws java.lang.Exception
java.lang.Exception
public void overrideUri(java.net.URI uri)
public java.lang.String getUri() throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |