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 interfaceQueryProcessorConnection.AsynchronousErrorHandlerstatic interfaceQueryProcessorConnection.AsyncQueryResultHandler<RETURN_TYPE>static interfaceQueryProcessorConnection.DisconnectHandlerstatic interfaceQueryProcessorConnection.QueryFuture<RETURN_TYPE>Interface returned from certain asynchronous calls.static interfaceQueryProcessorConnection.QueryHandleInterface returned from asynchronous queries.static interfaceQueryProcessorConnection.QueryProcessorConnectionCommandHandlerA command handler that can be attached to this QueryProcessorConnection. -
Method Summary
Modifier and Type Method Description voidaddCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler)Adds a command handler to the list of handlers that may service unknown commands.default <TYPE> TYPEexecuteQuery(byte[] remoteQueryInstanceBytes)Add concurrent=false and delegate toexecuteQuery(byte[], boolean)<TYPE> TYPEexecuteQuery(byte[] remoteQueryInstanceBytes, boolean concurrent)Execute the given query bytes synchronously and return the result.default <TYPE> TYPEexecuteQuery(RemoteQuery<TYPE> remoteQuery)Add concurrent=false and delegate toexecuteQuery(RemoteQuery, boolean)<TYPE> TYPEexecuteQuery(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.QueryHandleexecuteQueryAsync(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.QueryHandleexecuteQueryAsync(RemoteQuery<TYPE> remoteQuery, boolean concurrent, QueryProcessorConnection.AsyncQueryResultHandler<TYPE> handler)Submit a query asynchronously.QueryDispatcherConnectiongetDispatcherConnection()StringgetEnvoyPrefix()StringgetProcessorHost()StringgetProcessorName()intgetProcessorPort()RemoteDatabasegetRemoteDatabase()RemoteTableHandleManagergetTableManager()RemoteTableMapManagergetTableMapManager()intgetWebsocketPort()StringgetWorkerName()Object[]invokeRemoteTableMethod(int tableId, Method method, Object[] args)ObjectinvokeRemoteTableMethodConcurrent(int handleId, Method method, Object[] args)booleanisConnected()voidregisterTableErrorHandler(QueryProcessorConnection.AsynchronousErrorHandler asynchronousErrorHandler)voidrelease()voidreleaseRemoteTableHandle(Integer handleId)voidreleaseRemoteTableMapHandle(Integer handleId)voidremoveCommandHandler(QueryProcessorConnection.QueryProcessorConnectionCommandHandler commandHandler)Removes a command handler from the lsit of handlers that may service unknown commands.voidsendCommandNoResponse(com.fishlib.base.Command command)Send a single commmand, expecting no response.voidsubscribeToLogBuffer(com.fishlib.io.logger.LogBufferRecordListener listener)booleansubscribeToPreemptiveUpdates(int tableId, BitSet columnsToSubscribe, boolean isViewPort)voidunsubscribeFromLogBuffer(com.fishlib.io.logger.LogBufferRecordListener listener)booleanunsubscribeFromPreemptiveUpdates(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() -
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)- Parameters:
remoteQuery- the queryconcurrent- if true, permit the query to proceed concurrently with data refresh processing- Returns:
- query result
- Throws:
IOException
-
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.- 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)- Parameters:
remoteQuery- the query- Returns:
- query result
- Throws:
IOException
-
executeQuery
default <TYPE> TYPE executeQuery(byte[] remoteQueryInstanceBytes)Add concurrent=false and delegate toexecuteQuery(byte[], boolean)- 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.- 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
-
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- 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
-
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.- 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.- 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.
-