Interface Query

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
QueryListenerWrapper

public interface Query extends Closeable
A handle to a registered query.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the client and server resources associated with this Query.
    Returns a QueryConfig object that contains fully parsed pieces like table, predicate, groupByExprs, etc.
    Returns a list describing the fields of the tuples that will be returned by this Query.
    Returns a list of fields describing the primary key for this table.
    short
    This will match the queryId on the events.
    boolean
    If this is false, either you've already gotten a QueryClosed event or you're about to get one.
  • Method Details

    • getFields

      List<Schema.Field> getFields()
      Returns a list describing the fields of the tuples that will be returned by this Query. An empty list may be returned if the result fields are unknown.
      Returns:
      The fields describing the tuples that will be returned.
    • getKeyFields

      List<Schema.Field> getKeyFields()
      Returns a list of fields describing the primary key for this table. These fields will come from the same schema as getFields, which come from the schema used to create tuples when they arrive, so they will be suitable for calling getXxx against the tuple.
      Returns:
      The fields describing the key of the tuples returned, or null if the key is simply a Long that is not part of the data record.
      Since:
      LiveView 1.6
    • close

      void close()
      Closes the client and server resources associated with this Query. This call may block while it connects to the server to unregister the query.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • isOpen

      boolean isOpen()
      If this is false, either you've already gotten a QueryClosed event or you're about to get one.
      Returns:
      Query is still active and might return data.
    • getQueryId

      short getQueryId()
      This will match the queryId on the events.
      Returns:
      the query ID for the query.
    • getConfig

      QueryConfig getConfig()
      Returns a QueryConfig object that contains fully parsed pieces like table, predicate, groupByExprs, etc. as well as the query string.
      Returns:
      Query configuration object