Class CouchMessageRecordRepository
java.lang.Object
net.blakez.bppmq.infra.data.queue.CouchMessageRecordRepository
- All Implemented Interfaces:
MessageRecordRepository
CouchDB implementation of MessageRecordRepository.
- Author:
- Peter Blakeley : @pblakez pb@blakez.org
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeletes a message by topic and index.Deletes a message by its UUID.Lists messages for a topic starting from a specific index.Reads a message by its UUID.Retrieves metadata for a given topic.Reads a specific message by topic and index.saveMeta(MetaRecord metaRecord) Saves or updates metadata for a topic.topics()Retrieves a list of all available topic names.write(MessageRecord record) Writes a new message record.
-
Constructor Details
-
CouchMessageRecordRepository
public CouchMessageRecordRepository(com.attain.db.couch2.AttainCouchDB2 cdb)
-
-
Method Details
-
meta
Description copied from interface:MessageRecordRepositoryRetrieves metadata for a given topic.- Specified by:
metain interfaceMessageRecordRepository- Parameters:
topic- The topic name.- Returns:
- A Result containing the MetaRecord or errors.
-
list
Description copied from interface:MessageRecordRepositoryLists messages for a topic starting from a specific index.- Specified by:
listin interfaceMessageRecordRepository- 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
Description copied from interface:MessageRecordRepositoryReads a specific message by topic and index.- Specified by:
readin interfaceMessageRecordRepository- Parameters:
topic- The topic name.index- The index of the message.- Returns:
- A Result containing the MessageRecord or errors.
-
write
Description copied from interface:MessageRecordRepositoryWrites a new message record.- Specified by:
writein interfaceMessageRecordRepository- Parameters:
record- The MessageRecord to write.- Returns:
- A Result containing the written MessageRecord or errors.
-
delete
Description copied from interface:MessageRecordRepositoryDeletes a message by topic and index.- Specified by:
deletein interfaceMessageRecordRepository- Parameters:
topic- The topic name.index- The index of the message to deleteID.- Returns:
- A Result containing the deleted MessageRecord or errors.
-
deleteID
Description copied from interface:MessageRecordRepositoryDeletes a message by its UUID.- Specified by:
deleteIDin interfaceMessageRecordRepository- Parameters:
uuid- The UUID of the message to deleteID.- Returns:
- A Result containing the deleted MessageRecord or errors.
-
lookupID
Description copied from interface:MessageRecordRepositoryReads a message by its UUID.- Specified by:
lookupIDin interfaceMessageRecordRepository- Parameters:
uuid- The UUID of the message to lookupID.- Returns:
- A Result containing the MessageRecord or errors.
-
topics
Description copied from interface:MessageRecordRepositoryRetrieves a list of all available topic names.- Specified by:
topicsin interfaceMessageRecordRepository- Returns:
- A Result containing a list of topic strings or errors.
-
saveMeta
Description copied from interface:MessageRecordRepositorySaves or updates metadata for a topic.- Specified by:
saveMetain interfaceMessageRecordRepository- Parameters:
metaRecord- The MetaRecord to save.- Returns:
- A Result containing the saved MetaRecord or errors.
-