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 voidaddResponse(JsonRpcResponse response)booleancancel(boolean cancel)java.util.List<JsonRpcResponse>get()java.util.List<JsonRpcResponse>get(long time, java.util.concurrent.TimeUnit unit)BrokerCommandCallbackgetCallback()The callback to notify after the specific command was invoked.java.util.List<com.fasterxml.jackson.databind.JsonNode>getId()booleanisCancelled()booleanisDone()
-
-
-
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:
addResponsein interfaceJsonRpcCall- Parameters:
response- Added to current call object.
-
cancel
public boolean cancel(boolean cancel)
- Specified by:
cancelin interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
-
get
public java.util.List<JsonRpcResponse> get() throws java.lang.InterruptedException
- Specified by:
getin 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:
getin interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.TimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<java.util.List<JsonRpcResponse>>
-
isDone
public boolean isDone()
- Specified by:
isDonein 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:JsonRpcCallThe callback to notify after the specific command was invoked.- Specified by:
getCallbackin interfaceJsonRpcCall- Returns:
- The callback that receives the notification.
-
-