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 Details

    • NULL

      static final RequestResultHandler NULL
      A single instance for when a handler is required, but no actions need be taken
  • Method Details

    • onTimeout

      void onTimeout(@NotNull TableDataRequest request)
      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 rejection
      requestRejectionType - what type of rejection was received
    • onComplete

      void onComplete(@NotNull TableDataRequest request)
      Invoked when the request completed successfully.
      Parameters:
      request - the request object
    • onTableLocationKeyAdded

      void onTableLocationKeyAdded(@NotNull TableLocationKey locationKey)
      Invoked in response to a table locations request for each discovered TableLocationKey.
      Parameters:
      locationKey - the discovered TableLocationKey
    • onTableLocationKeyRemoved

      void onTableLocationKeyRemoved(@NotNull TableLocationKey locationKey)
      Invoked when the upstream provider has removed, or detected a removed location.
      Parameters:
      locationKey - the TableLocationKey that was removed
    • onTableLocationState

      void onTableLocationState(@NotNull TableLocationState state)
      Invoked in response to a location refresh request.
      Parameters:
      state - the updated TableLocationState 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.