Package one.microstream.storage.types
Class StorageWriteControllerReadOnlyMode
java.lang.Object
one.microstream.storage.types.StorageWriteControllerReadOnlyMode
- All Implemented Interfaces:
WriteController
,PersistenceWriteController
,StorageWriteController
public class StorageWriteControllerReadOnlyMode extends Object implements StorageWriteController
StorageWriteController
implementation that
allows to switch between the supplied and a read only
StorageWriteController. If the read only mode is disabled
the supplied StorageWriteController will be used.
Setup:
final EmbeddedStorageFoundation<?> foundation = EmbeddedStorage.Foundation();
final StorageWriteControllerReadOnlyMode storageWriteController =
new StorageWriteControllerReadOnlyMode(foundation.getWriteController());
foundation.setWriteController(storageWriteController);
final EmbeddedStorageManager storage = foundation.start();
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceWriteController
PersistenceWriteController.Disabled, PersistenceWriteController.Enabled
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageWriteController
StorageWriteController.Wrapper
-
Constructor Summary
Constructors Constructor Description StorageWriteControllerReadOnlyMode(WriteController writeController)
Create a new instance of a StorageWriteControllerReadOnlyMode. -
Method Summary
Modifier and Type Method Description boolean
isBackupEnabled()
boolean
isDeletionDirectoryEnabled()
boolean
isFileCleanupEnabled()
boolean
isFileDeletionEnabled()
boolean
isReadOnly()
boolean
isWritable()
void
setReadOnly(boolean readOnly)
void
validateIsWritable()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface one.microstream.persistence.types.PersistenceWriteController
isStoringEnabled, validateIsStoringEnabled
Methods inherited from interface one.microstream.storage.types.StorageWriteController
validateIsBackupEnabled, validateIsDeletionDirectoryEnabled, validateIsFileCleanupEnabled, validateIsFileDeletionEnabled
-
Constructor Details
-
StorageWriteControllerReadOnlyMode
Create a new instance of a StorageWriteControllerReadOnlyMode. The constructed instance will have the read only mode ENABLED.- Parameters:
writeController
- theStorageWriteController
instance that is used if the read only mode is disabled.
-
-
Method Details
-
setReadOnly
public void setReadOnly(boolean readOnly) -
isReadOnly
public boolean isReadOnly() -
validateIsWritable
public void validateIsWritable()- Specified by:
validateIsWritable
in interfaceWriteController
-
isWritable
public boolean isWritable()- Specified by:
isWritable
in interfaceWriteController
-
isFileCleanupEnabled
public boolean isFileCleanupEnabled()- Specified by:
isFileCleanupEnabled
in interfaceStorageWriteController
-
isBackupEnabled
public boolean isBackupEnabled()- Specified by:
isBackupEnabled
in interfaceStorageWriteController
-
isDeletionDirectoryEnabled
public boolean isDeletionDirectoryEnabled()- Specified by:
isDeletionDirectoryEnabled
in interfaceStorageWriteController
-
isFileDeletionEnabled
public boolean isFileDeletionEnabled()- Specified by:
isFileDeletionEnabled
in interfaceStorageWriteController
-