play.libs.ws.ning
Class NingWSRequestHolder

java.lang.Object
  extended by play.libs.ws.ning.NingWSRequestHolder
All Implemented Interfaces:
WSRequestHolder

public class NingWSRequestHolder
extends java.lang.Object
implements WSRequestHolder

provides the User facing API for building WS request.


Constructor Summary
NingWSRequestHolder(NingWSClient client, java.lang.String url)
           
 
Method Summary
 F.Promise<WSResponse> delete()
          Perform a DELETE on the request asynchronously.
 F.Promise<WSResponse> execute(java.lang.String method)
          Execute an arbitrary method on the request asynchronously.
 F.Promise<WSResponse> get()
          Perform a GET on the request asynchronously.
 WSSignatureCalculator getCalculator()
           
 java.lang.Boolean getFollowRedirects()
           
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getHeaders()
           
 java.lang.String getPassword()
           
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getQueryParameters()
           
 WSAuthScheme getScheme()
           
 int getTimeout()
           
 java.lang.String getUrl()
           
 java.lang.String getUsername()
           
 F.Promise<WSResponse> head()
          Perform a HEAD on the request asynchronously.
 F.Promise<WSResponse> options()
          Perform an OPTIONS on the request asynchronously.
 F.Promise<WSResponse> patch(java.io.InputStream body)
          Perform a PATCH on the request asynchronously.
 F.Promise<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
          Perform a PATCH on the request asynchronously.
 F.Promise<WSResponse> patch(java.lang.String body)
          Perform a PATCH on the request asynchronously.
 F.Promise<WSResponse> post(java.io.File body)
          Perform a POST on the request asynchronously.
 F.Promise<WSResponse> post(java.io.InputStream body)
          Perform a POST on the request asynchronously.
 F.Promise<WSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
          Perform a POST on the request asynchronously.
 F.Promise<WSResponse> post(java.lang.String body)
          Perform a POST on the request asynchronously.
 F.Promise<WSResponse> put(java.io.File body)
          Perform a PUT on the request asynchronously.
 F.Promise<WSResponse> put(java.io.InputStream body)
          Perform a PUT on the request asynchronously.
 F.Promise<WSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
          Perform a PUT on the request asynchronously.
 F.Promise<WSResponse> put(java.lang.String body)
          Perform a PUT on the request asynchronously.
 WSRequestHolder setAuth(java.lang.String userInfo)
          Sets the authentication header for the current request using BASIC authentication.
 WSRequestHolder setAuth(java.lang.String username, java.lang.String password)
          Sets the authentication header for the current request using BASIC authentication.
 WSRequestHolder setAuth(java.lang.String username, java.lang.String password, WSAuthScheme scheme)
          Sets the authentication header for the current request.
 WSRequestHolder setContentType(java.lang.String contentType)
          Set the content type.
 WSRequestHolder setFollowRedirects(java.lang.Boolean followRedirects)
          Sets whether redirects (301, 302) should be followed automatically.
 NingWSRequestHolder setHeader(java.lang.String name, java.lang.String value)
          Sets a header with the given name, this can be called repeatedly.
 WSRequestHolder setQueryParameter(java.lang.String name, java.lang.String value)
          Sets a query parameter with the given name,this can be called repeatedly.
 WSRequestHolder setQueryString(java.lang.String query)
          Sets a query string
 WSRequestHolder setTimeout(int timeout)
          Sets the request timeout in milliseconds.
 WSRequestHolder sign(WSSignatureCalculator calculator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NingWSRequestHolder

public NingWSRequestHolder(NingWSClient client,
                           java.lang.String url)
Method Detail

setHeader

public NingWSRequestHolder setHeader(java.lang.String name,
                                     java.lang.String value)
Sets a header with the given name, this can be called repeatedly.

Specified by:
setHeader in interface WSRequestHolder
Parameters:
name -
value -

setQueryString

public WSRequestHolder setQueryString(java.lang.String query)
Sets a query string

Specified by:
setQueryString in interface WSRequestHolder
Parameters:
query -

setQueryParameter

public WSRequestHolder setQueryParameter(java.lang.String name,
                                         java.lang.String value)
Sets a query parameter with the given name,this can be called repeatedly.

Specified by:
setQueryParameter in interface WSRequestHolder
Parameters:
name -
value -

setAuth

public WSRequestHolder setAuth(java.lang.String userInfo)
Sets the authentication header for the current request using BASIC authentication.

Specified by:
setAuth in interface WSRequestHolder
Parameters:
userInfo -

setAuth

public WSRequestHolder setAuth(java.lang.String username,
                               java.lang.String password)
Sets the authentication header for the current request using BASIC authentication.

Specified by:
setAuth in interface WSRequestHolder
Parameters:
username -
password -

setAuth

public WSRequestHolder setAuth(java.lang.String username,
                               java.lang.String password,
                               WSAuthScheme scheme)
Sets the authentication header for the current request.

Specified by:
setAuth in interface WSRequestHolder
Parameters:
username -
password -
scheme - authentication scheme

sign

public WSRequestHolder sign(WSSignatureCalculator calculator)
Specified by:
sign in interface WSRequestHolder

setFollowRedirects

public WSRequestHolder setFollowRedirects(java.lang.Boolean followRedirects)
Sets whether redirects (301, 302) should be followed automatically.

Specified by:
setFollowRedirects in interface WSRequestHolder
Parameters:
followRedirects -

setTimeout

public WSRequestHolder setTimeout(int timeout)
Sets the request timeout in milliseconds.

Specified by:
setTimeout in interface WSRequestHolder
Parameters:
timeout -

setContentType

public WSRequestHolder setContentType(java.lang.String contentType)
Set the content type. If the request body is a String, and no charset parameter is included, then it will default to UTF-8.

Specified by:
setContentType in interface WSRequestHolder
Parameters:
contentType - The content type

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface WSRequestHolder
Returns:
the URL of the request.

getHeaders

public java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getHeaders()
Specified by:
getHeaders in interface WSRequestHolder
Returns:
the headers (a copy to prevent side-effects).

getQueryParameters

public java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getQueryParameters()
Specified by:
getQueryParameters in interface WSRequestHolder
Returns:
the query parameters (a copy to prevent side-effects).

getUsername

public java.lang.String getUsername()
Specified by:
getUsername in interface WSRequestHolder
Returns:
the auth username, null if not an authenticated request.

getPassword

public java.lang.String getPassword()
Specified by:
getPassword in interface WSRequestHolder
Returns:
the auth password, null if not an authenticated request

getScheme

public WSAuthScheme getScheme()
Specified by:
getScheme in interface WSRequestHolder
Returns:
the auth scheme, null if not an authenticated request

getCalculator

public WSSignatureCalculator getCalculator()
Specified by:
getCalculator in interface WSRequestHolder
Returns:
the signature calculator (exemple: OAuth), null if none is set.

getTimeout

public int getTimeout()
Specified by:
getTimeout in interface WSRequestHolder
Returns:
the auth scheme (null if not an authenticated request)

getFollowRedirects

public java.lang.Boolean getFollowRedirects()
Specified by:
getFollowRedirects in interface WSRequestHolder
Returns:
true if the request is configure to follow redirect, false if it is configure not to, null if nothing is configured and the global client preference should be used instead.

get

public F.Promise<WSResponse> get()
Perform a GET on the request asynchronously.

Specified by:
get in interface WSRequestHolder

patch

public F.Promise<WSResponse> patch(java.lang.String body)
Perform a PATCH on the request asynchronously.

Specified by:
patch in interface WSRequestHolder
Parameters:
body - represented as String

post

public F.Promise<WSResponse> post(java.lang.String body)
Perform a POST on the request asynchronously.

Specified by:
post in interface WSRequestHolder
Parameters:
body - represented as String

put

public F.Promise<WSResponse> put(java.lang.String body)
Perform a PUT on the request asynchronously.

Specified by:
put in interface WSRequestHolder
Parameters:
body - represented as String

patch

public F.Promise<WSResponse> patch(com.fasterxml.jackson.databind.JsonNode body)
Perform a PATCH on the request asynchronously.

Specified by:
patch in interface WSRequestHolder
Parameters:
body - represented as JSON

post

public F.Promise<WSResponse> post(com.fasterxml.jackson.databind.JsonNode body)
Perform a POST on the request asynchronously.

Specified by:
post in interface WSRequestHolder
Parameters:
body - represented as JSON

put

public F.Promise<WSResponse> put(com.fasterxml.jackson.databind.JsonNode body)
Perform a PUT on the request asynchronously.

Specified by:
put in interface WSRequestHolder
Parameters:
body - represented as JSON

patch

public F.Promise<WSResponse> patch(java.io.InputStream body)
Perform a PATCH on the request asynchronously.

Specified by:
patch in interface WSRequestHolder
Parameters:
body - represented as an InputStream

post

public F.Promise<WSResponse> post(java.io.InputStream body)
Perform a POST on the request asynchronously.

Specified by:
post in interface WSRequestHolder
Parameters:
body - represented as an InputStream

put

public F.Promise<WSResponse> put(java.io.InputStream body)
Perform a PUT on the request asynchronously.

Specified by:
put in interface WSRequestHolder
Parameters:
body - represented as an InputStream

post

public F.Promise<WSResponse> post(java.io.File body)
Perform a POST on the request asynchronously.

Specified by:
post in interface WSRequestHolder
Parameters:
body - represented as a File

put

public F.Promise<WSResponse> put(java.io.File body)
Perform a PUT on the request asynchronously.

Specified by:
put in interface WSRequestHolder
Parameters:
body - represented as a File

delete

public F.Promise<WSResponse> delete()
Perform a DELETE on the request asynchronously.

Specified by:
delete in interface WSRequestHolder

head

public F.Promise<WSResponse> head()
Perform a HEAD on the request asynchronously.

Specified by:
head in interface WSRequestHolder

options

public F.Promise<WSResponse> options()
Perform an OPTIONS on the request asynchronously.

Specified by:
options in interface WSRequestHolder

execute

public F.Promise<WSResponse> execute(java.lang.String method)
Execute an arbitrary method on the request asynchronously.

Specified by:
execute in interface WSRequestHolder
Parameters:
method - The method to execute