Class RepositorySidegrade


  • public class RepositorySidegrade
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      RepositorySidegrade​(org.apache.jackrabbit.oak.spi.state.NodeStore 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copy()
      Copies the full content from the source to the target repository.
      java.util.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.
      void setCopyOrphanedVersions​(java.util.Calendar minDate)
      Configures copying of the orphaned version histories (eg.
      void setCopyVersions​(java.util.Calendar minDate)
      Configures the version storage copy.
      void setCustomCommitHooks​(java.util.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.
      void setExcludes​(@NotNull java.lang.String... excludes)
      Sets the paths that should be excluded when the source repository is copied to the target repository.
      void setFilterLongNames​(boolean filterLongNames)  
      void setForceCheckpoints​(boolean forceCheckpoints)  
      void setIncludes​(@NotNull java.lang.String... includes)
      Sets the paths that should be included when the source repository is copied to the target repository.
      void setMerges​(@NotNull java.lang.String... merges)
      Sets the paths that should be merged when the source repository is copied to the target repository.
      void setMigrateDocumentMetadata​(boolean migrateDocumentMetadata)  
      void setOnlyVerify​(boolean onlyVerify)  
      void setSkipCheckpoints​(boolean skipCheckpoints)  
      void setVerify​(boolean verify)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RepositorySidegrade

        public RepositorySidegrade​(org.apache.jackrabbit.oak.spi.state.NodeStore 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 node store
        target - target node store
    • Method Detail

      • setCopyVersions

        public void setCopyVersions​(java.util.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​(java.util.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.
      • getCustomCommitHooks

        public java.util.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​(java.util.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 java.lang.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 java.lang.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 java.lang.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.
      • setFilterLongNames

        public void setFilterLongNames​(boolean filterLongNames)
      • setVerify

        public void setVerify​(boolean verify)
      • setOnlyVerify

        public void setOnlyVerify​(boolean onlyVerify)
      • setSkipCheckpoints

        public void setSkipCheckpoints​(boolean skipCheckpoints)
      • setForceCheckpoints

        public void setForceCheckpoints​(boolean forceCheckpoints)
      • setMigrateDocumentMetadata

        public void setMigrateDocumentMetadata​(boolean migrateDocumentMetadata)
      • copy

        public void copy()
                  throws 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.

        Throws:
        RepositoryException - if the copy operation fails