InboxStorage

public interface InboxStorage implements Storage<I, M, R>

A contract for storages of Inbox messages.

The records a storage of this type are spreads across shards identified by a shard index.

Typically, the storage instance is specific to the server environment and is used across BoundedContexts to store the delivered messages.

Inheritors

Functions

Link copied to clipboard
public abstract Optional<InboxMessage> newestMessageToDeliver(ShardIndex index)
Finds the newest message to deliver in the given shard.
Link copied to clipboard
public abstract Page<InboxMessage> readAll(ShardIndex index, int pageSize)
Reads the contents of the storage by the given shard index and returns the first page of the results.
Link copied to clipboard
public abstract void removeAll(Iterable<InboxMessage> messages)
Removes the passed messages from the storage.
Link copied to clipboard
public abstract void write(InboxMessage message)
Writes a message to the storage.
Link copied to clipboard
public abstract void writeAll(Iterable<InboxMessage> messages)
Writes several messages to the storage.

Inherited functions

Link copied to clipboard
public abstract void close()
Closes the storage.
public abstract void close()
Link copied to clipboard
public abstract Iterator<I> index()
Returns an iterator over identifiers of records in the storage.
Link copied to clipboard
public abstract boolean isMultitenant()
Verifies whether the storage is multitenant.
Link copied to clipboard
public abstract boolean isOpen()
Verifies whether the storage is open.
Link copied to clipboard
public abstract Optional<M> read(R request)
Reads a record from the storage by the specified request.
Link copied to clipboard
public abstract void write(I id, M record)
Writes a record into the storage.