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:MessageRecordRepository
Retrieves metadata for a given topic.- Specified by:
meta
in interfaceMessageRecordRepository
- Parameters:
topic
- The topic name.- Returns:
- A Result containing the MetaRecord or errors.
-
list
Description copied from interface:MessageRecordRepository
Lists messages for a topic starting from a specific index.- Specified by:
list
in 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:MessageRecordRepository
Reads a specific message by topic and index.- Specified by:
read
in 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:MessageRecordRepository
Writes a new message record.- Specified by:
write
in interfaceMessageRecordRepository
- Parameters:
record
- The MessageRecord to write.- Returns:
- A Result containing the written MessageRecord or errors.
-
delete
Description copied from interface:MessageRecordRepository
Deletes a message by topic and index.- Specified by:
delete
in 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:MessageRecordRepository
Deletes a message by its UUID.- Specified by:
deleteID
in interfaceMessageRecordRepository
- Parameters:
uuid
- The UUID of the message to deleteID.- Returns:
- A Result containing the deleted MessageRecord or errors.
-
lookupID
Description copied from interface:MessageRecordRepository
Reads a message by its UUID.- Specified by:
lookupID
in interfaceMessageRecordRepository
- Parameters:
uuid
- The UUID of the message to lookupID.- Returns:
- A Result containing the MessageRecord or errors.
-
topics
Description copied from interface:MessageRecordRepository
Retrieves a list of all available topic names.- Specified by:
topics
in interfaceMessageRecordRepository
- Returns:
- A Result containing a list of topic strings or errors.
-
saveMeta
Description copied from interface:MessageRecordRepository
Saves or updates metadata for a topic.- Specified by:
saveMeta
in interfaceMessageRecordRepository
- Parameters:
metaRecord
- The MetaRecord to save.- Returns:
- A Result containing the saved MetaRecord or errors.
-