Interface MessageRecordRepository

All Known Implementing Classes:
CouchMessageRecordRepository

public interface MessageRecordRepository
Interface defining operations for managing MessageRecords.
Author:
Peter Blakeley : @pblakez pb@blakez.org
  • Method Details

    • meta

      Result<MetaRecord> meta(String topic)
      Retrieves metadata for a given topic.
      Parameters:
      topic - The topic name.
      Returns:
      A Result containing the MetaRecord or errors.
    • list

      Result<List<MessageRecord>> list(String topic, long startIndex, long batchSize)
      Lists messages for a topic starting from a specific index.
      Parameters:
      topic - The topic name.
      startIndex - The starting index for the list.
      batchSize - The maximum number of messages to retrieve.
      Returns:
      A Result containing a list of MessageRecords or errors.
    • read

      Result<MessageRecord> read(String topic, long index)
      Reads a specific message by topic and index.
      Parameters:
      topic - The topic name.
      index - The index of the message.
      Returns:
      A Result containing the MessageRecord or errors.
    • write

      Writes a new message record.
      Parameters:
      record - The MessageRecord to write.
      Returns:
      A Result containing the written MessageRecord or errors.
    • delete

      Result<MessageRecord> delete(String topic, long index)
      Deletes a message by topic and index.
      Parameters:
      topic - The topic name.
      index - The index of the message to deleteID.
      Returns:
      A Result containing the deleted MessageRecord or errors.
    • deleteID

      Result<MessageRecord> deleteID(UUID uuid)
      Deletes a message by its UUID.
      Parameters:
      uuid - The UUID of the message to deleteID.
      Returns:
      A Result containing the deleted MessageRecord or errors.
    • lookupID

      Result<MessageRecord> lookupID(UUID uuid)
      Reads a message by its UUID.
      Parameters:
      uuid - The UUID of the message to lookupID.
      Returns:
      A Result containing the MessageRecord or errors.
    • topics

      Result<List<String>> topics()
      Retrieves a list of all available topic names.
      Returns:
      A Result containing a list of topic strings or errors.
    • saveMeta

      Result<MetaRecord> saveMeta(MetaRecord metaRecord)
      Saves or updates metadata for a topic.
      Parameters:
      metaRecord - The MetaRecord to save.
      Returns:
      A Result containing the saved MetaRecord or errors.