|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of request used for method chaingpublic interface Request<T extends Request<?>>
Interface Request represents a request to retrieve data. To execute a request call execute(ResponseHandler)
.
Nested Class Summary | |
---|---|
static class |
Request.MethodType
Represents type of network request |
Method Summary | |
---|---|
T |
addAuthentication(Authenticator authenticator)
Adds generic Authenticator to the request. |
T |
addBasicAuthentication(java.lang.String username,
java.lang.String password)
Adds basic authentication to the request. |
T |
addHeader(java.lang.String headerName,
java.lang.String headerValue)
Adds the specified header to the request, not overwriting any previous value. |
T |
addRequestParameters(java.lang.String... params)
Sets parameters of the request. |
T |
addSeraphAuthentication(java.lang.String username,
java.lang.String password)
Adds seraph authentication to the request. |
T |
addTrustedTokenAuthentication()
Adds TrustedTokenAuthentication to the request. |
T |
addTrustedTokenAuthentication(java.lang.String username)
Adds TrustedTokenAuthentication to the request. |
java.lang.String |
execute()
Executes a request and if response is successful, returns response as a string. |
void |
execute(ResponseHandler responseHandler)
Executes the request. |
T |
setConnectionTimeout(int connectionTimeout)
Setting connection timeout in milliseconds. |
T |
setHeader(java.lang.String headerName,
java.lang.String headerValue)
Sets the specified header to the request, overwriting any previous value. |
T |
setRequestBody(java.lang.String requestBody)
Sets the body of the request. |
T |
setRequestContentType(java.lang.String contentType)
Sets Content-Type of the body of the request. |
T |
setSoTimeout(int soTimeout)
Setting socket timeout in milliseconds. |
T |
setUrl(java.lang.String url)
|
Method Detail |
---|
T setConnectionTimeout(int connectionTimeout)
connectionTimeout
- The timeout in milliseconds
T setSoTimeout(int soTimeout)
soTimeout
- the timeout in milliseconds
T setUrl(java.lang.String url)
url
- the url to request
T setRequestBody(java.lang.String requestBody)
Request.MethodType.POST
and Request.MethodType.POST
can have request body.
requestBody
- the body of the request
T setRequestContentType(java.lang.String contentType)
Request.MethodType.POST
and Request.MethodType.POST
can have request body.
contentType
- the contentType of the request
T addRequestParameters(java.lang.String... params)
Request.MethodType.POST
and Request.MethodType.POST
can have parameters.
For other requests include parameters in url. This method accepts odd number of arguments, in form of name, value, name, value, name, value, etc
params
- parameters of the request in as name, value pairs
T addAuthentication(Authenticator authenticator)
authenticator
- the authenticator to use for authentication
T addTrustedTokenAuthentication()
T addTrustedTokenAuthentication(java.lang.String username)
username
- The user to make the request with
T addBasicAuthentication(java.lang.String username, java.lang.String password)
username
- The user namepassword
- The password
T addSeraphAuthentication(java.lang.String username, java.lang.String password)
username
- The user namepassword
- The password
T addHeader(java.lang.String headerName, java.lang.String headerValue)
headerName
- the header's nameheaderValue
- the header's value
RequestFactory.supportsHeader()
T setHeader(java.lang.String headerName, java.lang.String headerValue)
headerName
- the header's nameheaderValue
- the header's value
RequestFactory.supportsHeader()
void execute(ResponseHandler responseHandler) throws ResponseException
responseHandler
- Callback handler of the response.
ResponseException
- If the response cannot be retrievedjava.lang.String execute() throws ResponseException
Response.getResponseBodyAsString()
ResponseException
- If the response cannot be retrieved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |