public static class ReST.Builder
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
ReST.Builder | 
addParameter(java.lang.String name,
            long value)
Add a parameter 
 | 
ReST.Builder | 
addParameter(java.lang.String name,
            java.lang.String value)
Add a parameter (decoded) 
 | 
ReST.Builder | 
addQuery(java.lang.String query)
A ampersand(&) separated list of encoded name/value pairs. 
 | 
static java.net.URL | 
correctURL(java.net.URL url)  | 
java.io.File | 
getCachePath()
What directory should be used for the cache. 
 | 
java.lang.String | 
getContentAsString()
Fetch a ReST request 
 | 
Method | 
getMethod()
Get the call method 
 | 
java.lang.String[] | 
getParameterValues(java.lang.String name)
Return the current parameter values. 
 | 
Response | 
getResponse()
Call the server and return the response. 
 | 
Response | 
getResponseAndCheck()
Short hand method to call getResponse() & checkStatus() 
 | 
boolean | 
hasParameter(java.lang.String name)
check if a parameter is set 
 | 
java.lang.String | 
makeFileName()
make the cache file name. 
 | 
ReST.Builder | 
setAgent(java.lang.String agent)
Set the agent to use 
 | 
ReST.Builder | 
setAuthorization(java.lang.String token)
sets the authorization token to use for this call. 
 | 
ReST.Builder | 
setAuthorization(java.lang.String user,
                java.lang.String passwd)
sets the user/password to use for this call. 
 | 
ReST.Builder | 
setAuthorization(java.lang.String user,
                java.lang.String passwd,
                java.lang.String domain)
sets the user/password to use for this call. 
 | 
ReST.Builder | 
setBearerAuthorization(java.lang.String token)
Set the Bearer authorization token 
 | 
ReST.Builder | 
setBody(org.w3c.dom.Document bodyXML)
Set the body of this POST/PUT request. 
 | 
ReST.Builder | 
setBody(org.w3c.dom.Document bodyXML,
       ContentType contentType,
       DispositionType dispositionType)
set the body of this POST/PUT request with given contentType and dispositionType 
 | 
ReST.Builder | 
setBody(java.io.File body)
Set the body of this POST/PUT request. 
 | 
ReST.Builder | 
setBody(java.io.File body,
       ContentType contentType,
       DispositionType dispositionType)
Set the body of this POST/PUT request. 
 | 
ReST.Builder | 
setBody(JSONArray bodyJSONArray)  | 
ReST.Builder | 
setBody(JSONObject bodyJSON)  | 
ReST.Builder | 
setCachePath(java.io.File cachePath)
Set the cache path to use 
 | 
ReST.Builder | 
setDisableGZIP(boolean disableGZIP)
true to NOT accept GZIP encoding, default is false 
 | 
ReST.Builder | 
setDisableURLLenghCheck(boolean disable)  | 
ReST.Builder | 
setEnableValidateCharactersInURL(boolean enable)  | 
ReST.Builder | 
setErrorCachePeriod(java.lang.String cachePeriod)
Set the ERROR cache period for this request 
 | 
ReST.Builder | 
setMaxBlockPeriod(java.lang.String maxBlockPeriod)
Set the maximum time we are prepared to wait for a NEW result. 
 | 
ReST.Builder | 
setMethod(Method method)
Set the method to use 
 | 
ReST.Builder | 
setMethod(java.lang.String method)
Set the method to use 
 | 
ReST.Builder | 
setMinCachePeriod(java.lang.String cachePeriod)
Set the minimum cache period for this request. 
 | 
ReST.Builder | 
setParameter(java.lang.String name,
            boolean value)
set a Boolean parameter 
 | 
ReST.Builder | 
setParameter(java.lang.String name,
            long value)
set a parameter 
 | 
ReST.Builder | 
setParameter(java.lang.String name,
            java.lang.String value)
set a parameter (decoded) 
 | 
ReST.Builder | 
setPlugin(ReSTPlugin plugin)
sets the customized authorization to use for this call. 
 | 
ReST.Builder | 
setStaleBlockPeriod(java.lang.String staleBlockPeriod)
The block time before we will use a stale version ( previously cached) of the request response. 
 | 
ReST.Builder | 
setTimeout(java.lang.String timeoutPeriod)
The maximum time to wait. 
 | 
ReST.Builder | 
setTransport(RestTransport transport)
Sets the underlying transport for this ReST call. 
 | 
java.lang.String | 
toString()  | 
@Nonnull public ReST.Builder setAuthorization(@Nonnull java.lang.String user, @Nonnull java.lang.String passwd) throws InvalidDataException
user - the userpasswd - InvalidDataException - the duration is not valid@Nonnull public ReST.Builder setAuthorization(@Nonnull java.lang.String token) throws InvalidDataException
token - the authorization tokenInvalidDataException - the duration is not valid@Nonnull public ReST.Builder setAuthorization(@Nonnull java.lang.String user, @Nonnull java.lang.String passwd, @Nullable java.lang.String domain) throws InvalidDataException
user - the userpasswd - domain - the domainInvalidDataException - the duration is not valid@Nonnull public ReST.Builder setBearerAuthorization(@Nonnull java.lang.String token) throws InvalidDataException
token - the Bearer authorization tokenInvalidDataException@Nonnull public ReST.Builder setPlugin(@Nonnull ReSTPlugin plugin) throws InvalidDataException
plugin - the customized authorizationInvalidDataException - the duration is not valid@Nonnull public ReST.Builder setBody(@Nullable java.io.File body) throws InvalidDataException
body - the body to send.InvalidDataException - The method must not be GET@Nonnull public ReST.Builder setBody(@Nonnull java.io.File body, @Nonnull ContentType contentType, @Nonnull DispositionType dispositionType) throws InvalidDataException
body - the body to send.contentType - the content type to senddispositionType - the disposition type.InvalidDataException - The method must not be GET@Nonnull public ReST.Builder setBody(@Nullable org.w3c.dom.Document bodyXML) throws InvalidDataException
bodyXML - the body to send.InvalidDataException - The method must not be GET@Nonnull public ReST.Builder setBody(@Nullable JSONObject bodyJSON) throws InvalidDataException
InvalidDataException@Nonnull public ReST.Builder setBody(@Nullable JSONArray bodyJSONArray) throws InvalidDataException
InvalidDataException@Nonnull public ReST.Builder setBody(@Nullable org.w3c.dom.Document bodyXML, @Nonnull ContentType contentType, @Nonnull DispositionType dispositionType) throws InvalidDataException
bodyXML - the xml body to sendcontentType - content type of this requestdispositionType - disposition typeInvalidDataException - The method must not be GET@Nonnull public ReST.Builder setDisableURLLenghCheck(boolean disable)
@Nonnull public ReST.Builder setEnableValidateCharactersInURL(boolean enable)
@Nonnull public ReST.Builder setDisableGZIP(boolean disableGZIP)
disableGZIP - @Nonnull public ReST.Builder setTimeout(@Nullable java.lang.String timeoutPeriod) throws InvalidDataException
timeoutPeriod - the maximum time to blockInvalidDataException - the duration is not valid@Nonnull public ReST.Builder setMaxBlockPeriod(@Nullable java.lang.String maxBlockPeriod) throws InvalidDataException
maxBlockPeriod - the maximum time to blockInvalidDataException - the duration is not valid@Nonnull public ReST.Builder setStaleBlockPeriod(@Nullable java.lang.String staleBlockPeriod) throws InvalidDataException
staleBlockPeriod - the maximum time to block. eg 4 min 30 secondsInvalidDataException - the duration is not valid@Nonnull public ReST.Builder setMethod(@Nullable java.lang.String method) throws java.lang.IllegalArgumentException
method - the method.java.lang.IllegalArgumentException@Nonnull public Method getMethod()
@Nonnull public ReST.Builder setMethod(@Nullable Method method) throws java.lang.IllegalArgumentException
method - the method.java.lang.IllegalArgumentException@Nonnull public ReST.Builder setAgent(@Nullable java.lang.String agent)
agent - the agent.@Nonnull public ReST.Builder addQuery(@Nonnull java.lang.String query) throws java.lang.IllegalArgumentException
query - the encoded name and value pairs to be added to the call.java.lang.IllegalArgumentException@Nonnull public ReST.Builder addParameter(@Nonnull java.lang.String name, long value)
name - the name of the parametervalue - the long value@Nonnull public ReST.Builder setParameter(@Nonnull java.lang.String name, @Nullable java.lang.String value)
name - the name of the parametervalue - the value@Nonnull public ReST.Builder setParameter(@Nonnull java.lang.String name, boolean value)
name - the name of the parametervalue - the value@Nonnull public ReST.Builder setParameter(@Nonnull java.lang.String name, long value)
name - the name of the parametervalue - the valuepublic boolean hasParameter(@Nonnull
                            java.lang.String name)
name - the name of the parameter@Nullable
public java.lang.String[] getParameterValues(@Nonnull
                                                       java.lang.String name)
name - the parameter name@Nonnull public ReST.Builder addParameter(@Nonnull java.lang.String name, @Nullable java.lang.String value)
name - the name of the parametervalue - the value@Nonnull public ReST.Builder setMinCachePeriod(@Nullable java.lang.String cachePeriod) throws InvalidDataException
cachePeriod - how long to remember the response for this URL.InvalidDataException - the duration is not valid@Nonnull public ReST.Builder setErrorCachePeriod(@Nullable java.lang.String cachePeriod) throws InvalidDataException
cachePeriod - how long to remember this URL returns an error.InvalidDataException - the duration is not valid@Nonnull public ReST.Builder setTransport(@Nullable RestTransport transport)
transport - the transport to use.@CheckReturnValue
 @Nonnull
public java.lang.String getContentAsString()
                                                                throws java.io.IOException
java.io.IOException - a serious problem.@CheckReturnValue @Nonnull public java.lang.String makeFileName()
@Nonnull
 @CheckReturnValue
public static java.net.URL correctURL(@Nonnull
                                                                  java.net.URL url)
@CheckReturnValue @Nonnull public java.lang.String toString()
toString in class java.lang.Object@CheckReturnValue @Nonnull public Response getResponse()
@CheckReturnValue @Nonnull public Response getResponseAndCheck() throws java.io.FileNotFoundException, ReSTException
java.io.FileNotFoundExceptionReSTException@Nonnull public ReST.Builder setCachePath(@Nonnull java.io.File cachePath)
cachePath - the new cache path@Nonnull @CheckReturnValue public java.io.File getCachePath()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.