Class 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.
    • Field Detail

      • latch

        private final java.util.concurrent.CountDownLatch latch
      • ids

        private final java.util.List<com.fasterxml.jackson.databind.JsonNode> ids
    • Method Detail

      • updateIds

        private void updateIds​(java.util.List<JsonRpcRequest> requests)
      • cancel

        public boolean cancel​(boolean cancel)
        Specified by:
        cancel in interface java.util.concurrent.Future<java.util.List<JsonRpcResponse>>
      • get

        public java.util.List<JsonRpcResponse> get()
                                            throws java.lang.InterruptedException,
                                                   java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<java.util.List<JsonRpcResponse>>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public java.util.List<JsonRpcResponse> get​(long time,
                                                   java.util.concurrent.TimeUnit unit)
                                            throws java.lang.InterruptedException,
                                                   java.util.concurrent.ExecutionException,
                                                   java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<java.util.List<JsonRpcResponse>>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<java.util.List<JsonRpcResponse>>
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface java.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 interface JsonRpcCall
        Returns:
        The callback that receives the notification.