Interface RequestResultHandler
- All Superinterfaces:
com.fishlib.base.log.LogOutputAppendable
- All Known Implementing Classes:
RemoteTableDataService.TableLocationProviderImpl
,RemoteTableLocationImpl
public interface RequestResultHandler
extends com.fishlib.base.log.LogOutputAppendable
This interface defines the callback methods that users of the Table Data Protocol must implement. For further
detail see
TableDataProtocolDriverImpl
-
Field Summary
Fields Modifier and Type Field Description static RequestResultHandler
NULL
A single instance for when a handler is required, but no actions need be taken -
Method Summary
Modifier and Type Method Description boolean
checkHasSubscribers()
Invoked when the Table data protocol connection is established, or lost.void
onComplete(TableDataRequest request)
Invoked when the request completed successfully.void
onRejection(TableDataRequest request, String rejectionMessage, TableDataProtocol.RequestRejectionType requestRejectionType)
Invoked when the specified request was rejected.void
onTableLocationKey(TableLocationKey locationKey)
Invoked in response to atable locations request
for each discoveredTableLocationKey
.void
onTableLocationState(TableLocationState state)
Invoked in response to alocation refresh request
.void
onTimeout(TableDataRequest request)
Invoked when the specified request timed out before a response was received.
-
Field Details
-
NULL
A single instance for when a handler is required, but no actions need be taken
-
-
Method Details
-
onTimeout
Invoked when the specified request timed out before a response was received.- Parameters:
request
- the request object.
-
onRejection
void onRejection(@NotNull TableDataRequest request, String rejectionMessage, TableDataProtocol.RequestRejectionType requestRejectionType)Invoked when the specified request was rejected. This typically happens during subscription to a location- Parameters:
request
- the request object.rejectionMessage
- a message for context about the rejectionrequestRejectionType
- what type of rejection was received
-
onComplete
Invoked when the request completed successfully.- Parameters:
request
- the request object
-
onTableLocationKey
Invoked in response to atable locations request
for each discoveredTableLocationKey
.- Parameters:
locationKey
- the discoveredTableLocationKey
-
onTableLocationState
Invoked in response to alocation refresh request
.- Parameters:
state
- the updatedTableLocationState
for the location requested
-
checkHasSubscribers
boolean checkHasSubscribers()Invoked when the Table data protocol connection is established, or lost. Implementations should use this as a hook to manage the state of internal subscribers.- Returns:
- true if there were any valid subscribers remaining.
-