I
- the type of IDs of storage recordsM
- the type of records kept in the storageR
- the type of read requests for the storagepublic abstract class AbstractStorage<I,M extends com.google.protobuf.Message,R extends ReadRequest<I>> extends java.lang.Object implements Storage<I,M,R>
A storage can read and write messages of the given type.
Modifier | Constructor and Description |
---|---|
protected |
AbstractStorage(boolean multitenant) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotClosed()
Ensures the storage is not closed.
|
protected void |
checkNotClosed(java.lang.String message)
Ensures the storage is not closed.
|
void |
close()
Closes the storage.
|
boolean |
isClosed()
Tests whether the storage is closed.
|
boolean |
isMultitenant()
Verifies whether the storage is multitenant.
|
boolean |
isOpen()
Tests whether the storage is open.
|
public boolean isMultitenant()
Storage
isMultitenant
in interface Storage<I,M extends com.google.protobuf.Message,R extends ReadRequest<I>>
true
if the storage was created with multitenancy support,
false
otherwiseprotected void checkNotClosed(java.lang.String message) throws java.lang.IllegalStateException
If the storage is closed, throws IllegalStateException
with the passed message.
message
- exception messagejava.lang.IllegalStateException
- if the storage is closedprotected void checkNotClosed() throws java.lang.IllegalStateException
If the storage is closed, throws IllegalStateException
.
java.lang.IllegalStateException
- if the storage is closedpublic boolean isOpen()
isOpen
in interface Storage<I,M extends com.google.protobuf.Message,R extends ReadRequest<I>>
true
if the storage is open for writing (wasn't closed until now),
false
otherwiseAbstractStorage.close()
public boolean isClosed()
true
if the storage is closed, false
otherwiseAbstractStorage.close()