Interface QueryProcessorConnection.QueryHandle

All Known Subinterfaces:
QueryProcessorConnection.QueryFuture<RETURN_TYPE>
Enclosing interface:
QueryProcessorConnection

public static interface QueryProcessorConnection.QueryHandle
Interface returned from asynchronous queries. This handle may be used to wait for the query to complete, or to cancel execution of the query.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    block until the query is finished
    void
    await(long timeoutMillis)
    await but only as long as the timeout
    boolean
    Attempt to cancel the query.
    boolean
    cancel(String message)
    Attempt to cancel the query.
    boolean
    Check if the query has completed and produced a result.
  • Method Details

    • isReady

      boolean isReady()
      Check if the query has completed and produced a result. If this method returns 'true' a call to await() or QueryProcessorConnection.QueryFuture.get() will return immediately.
      Returns:
      true if completed, false otherwise.
    • await

      void await() throws InterruptedException
      block until the query is finished
      Throws:
      InterruptedException
    • await

      void await(long timeoutMillis) throws InterruptedException
      await but only as long as the timeout
      Throws:
      InterruptedException
    • cancel

      boolean cancel()
      Attempt to cancel the query. This might return false if the query is finished or the query is shutting down.
      Returns:
      true if the cancel attempt is possible
    • cancel

      boolean cancel(@Nullable String message)
      Attempt to cancel the query. This might return false if the query is finished or the query is shutting down.
      Parameters:
      message - an optional message to be passed to the query in the Command arguments
      Returns:
      true if the cancel attempt is possible