com.sun.jersey.api.client
Class WebResource.Builder

java.lang.Object
  extended by com.sun.jersey.api.client.PartialRequestBuilder<WebResource.Builder>
      extended by com.sun.jersey.api.client.WebResource.Builder
All Implemented Interfaces:
RequestBuilder<WebResource.Builder>, UniformInterface
Enclosing class:
WebResource

public class WebResource.Builder
extends PartialRequestBuilder<WebResource.Builder>
implements UniformInterface

The builder for building a ClientRequest instance and handling the request using the UniformInterface. The methods of the UniformInterface are the build methods of the builder.


Field Summary
 
Fields inherited from class com.sun.jersey.api.client.PartialRequestBuilder
entity, metadata
 
Method Summary
 void delete()
          Invoke the DELETE method with no request entity or response.
<T> T
delete(java.lang.Class<T> c)
          Invoke the DELETE method with no request entity that returns a response.
<T> T
delete(java.lang.Class<T> c, java.lang.Object requestEntity)
          Invoke the DELETE method with a request entity that returns a response.
<T> T
delete(GenericType<T> gt)
          Invoke the DELETE method with a request entity that returns a response.
<T> T
delete(GenericType<T> gt, java.lang.Object requestEntity)
          Invoke the DELETE method with a request entity that returns a response.
 void delete(java.lang.Object requestEntity)
          Invoke the DELETE method with a request entity but no response.
<T> T
get(java.lang.Class<T> c)
          Invoke the GET method.
<T> T
get(GenericType<T> gt)
          Invoke the GET method.
 ClientResponse head()
          Invoke the HEAD method.
 void method(java.lang.String method)
          Invoke a HTTP method with no request entity or response.
<T> T
method(java.lang.String method, java.lang.Class<T> c)
          Invoke a HTTP method with no request entity that returns a response.
<T> T
method(java.lang.String method, java.lang.Class<T> c, java.lang.Object requestEntity)
          Invoke a HTTP method with a request entity that returns a response.
<T> T
method(java.lang.String method, GenericType<T> gt)
          Invoke a HTTP method with no request entity that returns a response.
<T> T
method(java.lang.String method, GenericType<T> gt, java.lang.Object requestEntity)
          Invoke a HTTP method with a request entity that returns a response.
 void method(java.lang.String method, java.lang.Object requestEntity)
          Invoke a HTTP method with a request entity but no response.
<T> T
options(java.lang.Class<T> c)
          Invoke the OPTIONS method.
<T> T
options(GenericType<T> gt)
          Invoke the OPTIONS method.
 void post()
          Invoke the POST method with no request entity or response.
<T> T
post(java.lang.Class<T> c)
          Invoke the POST method with no request entity that returns a response.
<T> T
post(java.lang.Class<T> c, java.lang.Object requestEntity)
          Invoke the POST method with a request entity that returns a response.
<T> T
post(GenericType<T> gt)
          Invoke the POST method with a request entity that returns a response.
<T> T
post(GenericType<T> gt, java.lang.Object requestEntity)
          Invoke the POST method with a request entity that returns a response.
 void post(java.lang.Object requestEntity)
          Invoke the POST method with a request entity but no response.
 void put()
          Invoke the PUT method with no request entity or response.
<T> T
put(java.lang.Class<T> c)
          Invoke the PUT method with no request entity that returns a response.
<T> T
put(java.lang.Class<T> c, java.lang.Object requestEntity)
          Invoke the PUT method with a request entity that returns a response.
<T> T
put(GenericType<T> gt)
          Invoke the PUT method with a request entity that returns a response.
<T> T
put(GenericType<T> gt, java.lang.Object requestEntity)
          Invoke the PUT method with a request entity that returns a response.
 void put(java.lang.Object requestEntity)
          Invoke the PUT method with a request entity but no response.
 
Methods inherited from class com.sun.jersey.api.client.PartialRequestBuilder
accept, accept, acceptLanguage, acceptLanguage, cookie, entity, entity, entity, header, type, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

head

public ClientResponse head()
                    throws ClientHandlerException
Description copied from interface: UniformInterface
Invoke the HEAD method.

Specified by:
head in interface UniformInterface
Returns:
the HTTP response.
Throws:
ClientHandlerException - if the client handler fails to process the request or response.

options

public <T> T options(java.lang.Class<T> c)
          throws UniformInterfaceException,
                 ClientHandlerException
Description copied from interface: UniformInterface
Invoke the OPTIONS method.

Specified by:
options in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

options

public <T> T options(GenericType<T> gt)
          throws UniformInterfaceException,
                 ClientHandlerException
Description copied from interface: UniformInterface
Invoke the OPTIONS method.

Specified by:
options in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

get

public <T> T get(java.lang.Class<T> c)
      throws UniformInterfaceException,
             ClientHandlerException
Description copied from interface: UniformInterface
Invoke the GET method.

Specified by:
get in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

get

public <T> T get(GenericType<T> gt)
      throws UniformInterfaceException,
             ClientHandlerException
Description copied from interface: UniformInterface
Invoke the GET method.

Specified by:
get in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

put

public void put()
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke the PUT method with no request entity or response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
put in interface UniformInterface
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

put

public void put(java.lang.Object requestEntity)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke the PUT method with a request entity but no response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
put in interface UniformInterface
Parameters:
requestEntity - the request entity.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

put

public <T> T put(java.lang.Class<T> c)
      throws UniformInterfaceException,
             ClientHandlerException
Description copied from interface: UniformInterface
Invoke the PUT method with no request entity that returns a response.

Specified by:
put in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

put

public <T> T put(GenericType<T> gt)
      throws UniformInterfaceException,
             ClientHandlerException
Description copied from interface: UniformInterface
Invoke the PUT method with a request entity that returns a response.

Specified by:
put in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

put

public <T> T put(java.lang.Class<T> c,
                 java.lang.Object requestEntity)
      throws UniformInterfaceException,
             ClientHandlerException
Description copied from interface: UniformInterface
Invoke the PUT method with a request entity that returns a response.

Specified by:
put in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

put

public <T> T put(GenericType<T> gt,
                 java.lang.Object requestEntity)
      throws UniformInterfaceException,
             ClientHandlerException
Description copied from interface: UniformInterface
Invoke the PUT method with a request entity that returns a response.

Specified by:
put in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

post

public void post()
          throws UniformInterfaceException,
                 ClientHandlerException
Description copied from interface: UniformInterface
Invoke the POST method with no request entity or response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
post in interface UniformInterface
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

post

public void post(java.lang.Object requestEntity)
          throws UniformInterfaceException,
                 ClientHandlerException
Description copied from interface: UniformInterface
Invoke the POST method with a request entity but no response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
post in interface UniformInterface
Parameters:
requestEntity - the request entity.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

post

public <T> T post(java.lang.Class<T> c)
       throws UniformInterfaceException,
              ClientHandlerException
Description copied from interface: UniformInterface
Invoke the POST method with no request entity that returns a response.

Specified by:
post in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

post

public <T> T post(GenericType<T> gt)
       throws UniformInterfaceException,
              ClientHandlerException
Description copied from interface: UniformInterface
Invoke the POST method with a request entity that returns a response.

Specified by:
post in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

post

public <T> T post(java.lang.Class<T> c,
                  java.lang.Object requestEntity)
       throws UniformInterfaceException,
              ClientHandlerException
Description copied from interface: UniformInterface
Invoke the POST method with a request entity that returns a response.

Specified by:
post in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

post

public <T> T post(GenericType<T> gt,
                  java.lang.Object requestEntity)
       throws UniformInterfaceException,
              ClientHandlerException
Description copied from interface: UniformInterface
Invoke the POST method with a request entity that returns a response.

Specified by:
post in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

delete

public void delete()
            throws UniformInterfaceException,
                   ClientHandlerException
Description copied from interface: UniformInterface
Invoke the DELETE method with no request entity or response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
delete in interface UniformInterface
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

delete

public void delete(java.lang.Object requestEntity)
            throws UniformInterfaceException,
                   ClientHandlerException
Description copied from interface: UniformInterface
Invoke the DELETE method with a request entity but no response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
delete in interface UniformInterface
Parameters:
requestEntity - the request entity.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

delete

public <T> T delete(java.lang.Class<T> c)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke the DELETE method with no request entity that returns a response.

Specified by:
delete in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

delete

public <T> T delete(GenericType<T> gt)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke the DELETE method with a request entity that returns a response.

Specified by:
delete in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

delete

public <T> T delete(java.lang.Class<T> c,
                    java.lang.Object requestEntity)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke the DELETE method with a request entity that returns a response.

Specified by:
delete in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
c - the type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

delete

public <T> T delete(GenericType<T> gt,
                    java.lang.Object requestEntity)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke the DELETE method with a request entity that returns a response.

Specified by:
delete in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
gt - the generic type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

method

public void method(java.lang.String method)
            throws UniformInterfaceException,
                   ClientHandlerException
Description copied from interface: UniformInterface
Invoke a HTTP method with no request entity or response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
method in interface UniformInterface
Parameters:
method - the HTTP method.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

method

public void method(java.lang.String method,
                   java.lang.Object requestEntity)
            throws UniformInterfaceException,
                   ClientHandlerException
Description copied from interface: UniformInterface
Invoke a HTTP method with a request entity but no response.

If the status code is less than 300 and a representation is present then that representation is ignored.

Specified by:
method in interface UniformInterface
Parameters:
method - the HTTP method.
requestEntity - the request entity.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300.
ClientHandlerException - if the client handler fails to process the request or response.

method

public <T> T method(java.lang.String method,
                    java.lang.Class<T> c)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke a HTTP method with no request entity that returns a response.

Specified by:
method in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
method - the HTTP method.
c - the type of the returned response.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

method

public <T> T method(java.lang.String method,
                    GenericType<T> gt)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke a HTTP method with no request entity that returns a response.

Specified by:
method in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
method - the HTTP method.
gt - the generic type of the returned response.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

method

public <T> T method(java.lang.String method,
                    java.lang.Class<T> c,
                    java.lang.Object requestEntity)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke a HTTP method with a request entity that returns a response.

Specified by:
method in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
method - the HTTP method.
c - the type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type c.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and c is not the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.

method

public <T> T method(java.lang.String method,
                    GenericType<T> gt,
                    java.lang.Object requestEntity)
         throws UniformInterfaceException,
                ClientHandlerException
Description copied from interface: UniformInterface
Invoke a HTTP method with a request entity that returns a response.

Specified by:
method in interface UniformInterface
Type Parameters:
T - the type of the response.
Parameters:
method - the HTTP method.
gt - the generic type of the returned response.
requestEntity - the request entity.
Returns:
an instance of type represented by the generic type.
Throws:
UniformInterfaceException - if the status of the HTTP response is greater than or equal to 300 and gt does not represent the type ClientResponse.
ClientHandlerException - if the client handler fails to process the request or response.


Copyright © 2013 Oracle Corporation. All Rights Reserved.