Class RemoteFunctionChunkedList
- java.lang.Object
-
- com.gluonhq.cloudlink.client.data.RemoteFunction
-
- com.gluonhq.cloudlink.client.data.RemoteFunctionChunkedList
-
public class RemoteFunctionChunkedList extends RemoteFunction
An implementation ofRemoteFunction
that is intended to call remote functions that return a list of objects in the form of aGluonObservableList
. Each object in the list is handled individually from the response of the call to the remote function. The response comes in as chunks from a connection with chunked transfer encoding enabled. This is in contrast with theRemoteFunctionList
where all the objects are parsed from the entire response of the call to the remote function.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> GluonObservableList<E>
call(InputStreamInputConverter<E> converter)
Triggers a call to the remote function and returns a GluonObservableList that contains the retrieved objects.<E> GluonObservableList<E>
call(Class<E> objectClass)
Triggers a call to the remote function and returns a GluonObservableList that contains the retrieved objects.-
Methods inherited from class com.gluonhq.cloudlink.client.data.RemoteFunction
clearCache, getFunctionName, getParams, getRawBody, isCachingEnabled, setRawBody
-
-
-
-
Method Detail
-
call
public <E> GluonObservableList<E> call(Class<E> objectClass)
Triggers a call to the remote function and returns a GluonObservableList that contains the retrieved objects.The actual call to the endpoint of the remote function will be handled asynchronously. The response that is returned by the remote function should have chunked transfer encoding enabled. Each chunk that is received while reading from the response will be converted by an automatically determined converter based on the provided
objectClass
and added to the returned GluonObservableList. Usecall(InputStreamInputConverter)
to specify a custom converter that can handle the chunks.- Type Parameters:
E
- the type of the objects contained in the list- Parameters:
objectClass
- the class of the objects contained in the list- Returns:
- an instance of GluonObservableList that will hold the retrieved objects upon successful completion of the call to the remote function
-
call
public <E> GluonObservableList<E> call(InputStreamInputConverter<E> converter)
Triggers a call to the remote function and returns a GluonObservableList that contains the retrieved objects.The actual call to the endpoint of the remote function will be handled asynchronously. The response that is returned by the remote function should have chunked transfer encoding enabled. Each chunk that is received while reading from the response will be converted by the specified
converter
and added to the returned GluonObservableList.- Type Parameters:
E
- the type of the objects contained in the list- Parameters:
converter
- the converter to use for transforming the chunk into a single object that is added to the list- Returns:
- an instance of GluonObservableList that will hold the retrieved objects upon successful completion of the call to the remote function
-
-