com.worklight.wlclient.api
Class WLRequestOptions
- java.lang.Object
-
- com.worklight.wlclient.api.WLRequestOptions
-
public class WLRequestOptions extends java.lang.Object
This class changes the timeout and invocation context.
-
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getAppUserId()
Returns the application userId which is used by the following services Pushjava.lang.Object
getInvocationContext()
Return the user invocation contextWLResponseListener
getResponseListener()
int
getTimeout()
This method gets the request timeout that you currently use.void
setAppUserId(java.lang.String appUserId)
Sets the application userId which is used by the following services Pushvoid
setInvocationContext(java.lang.Object invocationContext)
User can add to the request any object, that will be available on the callback (success/failure) functions.void
setTimeout(int timeout)
This method sets a new timeout.
-
-
-
Method Detail
-
getTimeout
public int getTimeout()
This method gets the request timeout that you currently use. The default request timeout is 10 seconds.- Returns:
- The timeout, in milliseconds, to wait for the procedure invocation.
If the timeout expires, the
WLResponseListener.onFailure(WLFailResponse)
method is called. The value 0 indicates that there is no timeout.
-
setTimeout
public void setTimeout(int timeout)
This method sets a new timeout.- Parameters:
timeout
- The timeout, in milliseconds, to wait for the procedure invocation. If the timeout expires, theWLResponseListener.onFailure(WLFailResponse)
method is called. The value 0 indicates that there is no timeout.
-
getInvocationContext
public java.lang.Object getInvocationContext()
Return the user invocation context- Returns:
- An object that is returned with
WLResponse
to the listener methods onSuccess and onFailure.
You can use this object to identify and distinguish different invokeProcedure calls.
This object is returned as is to the listener methods
-
setInvocationContext
public void setInvocationContext(java.lang.Object invocationContext)
User can add to the request any object, that will be available on the callback (success/failure) functions.- Parameters:
invocationContext
- An object that is returned withWLResponse
to the listener methods onSuccess and onFailure.
You can use this object to identify and distinguish different invokeProcedure calls.
This object is returned as is to the listener methods.
-
getResponseListener
public WLResponseListener getResponseListener()
-
getAppUserId
public java.lang.String getAppUserId()
Returns the application userId which is used by the following services- Push
- Returns:
- the application UserId
-
setAppUserId
public void setAppUserId(java.lang.String appUserId)
Sets the application userId which is used by the following services- Push
- Parameters:
appUserId
-
-
-