Class DefaultOcflObjectSessionFactory

    • Constructor Detail

      • DefaultOcflObjectSessionFactory

        public DefaultOcflObjectSessionFactory​(edu.wisc.library.ocfl.api.MutableOcflRepository ocflRepo,
                                               Path stagingRoot,
                                               com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                               Cache<String,​ResourceHeaders> headersCache,
                                               Cache<String,​String> rootIdCache,
                                               CommitType defaultCommitType,
                                               String defaultVersionMessage,
                                               String defaultVersionUserName,
                                               String defaultVersionUserAddress)
        Creates a new DefaultOcflObjectSessionFactory
        Parameters:
        ocflRepo - the ocfl repo
        stagingRoot - the path to the directory to stage changes in
        objectMapper - the object mapper used to serialize resource headers
        headersCache - the cache to store deserialized headers in
        rootIdCache - the cache that maps OCFL objects to the root resource id
        defaultCommitType - specifies if commits should create new versions
        defaultVersionMessage - the text to insert in the OCFL version message
        defaultVersionUserName - the user name to insert in the OCFL version
        defaultVersionUserAddress - the user address to insert in the OCFL version
    • Method Detail

      • useUnsafeWrite

        public void useUnsafeWrite​(boolean useUnsafeWrite)
        Description copied from interface: OcflObjectSessionFactory
        When unsafe writes are enabled, files are added to OCFL versions by providing the OCFL client with their digest. The client trusts that the digest is accurate and does not calculate the value for itself. This should increase performance, but will corrupt the object if the digest is incorrect.
        Specified by:
        useUnsafeWrite in interface OcflObjectSessionFactory
        Parameters:
        useUnsafeWrite - true to use unsafe OCFL writes
      • setDefaultCommitType

        public void setDefaultCommitType​(CommitType defaultCommitType)
        Allows the default CommitType to be changed at run time -- useful for testing.
        Parameters:
        defaultCommitType - commit type
      • setHeadersValidator

        public void setHeadersValidator​(HeadersValidator headersValidator)
        Changes the headers validator implementation for TESTING purposes.
        Parameters:
        headersValidator - the validator to use