Interface QueryProcessorConnection
- All Known Implementing Classes:
QueryProcessorConnectionImpl
public interface QueryProcessorConnection
A connection to a RemoteQueryProcessor.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
QueryProcessorConnection.AsynchronousErrorHandler
static interface
QueryProcessorConnection.AsyncQueryResultHandler<RETURN_TYPE>
static interface
QueryProcessorConnection.DisconnectHandler
static interface
QueryProcessorConnection.QueryFuture<RETURN_TYPE>
Interface returned from certain asynchronous calls.static interface
QueryProcessorConnection.QueryHandle
Interface returned from asynchronous queries.static interface
QueryProcessorConnection.QueryProcessorConnectionCommandHandler
A command handler that can be attached to this QueryProcessorConnection. -
Method Summary
Modifier and Type Method Description void
addCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler)
Adds a command handler to the list of handlers that may service unknown commands.default <TYPE> TYPE
executeQuery(byte[] remoteQueryInstanceBytes)
Add concurrent=false and delegate toexecuteQuery(byte[], boolean)
<TYPE> TYPE
executeQuery(byte[] remoteQueryInstanceBytes, boolean concurrent)
Execute the given query bytes synchronously and return the result.default <TYPE> TYPE
executeQuery(RemoteQuery<TYPE> remoteQuery)
Add concurrent=false and delegate toexecuteQuery(RemoteQuery, boolean)
<TYPE> TYPE
executeQuery(RemoteQuery<TYPE> remoteQuery, boolean concurrent)
Execute the given query synchronously and return the result.<TYPE> QueryProcessorConnection.QueryFuture<TYPE>
executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent)
Submit a query asynchronously.<TYPE> QueryProcessorConnection.QueryHandle
executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler)
Submit a query asynchronously.<TYPE> QueryProcessorConnection.QueryFuture<TYPE>
executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent)
Submit a query asynchronously.<TYPE> QueryProcessorConnection.QueryHandle
executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler)
Submit a query asynchronously.QueryDispatcherConnection
getDispatcherConnection()
String
getEnvoyPrefix()
String
getProcessInfoId()
String
getProcessorHost()
String
getProcessorName()
int
getProcessorPort()
RemoteDatabase
getRemoteDatabase()
RemoteTableHandleManager
getTableManager()
RemoteTableMapManager
getTableMapManager()
int
getWebsocketPort()
String
getWorkerName()
Object[]
invokeRemoteTableMethod(int tableId, Method method, Object[] args)
Object
invokeRemoteTableMethodConcurrent(int handleId, Method method, Object[] args)
boolean
isConnected()
void
registerTableErrorHandler(QueryProcessorConnection.AsynchronousErrorHandler asynchronousErrorHandler)
void
release()
void
releaseRemoteTableHandle(Integer handleId)
void
releaseRemoteTableMapHandle(Integer handleId)
void
removeCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler)
Removes a command handler from the lsit of handlers that may service unknown commands.void
sendCommandNoResponse(com.fishlib.base.Command command)
Send a single commmand, expecting no response.void
subscribeToLogBuffer(com.fishlib.io.logger.LogBufferRecordListener listener)
boolean
subscribeToPreemptiveUpdates(int tableId, BitSet columnsToSubscribe, boolean isViewPort)
void
unsubscribeFromLogBuffer(com.fishlib.io.logger.LogBufferRecordListener listener)
boolean
unsubscribeFromPreemptiveUpdates(int subscriptionId)
Future<Boolean>
updatePreemptiveSubscriptionColumnsAsync(int id, BitSet newColumns)
Future<Boolean>
updateViewportAndColumnsAsync(int subscriptionId, Index newViewPort, BitSet newColumns)
Future<Boolean>
updateViewportAsync(int subscriptionId, Index newViewPort)
-
Method Details
-
getDispatcherConnection
QueryDispatcherConnection getDispatcherConnection() -
getProcessorName
String getProcessorName() -
getProcessorHost
String getProcessorHost() -
getProcessorPort
int getProcessorPort() -
getWebsocketPort
int getWebsocketPort() -
getEnvoyPrefix
String getEnvoyPrefix() -
getWorkerName
String getWorkerName() -
getProcessInfoId
String getProcessInfoId() -
subscribeToPreemptiveUpdates
-
unsubscribeFromPreemptiveUpdates
boolean unsubscribeFromPreemptiveUpdates(int subscriptionId) -
updatePreemptiveSubscriptionColumnsAsync
-
updateViewportAsync
-
updateViewportAndColumnsAsync
-
getTableMapManager
RemoteTableMapManager getTableMapManager() -
subscribeToLogBuffer
void subscribeToLogBuffer(@NotNull com.fishlib.io.logger.LogBufferRecordListener listener) throws IOException- Throws:
IOException
-
unsubscribeFromLogBuffer
void unsubscribeFromLogBuffer(@NotNull com.fishlib.io.logger.LogBufferRecordListener listener) throws IOException- Throws:
IOException
-
isConnected
boolean isConnected() -
release
- Throws:
IOException
-
getTableManager
RemoteTableHandleManager getTableManager() -
getRemoteDatabase
RemoteDatabase getRemoteDatabase() -
registerTableErrorHandler
void registerTableErrorHandler(QueryProcessorConnection.AsynchronousErrorHandler asynchronousErrorHandler) -
executeQuery
Execute the given query synchronously and return the result. This may convert the RemoteQuery into a byte stream and callexecuteQuery(byte[], boolean)
- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQuery
- the queryconcurrent
- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- query result
- Throws:
IOException
- if an error occurs communicating with the server
-
executeQuery
<TYPE> TYPE executeQuery(byte[] remoteQueryInstanceBytes, boolean concurrent)Execute the given query bytes synchronously and return the result. This method is for "advanced" usage only, if you already have a remote query instance in byte array form.- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQueryInstanceBytes
- the queryconcurrent
- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- query result
-
executeQuery
Add concurrent=false and delegate toexecuteQuery(RemoteQuery, boolean)
- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQuery
- the query- Returns:
- query result
- Throws:
IOException
- if an error occurs communicating with the server
-
executeQuery
default <TYPE> TYPE executeQuery(byte[] remoteQueryInstanceBytes)Add concurrent=false and delegate toexecuteQuery(byte[], boolean)
- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQueryInstanceBytes
- the query- Returns:
- query result
-
executeQueryAsync
<TYPE> QueryProcessorConnection.QueryHandle executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler) throws IOExceptionSubmit a query asynchronously. This may convert the RemoteQuery into a byte stream and callexecuteQueryAsync(byte[], boolean, AsyncQueryResultHandler)
Query progress will be reported via the AsyncQueryResultHandler.- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQuery
- the queryconcurrent
- if true, permit the query to proceed concurrently with data refresh processinghandler
- asynchronous result handler- Returns:
- a QueryHandle for the async query
- Throws:
IOException
- if an error occurs communicating with the server
-
executeQueryAsync
<TYPE> QueryProcessorConnection.QueryFuture<TYPE> executeQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent) throws IOExceptionSubmit a query asynchronously. This may convert the RemoteQuery into a byte stream and callexecuteQueryAsync(byte[], boolean)
Returns a query handle from which the results can be retrieved when results are ready- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQuery
- the queryconcurrent
- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- a QueryFuture for the async query
- Throws:
IOException
- if an error occurs communicating with the server
-
executeQueryAsync
<TYPE> QueryProcessorConnection.QueryHandle executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler)Submit a query asynchronously. Query progress will be reported via the AsyncQueryResultHandler. This method is for "advanced" usage only, if you already have a remote query instance in byte array form.- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQueryInstanceBytes
- the queryconcurrent
- if true, permit the query to proceed concurrently with data refresh processinghandler
- asynchronous result handler- Returns:
- a QueryHandle for the async query
-
executeQueryAsync
<TYPE> QueryProcessorConnection.QueryFuture<TYPE> executeQueryAsync(byte[] remoteQueryInstanceBytes, boolean concurrent)Submit a query asynchronously. Returns a query handle from which the results can be retrieved when results are ready This method is for "advanced" usage only, if you already have a remote query instance in byte array form.- Type Parameters:
TYPE
- the return type of the remote query- Parameters:
remoteQueryInstanceBytes
- the queryconcurrent
- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- a QueryFuture for the async query
-
releaseRemoteTableHandle
-
invokeRemoteTableMethod
-
invokeRemoteTableMethodConcurrent
-
releaseRemoteTableMapHandle
-
addCommandHandler
void addCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler)Adds a command handler to the list of handlers that may service unknown commands. The QueryProcessorConnection does not hold a reference to the command handler; so the user must ensure reachability of the commandHandler.- Parameters:
commandHandler
- the command handler to add.
-
removeCommandHandler
void removeCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler)Removes a command handler from the lsit of handlers that may service unknown commands.- Parameters:
commandHandler
- the command handler to remove
-
sendCommandNoResponse
Send a single commmand, expecting no response.- Parameters:
command
- The command to send.- Throws:
IOException
- If a problem occurs sending the command.
-