Package com.streambase.liveview.client
Interface Query
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
QueryListenerWrapper
public interface Query extends Closeable
A handle to a registered query.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes the client and server resources associated with this Query.QueryConfig
getConfig()
Returns a QueryConfig object that contains fully parsed pieces like table, predicate, groupByExprs, etc.List<Schema.Field>
getFields()
Returns a list describing the fields of the tuples that will be returned by this Query.List<Schema.Field>
getKeyFields()
Returns a list of fields describing the primary key for this table.short
getQueryId()
This will match the queryId on the events.boolean
isOpen()
If this is false, either you've already gotten a QueryClosed event or you're about to get one.
-
-
-
Method Detail
-
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
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
-
-