Class StorageWriteControllerReadOnlyMode

  • All Implemented Interfaces:
    one.microstream.afs.types.WriteController, one.microstream.persistence.types.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();
     
     
    • Constructor Detail

      • StorageWriteControllerReadOnlyMode

        public StorageWriteControllerReadOnlyMode​(one.microstream.afs.types.WriteController writeController)
        Create a new instance of a StorageWriteControllerReadOnlyMode. The constructed instance will have the read only mode ENABLED.
        Parameters:
        writeController - the StorageWriteController instance that is used if the read only mode is disabled.
    • Method Detail

      • setReadOnly

        public void setReadOnly​(boolean readOnly)
      • isReadOnly

        public boolean isReadOnly()
      • validateIsWritable

        public void validateIsWritable()
        Specified by:
        validateIsWritable in interface one.microstream.afs.types.WriteController
      • isWritable

        public boolean isWritable()
        Specified by:
        isWritable in interface one.microstream.afs.types.WriteController