Class AbstractOcflStorage

    • Constructor Detail

      • AbstractOcflStorage

        public AbstractOcflStorage()
    • Method Detail

      • initializeStorage

        public void initializeStorage​(OcflVersion ocflVersion,
                                      OcflExtensionConfig layoutConfig,
                                      InventoryMapper inventoryMapper)
        Initializes the OCFL root. If it is an existing OCFL repository and the root has already been initialized, then this method should do nothing. This method must be called before the object may be used.

        layoutConfig may be null if the OCFL repository already exists, in which case the existing configuration is used. If layoutConfig is specified for an existing repository, initialization will fail if the configurations do not match.

        Specified by:
        initializeStorage in interface OcflStorage
        Parameters:
        ocflVersion - the OCFL version
        layoutConfig - the storage layout configuration, may be null to auto-detect existing configuration
        inventoryMapper - the mapper to use for inventory serialization
      • close

        public void close()
        Shutsdown any resources the OclfStorage may have open, such as ExecutorServices. Once closed, additional requests will be rejected. Calling this method is optional, and it is more efficient to just let the shutdown hooks take care of closing the resources.
        Specified by:
        close in interface OcflStorage
      • doInitialize

        protected abstract void doInitialize​(OcflExtensionConfig layoutConfig)
        Does whatever is necessary to initialize OCFL repository storage.
        Parameters:
        layoutConfig - the storage layout configuration, may be null to auto-detect existing configuration
      • ensureOpen

        protected void ensureOpen()
        Throws an exception if the repository has not been initialized or is closed