Class Call
java.lang.Object
org.ovirt.vdsm.jsonrpc.client.internal.Call
- All Implemented Interfaces:
Future<JsonRpcResponse>,JsonRpcCall
Call holds single response-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BrokerCommandCallbackprivate final com.fasterxml.jackson.databind.JsonNodeprivate final CountDownLatchprivate JsonRpcResponse -
Constructor Summary
ConstructorsConstructorDescriptionCall(JsonRpcRequest req) Call(JsonRpcRequest req, BrokerCommandCallback callback) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponse(JsonRpcResponse response) booleancancel(boolean mayInterruptIfRunning) get()The callback to notify after the specific command was invoked.com.fasterxml.jackson.databind.JsonNodegetId()booleanbooleanisDone()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
latch
-
id
private final com.fasterxml.jackson.databind.JsonNode id -
response
-
callback
-
-
Constructor Details
-
Call
-
Call
-
-
Method Details
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) - Specified by:
cancelin interfaceFuture<JsonRpcResponse>
-
addResponse
- Specified by:
addResponsein interfaceJsonRpcCall- Parameters:
response- Added to current call object.
-
getId
public com.fasterxml.jackson.databind.JsonNode getId() -
get
- Specified by:
getin interfaceFuture<JsonRpcResponse>- Throws:
InterruptedException
-
get
public JsonRpcResponse get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException - Specified by:
getin interfaceFuture<JsonRpcResponse>- Throws:
InterruptedExceptionTimeoutException
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<JsonRpcResponse>
-
isDone
public boolean isDone()- Specified by:
isDonein interfaceFuture<JsonRpcResponse>
-
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.
-