Class AckTruncateMessage

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, DataImportChannelItem

public class AckTruncateMessage extends AckMessage
Ack for a truncate (or delete) request. Includes:
  • whether the truncation or delete was actually done
  • all locations affected, whether the truncate or delete was performed or not.
  • Field Details

    • id

      protected long id
    • exception

      @Nullable protected Exception exception
    • result

      protected AckMessage.Result result
    • log

      protected static com.fishlib.io.logger.Logger log
    • NO_VERSION

      protected static final int NO_VERSION
      The version of data items that predate systematic versioning.
      See Also:
    • BASELINE_VERSION

      protected static final int BASELINE_VERSION
      The version of any data item that isn't given an explicit version. This should never change.
      See Also:
    • VERSION_INDICATOR

      protected static final int VERSION_INDICATOR
      This sequence indicates that a version int follows. Where this might be expected, its absence indicates the default or baseline version will be assumed. The value should be negative to avoid any chance of confusion with a size.
      See Also:
    • version

      protected int version
  • Method Details

    • getLocationResults

      @NotNull public List<AckTruncateMessage.LocationInfo> getLocationResults()
    • toString

      public String toString()
    • append

      public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput)
      Specified by:
      append in interface com.fishlib.base.log.LogOutputAppendable
    • getId

      public long getId()
      Overrides:
      getId in class AckMessage
    • getResult

      public AckMessage.Result getResult()
      Overrides:
      getResult in class AckMessage
    • getException

      @Nullable public Exception getException()
      Overrides:
      getException in class AckMessage
    • getPrimaryType

      public DataImportChannelType getPrimaryType()
      Description copied from interface: DataImportChannelItem
      Get the item type.
      Specified by:
      getPrimaryType in interface DataImportChannelItem
      Returns:
      The item type
    • getAlternateTypes

      public DataImportChannelType[] getAlternateTypes()
      Description copied from interface: DataImportChannelItem
      Get all alternate types that this item can process as input.
      Specified by:
      getAlternateTypes in interface DataImportChannelItem
      Returns:
      The alternate Types
    • prepareVersion

      protected void prepareVersion(@NotNull ByteBuffer bodyBuffer)
      Put the version bytes into the body buffer. Does not clear or flip the buffer. This is called only by PayloadDataImportChannelItem on behalf of derived classes.
      Parameters:
      bodyBuffer - the buffer to populate
    • checkVersion

      protected void checkVersion()
      Allow subclasses to allow for future versions. This is relevant for the data items that could be sent out to an older client. A subclass overriding this likely also needs to override finishRead to ensure that extra bytes are consumed (safely).
    • read

      public void read(@NotNull ByteBuffer buffer, byte wireDataType)
      Description copied from interface: DataImportChannelItem

      Fill this item's contents from the supplied buffer.

      Header data as described in DataImportChannelItem.send(IOJob) will already have been consumed.

      Specified by:
      read in interface DataImportChannelItem
      Parameters:
      buffer - The buffer to read data from
      wireDataType - the data type from the stream.
    • getVersion

      public int getVersion()
      Description copied from interface: DataImportChannelItem
      Get the version of this DataImportChannelItem.
      Specified by:
      getVersion in interface DataImportChannelItem
      Returns:
      the version of the DataImportChannelItem.
    • getCurrentVersion

      public int getCurrentVersion()
      Description copied from interface: DataImportChannelItem
      Get the latest version supported by this DataImportChannelItem. This is used by abstract implementations to verify the version read off the wire.
      Specified by:
      getCurrentVersion in interface DataImportChannelItem
      Returns:
      the latest version supported by this DataImportChannelItem