public abstract class RemoteFunction
extends java.lang.Object
RemoteFunctionBuilder
. The builder
class can generate either a remote function that returns a single object or a remote function that returns a list of
objects. These are implemented by RemoteFunctionObject
, RemoteFunctionList
and
RemoteFunctionChunkedList
respectively.
The following code demonstrates how to call a remote function and populate the result into an observable list:
RemoteFunctionList queryItemsFunction = RemoteFunctionBuilder.create("queryItems") .param("customer", customerIdentifier) .param("queryString", txtQuery.getText()) .list(); GluonObservableList<Item> queryResults = queryItemsFunction.call(Item.class);
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clear the locally cached values of the responses that are returned by previous calls to the remote function.
|
java.lang.String |
getFunctionName()
The name that uniquely identifies the remote function that should be called when this RemoteFunction instance
is used.
|
java.util.Map<java.lang.String,java.lang.String> |
getParams()
A Map of function parameters that are sent along with the request when calling the RemoteFunction.
|
byte[] |
getRawBody()
The bytes that are sent to the remote function as the raw body.
|
boolean |
isCachingEnabled()
Returns whether the remote function has local caching enabled or not.
|
void |
setRawBody(byte[] rawBody)
Sets the bytes that are sent to the remote function as the raw body.
|
public java.lang.String getFunctionName()
public boolean isCachingEnabled()
When caching is enabled, calling a remote function will cause the locally cached values to be returned before the actual call to the remote function is triggered. This might for instance help in quickly populating a list with the already cached objects. When the call to the remote function has completed, the cached values will be cleared and completely overwritten with the new values that are loaded from the response of the remote function.
true
if local caching is enabled or false
if it is disabled.public java.util.Map<java.lang.String,java.lang.String> getParams()
public byte[] getRawBody()
public void setRawBody(byte[] rawBody)
rawBody
- the bytes to send as the raw body for the remote function callpublic void clearCache()