org.apache.isis.viewer.restfulobjects.applib
Class ClientRequestConfigurer

java.lang.Object
  extended by org.apache.isis.viewer.restfulobjects.applib.ClientRequestConfigurer

public class ClientRequestConfigurer
extends Object

Configures the body, query string etc of a ClientRequest.

Needed because, unfortunately, ClientRequest does not seem to allow the query string to be set directly (only query parameters). Instead, it is necessary to use its underlying UriBuilderImpl.


Method Summary
 ClientRequestConfigurer accept(javax.ws.rs.core.MediaType mediaType)
           
 ClientRequestConfigurer configureArgs(JsonRepresentation requestArgs)
          Used when following links ( RestfulClient.follow(LinkRepresentation)).
 ClientRequestConfigurer configureArgs(Map<RestfulRequest.RequestParameter<?>,Object> args)
          Used when creating a request with arguments to execute.
static ClientRequestConfigurer create(org.jboss.resteasy.client.ClientExecutor executor, String uriTemplate)
           
 ClientRequestConfigurer header(String name, String value)
           
 ClientRequestConfigurer setHttpMethod(HttpMethod httpMethod)
          Prerequisite to configureArgs(JsonRepresentation) or configureArgs(Map).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ClientRequestConfigurer create(org.jboss.resteasy.client.ClientExecutor executor,
                                             String uriTemplate)

accept

public ClientRequestConfigurer accept(javax.ws.rs.core.MediaType mediaType)

header

public ClientRequestConfigurer header(String name,
                                      String value)

setHttpMethod

public ClientRequestConfigurer setHttpMethod(HttpMethod httpMethod)
Prerequisite to configureArgs(JsonRepresentation) or configureArgs(Map).


configureArgs

public ClientRequestConfigurer configureArgs(Map<RestfulRequest.RequestParameter<?>,Object> args)
Used when creating a request with arguments to execute.

Typical flow is:


configureArgs

public ClientRequestConfigurer configureArgs(JsonRepresentation requestArgs)
Used when following links ( RestfulClient.follow(LinkRepresentation)).



Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.