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
FieldsModifier and TypeFieldDescriptionstatic final RequestResultHandlerA single instance for when a handler is required, but no actions need be taken -
Method Summary
Modifier and TypeMethodDescriptionbooleanInvoked when the Table data protocol connection is established, or lost.voidonComplete(@NotNull TableDataRequest request) Invoked when the request completed successfully.voidonRejection(@NotNull TableDataRequest request, String rejectionMessage, TableDataProtocol.RequestRejectionType requestRejectionType) Invoked when the specified request was rejected.voidonTableLocationKeyAdded(@NotNull TableLocationKey locationKey) Invoked in response to atable locations requestfor each discoveredTableLocationKey.voidonTableLocationKeyRemoved(@NotNull TableLocationKey locationKey) Invoked when the upstream provider has removed, or detected a removed location.voidonTableLocationState(@NotNull TableLocationState state) Invoked in response to alocation refresh request.voidonTimeout(@NotNull TableDataRequest request) Invoked when the specified request timed out before a response was received.Methods inherited from interface com.fishlib.base.log.LogOutputAppendable
append
-
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 @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
-
onTableLocationKeyAdded
Invoked in response to atable locations requestfor each discoveredTableLocationKey.- Parameters:
locationKey- the discoveredTableLocationKey
-
onTableLocationKeyRemoved
Invoked when the upstream provider has removed, or detected a removed location.- Parameters:
locationKey- theTableLocationKeythat was removed
-
onTableLocationState
Invoked in response to alocation refresh request.- Parameters:
state- the updatedTableLocationStatefor 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.
-