AbstractStorage

public abstract class AbstractStorage<I, M extends Message, R extends ReadRequest<I>> implements Storage<I, M, R>

Abstract base for storages.

A storage can read and write messages of the given type.

Parameters

<I>

the type of IDs of storage records

<M>

the type of records kept in the storage

<R>

the type of read requests for the storage

Inheritors

Constructors

Link copied to clipboard
protected void AbstractStorage(boolean multitenant)

Functions

Link copied to clipboard
protected void checkNotClosed()
protected void checkNotClosed(String message)
Ensures the storage is not closed.
Link copied to clipboard
public void close()
Closes the storage.
Link copied to clipboard
public boolean isClosed()
Tests whether the storage is closed.
Link copied to clipboard
public boolean isMultitenant()
Verifies whether the storage is multitenant.
Link copied to clipboard
public boolean isOpen()
Tests whether the storage is open.

Inherited functions

Link copied to clipboard
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 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.