Class RepositoryUpgrade


  • public class RepositoryUpgrade
    extends Object
    • Field Detail

      • DEFAULT_INCLUDE_PATHS

        public static final Set<String> DEFAULT_INCLUDE_PATHS
      • DEFAULT_EXCLUDE_PATHS

        public static final Set<String> DEFAULT_EXCLUDE_PATHS
      • DEFAULT_MERGE_PATHS

        public static final Set<String> DEFAULT_MERGE_PATHS
    • Constructor Detail

      • RepositoryUpgrade

        public RepositoryUpgrade​(RepositoryContext source,
                                 org.apache.jackrabbit.oak.spi.state.NodeStore target)
        Creates a tool for copying the full contents of the source repository to the given target repository. Any existing content in the target repository will be overwritten.
        Parameters:
        source - source repository context
        target - target node store
    • Method Detail

      • copy

        public static void copy​(File source,
                                org.apache.jackrabbit.oak.spi.state.NodeStore target)
                         throws javax.jcr.RepositoryException
        Copies the contents of the repository in the given source directory to the given target node store.
        Parameters:
        source - source repository directory
        target - target node store
        Throws:
        javax.jcr.RepositoryException - if the copy operation fails
      • copy

        public static void copy​(RepositoryConfig source,
                                org.apache.jackrabbit.oak.spi.state.NodeStore target)
                         throws javax.jcr.RepositoryException
        Copies the contents of the repository with the given configuration to the given target node builder.
        Parameters:
        source - source repository configuration
        target - target node store
        Throws:
        javax.jcr.RepositoryException - if the copy operation fails
      • isCopyBinariesByReference

        public boolean isCopyBinariesByReference()
      • setCopyBinariesByReference

        public void setCopyBinariesByReference​(boolean copyBinariesByReference)
      • isSkipOnError

        public boolean isSkipOnError()
      • setSkipOnError

        public void setSkipOnError​(boolean skipOnError)
      • isEarlyShutdown

        public boolean isEarlyShutdown()
      • setEarlyShutdown

        public void setEarlyShutdown​(boolean earlyShutdown)
      • isCheckLongNames

        public boolean isCheckLongNames()
      • setCheckLongNames

        public void setCheckLongNames​(boolean checkLongNames)
      • isFilterLongNames

        public boolean isFilterLongNames()
      • setFilterLongNames

        public void setFilterLongNames​(boolean filterLongNames)
      • isSkipInitialization

        public boolean isSkipInitialization()
      • setSkipInitialization

        public void setSkipInitialization​(boolean skipInitialization)
      • getCustomCommitHooks

        public List<org.apache.jackrabbit.oak.spi.commit.CommitHook> getCustomCommitHooks()
        Returns the list of custom CommitHooks to be applied before the final type validation, reference and indexing hooks.
        Returns:
        the list of custom CommitHooks
      • setCustomCommitHooks

        public void setCustomCommitHooks​(List<org.apache.jackrabbit.oak.spi.commit.CommitHook> customCommitHooks)
        Sets the list of custom CommitHooks to be applied before the final type validation, reference and indexing hooks.
        Parameters:
        customCommitHooks - the list of custom CommitHooks
      • setIncludes

        public void setIncludes​(@NotNull
                                @NotNull String... includes)
        Sets the paths that should be included when the source repository is copied to the target repository.
        Parameters:
        includes - Paths to be included in the copy.
      • setExcludes

        public void setExcludes​(@NotNull
                                @NotNull String... excludes)
        Sets the paths that should be excluded when the source repository is copied to the target repository.
        Parameters:
        excludes - Paths to be excluded from the copy.
      • setMerges

        public void setMerges​(@NotNull
                              @NotNull String... merges)
        Sets the paths that should be merged when the source repository is copied to the target repository.
        Parameters:
        merges - Paths to be merged during copy.
      • setCopyVersions

        public void setCopyVersions​(Calendar minDate)
        Configures the version storage copy. Be default all versions are copied. One may disable it completely by setting null here or limit it to a selected date range: <minDate, now()>.
        Parameters:
        minDate - minimum date of the versions to copy or null to disable the storage version copying completely. Default value: 1970-01-01 00:00:00.
      • setCopyOrphanedVersions

        public void setCopyOrphanedVersions​(Calendar minDate)
        Configures copying of the orphaned version histories (eg. ones that are not referenced by the existing nodes). By default all orphaned version histories are copied. One may disable it completely by setting null here or limit it to a selected date range: <minDate, now()>.

        Please notice, that this option is overriden by the setCopyVersions(Calendar). You can't copy orphaned versions older than set in setCopyVersions(Calendar) and if you set null there, this option will be ignored.
        Parameters:
        minDate - minimum date of the orphaned versions to copy or null to not copy them at all. Default value: 1970-01-01 00:00:00.
      • copy

        public void copy​(org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer initializer)
                  throws javax.jcr.RepositoryException
        Copies the full content from the source to the target repository.

        The source repository must not be modified while the copy operation is running to avoid an inconsistent copy.

        Note that both the source and the target repository must be closed during the copy operation as this method requires exclusive access to the repositories.

        Parameters:
        initializer - optional extra repository initializer to use
        Throws:
        javax.jcr.RepositoryException - if the copy operation fails
      • mapSecurityConfig

        protected org.apache.jackrabbit.oak.spi.security.ConfigurationParameters mapSecurityConfig​(SecurityConfig config)
      • mapConfigurationParameters

        protected org.apache.jackrabbit.oak.spi.security.ConfigurationParameters mapConfigurationParameters​(BeanConfig config,
                                                                                                            String... mapping)