org.odata4j.consumer
Class ODataClientRequest

java.lang.Object
  extended by org.odata4j.consumer.ODataClientRequest

public class ODataClientRequest
extends Object

Generic OData http request builder used by the low-level ODataClient api.

Also interesting for developers of custom OClientBehavior implementations.

See Also:
ODataClient

Constructor Summary
ODataClientRequest(String method, String url, Map<String,String> headers, Map<String,String> queryParams, Object payload)
           
 
Method Summary
static ODataClientRequest delete(String url)
          Creates a new DELETE request.
static ODataClientRequest get(String url)
          Creates a new GET request.
 Map<String,String> getHeaders()
          Gets the request http headers.
 String getMethod()
          Gets the request http method.
 Object getPayload()
          Gets the normalized OData payload.
 Map<String,String> getQueryParams()
          Gets the request query parameters.
 String getUrl()
          Gets the request url.
 ODataClientRequest header(String name, String value)
          Sets an http request header.
static ODataClientRequest merge(String url, Entry entry)
          Creates a new MERGE request.
static ODataClientRequest merge(String url, SingleLink link)
          Creates a new MERGE request.
 ODataClientRequest method(String method)
          Sets the http request method.
static ODataClientRequest post(String url, Entry entry)
          Creates a new POST request.
static ODataClientRequest post(String url, SingleLink link)
          Creates a new POST request.
static ODataClientRequest put(String url, Entry entry)
          Creates a new PUT request.
static ODataClientRequest put(String url, SingleLink link)
          Creates a new PUT request.
 ODataClientRequest queryParam(String name, String value)
          Sets a request query parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ODataClientRequest

public ODataClientRequest(String method,
                          String url,
                          Map<String,String> headers,
                          Map<String,String> queryParams,
                          Object payload)
Method Detail

delete

public static ODataClientRequest delete(String url)
Creates a new DELETE request.

Parameters:
url - the request url
Returns:
a new request builder

get

public static ODataClientRequest get(String url)
Creates a new GET request.

Parameters:
url - the request url
Returns:
a new request builder

getHeaders

public Map<String,String> getHeaders()
Gets the request http headers.

Returns:
the headers

getMethod

public String getMethod()
Gets the request http method.

Returns:
the http method

getPayload

public Object getPayload()
Gets the normalized OData payload.

Returns:
the normalized OData payload

getQueryParams

public Map<String,String> getQueryParams()
Gets the request query parameters.

Returns:
the query parameters

getUrl

public String getUrl()
Gets the request url.

Returns:
the url

header

public ODataClientRequest header(String name,
                                 String value)
Sets an http request header.

Parameters:
name - the header name
value - the header value
Returns:
the request builder

merge

public static ODataClientRequest merge(String url,
                                       Entry entry)
Creates a new MERGE request.

Parameters:
url - the request url
entry - the normalized OData payload
Returns:
a new request builder

merge

public static ODataClientRequest merge(String url,
                                       SingleLink link)
Creates a new MERGE request.

Parameters:
url - the request url
link - the link
Returns:
a new request builder

method

public ODataClientRequest method(String method)
Sets the http request method.

Parameters:
method - the method
Returns:
the request builder

post

public static ODataClientRequest post(String url,
                                      Entry entry)
Creates a new POST request.

Parameters:
url - the request url
entry - the normalized OData payload
Returns:
a new request builder

post

public static ODataClientRequest post(String url,
                                      SingleLink link)
Creates a new POST request.

Parameters:
url - the request url
link - the link
Returns:
a new request builder

put

public static ODataClientRequest put(String url,
                                     Entry entry)
Creates a new PUT request.

Parameters:
url - the request url
entry - the normalized OData payload
Returns:
a new request builder

put

public static ODataClientRequest put(String url,
                                     SingleLink link)
Creates a new PUT request.

Parameters:
url - the request url
link - the link
Returns:
a new request builder

queryParam

public ODataClientRequest queryParam(String name,
                                     String value)
Sets a request query parameter.

Parameters:
name - the query parameter name
value - the query parameter value
Returns:
the request builder


http://odata4j.org