public class InMemoryCatchUpStorage extends AbstractStorage<io.spine.server.delivery.CatchUpId,io.spine.server.delivery.CatchUp,CatchUpReadRequest> implements CatchUpStorage, io.spine.logging.Logging
CatchUpStorage
.Constructor and Description |
---|
InMemoryCatchUpStorage(boolean multitenant) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<io.spine.server.delivery.CatchUpId> |
index()
Returns an iterator over identifiers of records in the storage.
|
java.util.Optional<io.spine.server.delivery.CatchUp> |
read(CatchUpReadRequest request)
Reads a record from the storage by the specified request.
|
java.lang.Iterable<io.spine.server.delivery.CatchUp> |
readAll()
Returns an
Iterable over all the stored catch-up processes. |
java.lang.Iterable<io.spine.server.delivery.CatchUp> |
readByType(io.spine.type.TypeUrl projectionType)
Reads all the catch-up processes which update the projection of the specified type.
|
void |
write(io.spine.server.delivery.CatchUp message)
Writes a message to the storage.
|
void |
write(io.spine.server.delivery.CatchUpId id,
io.spine.server.delivery.CatchUp record)
Writes a record into the storage.
|
checkNotClosed, checkNotClosed, close, isClosed, isMultitenant, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, isMultitenant, isOpen
public void write(io.spine.server.delivery.CatchUp message)
CatchUpStorage
write
in interface CatchUpStorage
message
- a message to writepublic java.lang.Iterable<io.spine.server.delivery.CatchUp> readAll()
CatchUpStorage
Iterable
over all the stored catch-up processes.readAll
in interface CatchUpStorage
public java.util.Iterator<io.spine.server.delivery.CatchUpId> index()
Storage
index
in interface Storage<io.spine.server.delivery.CatchUpId,io.spine.server.delivery.CatchUp,CatchUpReadRequest>
public java.util.Optional<io.spine.server.delivery.CatchUp> read(CatchUpReadRequest request)
Storage
read
in interface Storage<io.spine.server.delivery.CatchUpId,io.spine.server.delivery.CatchUp,CatchUpReadRequest>
request
- the request to read the recordOptional.empty()
if there is no record matching this requestpublic void write(io.spine.server.delivery.CatchUpId id, io.spine.server.delivery.CatchUp record)
Storage
Rewrites it if a record with this ID already exists in the storage.
write
in interface Storage<io.spine.server.delivery.CatchUpId,io.spine.server.delivery.CatchUp,CatchUpReadRequest>
id
- the ID for the recordrecord
- the record to storepublic java.lang.Iterable<io.spine.server.delivery.CatchUp> readByType(io.spine.type.TypeUrl projectionType)
CatchUpStorage
readByType
in interface CatchUpStorage
projectionType
- the type of the projection state to use for filtering