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.EnabledNested 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 booleanisBackupEnabled()booleanisDeletionDirectoryEnabled()booleanisFileCleanupEnabled()booleanisFileDeletionEnabled()booleanisReadOnly()booleanisWritable()voidsetReadOnly(boolean readOnly)voidvalidateIsWritable()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.microstream.persistence.types.PersistenceWriteController
isStoringEnabled, validateIsStoringEnabledMethods 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- theStorageWriteControllerinstance 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:
validateIsWritablein interfaceWriteController
-
isWritable
public boolean isWritable()- Specified by:
isWritablein interfaceWriteController
-
isFileCleanupEnabled
public boolean isFileCleanupEnabled()- Specified by:
isFileCleanupEnabledin interfaceStorageWriteController
-
isBackupEnabled
public boolean isBackupEnabled()- Specified by:
isBackupEnabledin interfaceStorageWriteController
-
isDeletionDirectoryEnabled
public boolean isDeletionDirectoryEnabled()- Specified by:
isDeletionDirectoryEnabledin interfaceStorageWriteController
-
isFileDeletionEnabled
public boolean isFileDeletionEnabled()- Specified by:
isFileDeletionEnabledin interfaceStorageWriteController
-