org.overlord.sramp.atom.client
Class ClientRequest

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

public class ClientRequest
extends org.jboss.resteasy.client.ClientRequest

Extends the RESTEasy ClientRequest class in order to provide a ClientExecutor and ResteasyProviderFactory without requiring clients to pass them in. Additionally, this class overrides the various http methods (post, get, put) in order to implement some error handling. These methods will throw an appropriate exception now (when possible), rather than a less meaningful RESTEasy generic exception. When communicating with the JBoss s-ramp implementation, this error handling should work well (it should throw an exception that also includes the server-side root-cause stack trace). When connecting to some other s-ramp implementation, your mileage may vary.

Author:
eric.wittmann@redhat.com

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl
org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl.InterceptorType
 
Field Summary
 
Fields inherited from class org.jboss.resteasy.client.ClientRequest
attributes, body, bodyAnnotations, bodyContentType, bodyGenericType, bodyType, executor, finalUri, followRedirects, formParameters, headers, httpMethod, linkHeader, matrixParameters, pathParameterList, pathParameters, queryParameters, uri
 
Constructor Summary
ClientRequest(String uriTemplate)
          Constructor.
 
Method Summary
 org.jboss.resteasy.client.ClientResponse delete()
           
<T> org.jboss.resteasy.client.ClientResponse<T>
delete(Class<T> returnType)
           
 org.jboss.resteasy.client.ClientResponse get()
           
<T> org.jboss.resteasy.client.ClientResponse<T>
get(Class<T> returnType)
           
 org.jboss.resteasy.client.ClientResponse post()
           
<T> org.jboss.resteasy.client.ClientResponse<T>
post(Class<T> returnType)
           
 org.jboss.resteasy.client.ClientResponse put()
           
<T> org.jboss.resteasy.client.ClientResponse<T>
put(Class<T> returnType)
           
 
Methods inherited from class org.jboss.resteasy.client.ClientRequest
accept, accept, addLink, addLink, body, body, body, body, body, clear, cookie, cookie, create, createSubsequentRequest, delete, delete, execute, followRedirects, followRedirects, formParameter, get, get, getAttributes, getBody, getBodyAnnotations, getBodyContentType, getBodyGenericType, getBodyType, getDefaultExecutor, getExecutor, getFormParameters, getHeaders, getHeadersAsObjects, getHttpMethod, getMatrixParameters, getPathParameterList, getPathParameters, getProviderFactory, getQueryParameters, getTarget, getUri, head, header, httpMethod, httpMethod, httpMethod, httpMethod, matrixParameter, options, options, options, options, overrideUri, pathParameter, pathParameters, post, post, postTarget, put, put, queryParameter, setDefaultExecutorClass, setHttpMethod, toHeaderString, toString, writeRequestBody
 
Methods inherited from class org.jboss.resteasy.client.core.ClientInterceptorRepositoryImpl
copyClientInterceptorsTo, getExecutionInterceptorList, getExecutionInterceptors, getInterceptors, getInterceptors, getReaderInterceptorList, getReaderInterceptors, getWriterInterceptorList, getWriterInterceptors, prefixClientInterceptorsTo, registerInterceptor, setExecutionInterceptors, setExecutionInterceptors, setReaderInterceptors, setReaderInterceptors, setWriterInterceptors, setWriterInterceptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientRequest

public ClientRequest(String uriTemplate)
Constructor.

Parameters:
uriTemplate -
Method Detail

post

public <T> org.jboss.resteasy.client.ClientResponse<T> post(Class<T> returnType)
                                                 throws Exception
Overrides:
post in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.post(java.lang.Class)

post

public org.jboss.resteasy.client.ClientResponse post()
                                              throws Exception
Overrides:
post in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.post()

get

public <T> org.jboss.resteasy.client.ClientResponse<T> get(Class<T> returnType)
                                                throws Exception
Overrides:
get in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.get(java.lang.Class)

get

public org.jboss.resteasy.client.ClientResponse get()
                                             throws Exception
Overrides:
get in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.get()

put

public <T> org.jboss.resteasy.client.ClientResponse<T> put(Class<T> returnType)
                                                throws Exception
Overrides:
put in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.put(java.lang.Class)

put

public org.jboss.resteasy.client.ClientResponse put()
                                             throws Exception
Overrides:
put in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.put()

delete

public <T> org.jboss.resteasy.client.ClientResponse<T> delete(Class<T> returnType)
                                                   throws Exception
Overrides:
delete in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.delete(java.lang.Class)

delete

public org.jboss.resteasy.client.ClientResponse delete()
                                                throws Exception
Overrides:
delete in class org.jboss.resteasy.client.ClientRequest
Throws:
Exception
See Also:
ClientRequest.delete()


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.