Interface DataImportChannelProcessorBase

All Superinterfaces:
DataImportProcessorBase
All Known Implementing Classes:
DataImportChannelProcessor, DataImportCommandProcessor

public interface DataImportChannelProcessorBase extends DataImportProcessorBase
Psuedo base class for channel processors (multiple inheritance would be handy here).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Only get the new-line character once, so as to avoid repeated permission checks This is slightly deficient, since it assumes no issue over different line separators at the client.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel
    Get the DataImportChannel for this channel processor.
    void
    handleApplicationMessage(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, DataImportChannelItem item)
    Handle an application-level message.
    default void
    handleDisconnection(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel)
     
    default void
    handleProtocolError(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, String explanation)
     
    default void
    handleReadException(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, Exception exception)
     
    default void
    handleReject(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, String reason)
     
    default void
    handleUnexpectedMessage(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, DataImportChannelType type)
     
    default void
    Derived classes are required to call this method after construction.
    static void
    sendReject(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, com.fishlib.io.logger.Logger log, String logPrefix, String message)
    Send a rejection via the specified channel, and close the channel.
    default void
    sendReject(com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, com.fishlib.io.logger.Logger log, String logPrefix, String message, Exception cause)
    Send a rejection via the specified channel, and close the channel.
    default void
    sendReject(String message)
    Send a rejection message via this channel processor's channel, and close the channel.
    default void
    sendReject(String message, Exception cause)
    Send a rejection message via this channel processor's channel, and close the channel.

    Methods inherited from interface com.illumon.iris.db.tables.dataimport.logtailer.DataImportProcessorBase

    getLog, getLogPrefix, shutdown
  • Field Details

    • NEW_LINE

      static final String NEW_LINE
      Only get the new-line character once, so as to avoid repeated permission checks This is slightly deficient, since it assumes no issue over different line separators at the client.
  • Method Details

    • getChannel

      com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel getChannel()
      Get the DataImportChannel for this channel processor.
      Returns:
      the DataImportChannel
    • initializeApplicationHandler

      default void initializeApplicationHandler()
      Derived classes are required to call this method after construction. This is generally codified in a factory method.
    • handleUnexpectedMessage

      default void handleUnexpectedMessage(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull DataImportChannelType type)
    • handleProtocolError

      default void handleProtocolError(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull String explanation)
    • handleReject

      default void handleReject(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull String reason)
    • handleReadException

      default void handleReadException(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull Exception exception)
    • handleDisconnection

      default void handleDisconnection(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel)
    • sendReject

      default void sendReject(@NotNull String message)
      Send a rejection message via this channel processor's channel, and close the channel.
      Parameters:
      message - The text of the rejection message
    • sendReject

      default void sendReject(@NotNull String message, @NotNull Exception cause)
      Send a rejection message via this channel processor's channel, and close the channel.
      Parameters:
      message - The prefix of the rejection message
      cause - The cause of the rejection
    • sendReject

      default void sendReject(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull com.fishlib.io.logger.Logger log, @NotNull String logPrefix, @NotNull String message, @NotNull Exception cause)
      Send a rejection via the specified channel, and close the channel.
      Parameters:
      channel - The channel
      log - The log
      logPrefix - The log prefix
      message - The message
      cause - The cause
    • sendReject

      static void sendReject(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull com.fishlib.io.logger.Logger log, @NotNull String logPrefix, @NotNull String message)
      Send a rejection via the specified channel, and close the channel.
      Parameters:
      channel - The channel
      log - The log
      logPrefix - The log prefix
      message - The message
    • handleApplicationMessage

      void handleApplicationMessage(@NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportChannel channel, @NotNull DataImportChannelItem item)
      Handle an application-level message.
      Parameters:
      channel - The channel
      item - The message