Class BatchCall
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.internal.BatchCall
-
- All Implemented Interfaces:
java.util.concurrent.Future<java.util.List<JsonRpcResponse>>
,JsonRpcCall
public class BatchCall extends java.lang.Object implements java.util.concurrent.Future<java.util.List<JsonRpcResponse>>, JsonRpcCall
Groups responses for batch call and let user to get them when all of them are ready.
-
-
Constructor Summary
Constructors Constructor Description BatchCall(java.util.List<JsonRpcRequest> requests)
BatchCall(java.util.List<JsonRpcRequest> requests, BrokerCommandCallback callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResponse(JsonRpcResponse response)
boolean
cancel(boolean cancel)
java.util.List<JsonRpcResponse>
get()
java.util.List<JsonRpcResponse>
get(long time, java.util.concurrent.TimeUnit unit)
BrokerCommandCallback
getCallback()
The callback to notify after the specific command was invoked.java.util.List<com.fasterxml.jackson.databind.JsonNode>
getId()
boolean
isCancelled()
boolean
isDone()
-
-
-
Constructor Detail
-
BatchCall
public BatchCall(java.util.List<JsonRpcRequest> requests)
-
BatchCall
public BatchCall(java.util.List<JsonRpcRequest> requests, BrokerCommandCallback callback)
-
-
Method Detail
-
addResponse
public void addResponse(JsonRpcResponse response)
- Specified by:
addResponse
in interfaceJsonRpcCall
- Parameters:
response
- Added to current call object.
-
cancel
public boolean cancel(boolean cancel)
- Specified by:
cancel
in interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
-
get
public java.util.List<JsonRpcResponse> get() throws java.lang.InterruptedException
- Specified by:
get
in interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
- Throws:
java.lang.InterruptedException
-
get
public java.util.List<JsonRpcResponse> get(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
- Specified by:
get
in interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
- Throws:
java.lang.InterruptedException
java.util.concurrent.TimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
-
isDone
public boolean isDone()
- Specified by:
isDone
in interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
-
getId
public java.util.List<com.fasterxml.jackson.databind.JsonNode> getId()
-
getCallback
public BrokerCommandCallback getCallback()
Description copied from interface:JsonRpcCall
The callback to notify after the specific command was invoked.- Specified by:
getCallback
in interfaceJsonRpcCall
- Returns:
- The callback that receives the notification.
-
-