Class RepositoryUpgrade
- java.lang.Object
-
- org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade
-
public class RepositoryUpgrade extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>
DEFAULT_EXCLUDE_PATHS
static Set<String>
DEFAULT_INCLUDE_PATHS
static Set<String>
DEFAULT_MERGE_PATHS
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
copy(File source, org.apache.jackrabbit.oak.spi.state.NodeStore target)
Copies the contents of the repository in the given source directory to the given target node store.static void
copy(RepositoryConfig source, org.apache.jackrabbit.oak.spi.state.NodeStore target)
Copies the contents of the repository with the given configuration to the given target node builder.void
copy(org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer initializer)
Copies the full content from the source to the target repository.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.boolean
isCheckLongNames()
boolean
isCopyBinariesByReference()
boolean
isEarlyShutdown()
boolean
isFilterLongNames()
boolean
isSkipInitialization()
boolean
isSkipOnError()
protected org.apache.jackrabbit.oak.spi.security.ConfigurationParameters
mapConfigurationParameters(BeanConfig config, String... mapping)
protected org.apache.jackrabbit.oak.spi.security.ConfigurationParameters
mapSecurityConfig(SecurityConfig config)
void
setCheckLongNames(boolean checkLongNames)
void
setCopyBinariesByReference(boolean copyBinariesByReference)
void
setCopyOrphanedVersions(Calendar minDate)
Configures copying of the orphaned version histories (eg. ones that are not referenced by the existing nodes).void
setCopyVersions(Calendar minDate)
Configures the version storage copy.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.void
setEarlyShutdown(boolean earlyShutdown)
void
setExcludes(@NotNull String... excludes)
Sets the paths that should be excluded when the source repository is copied to the target repository.void
setFilterLongNames(boolean filterLongNames)
void
setIncludes(@NotNull String... includes)
Sets the paths that should be included when the source repository is copied to the target repository.void
setMerges(@NotNull String... merges)
Sets the paths that should be merged when the source repository is copied to the target repository.void
setSkipInitialization(boolean skipInitialization)
void
setSkipOnError(boolean skipOnError)
-
-
-
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 contexttarget
- 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 directorytarget
- 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 configurationtarget
- 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 settingnull
here or limit it to a selected date range:<minDate, now()>
.- Parameters:
minDate
- minimum date of the versions to copy ornull
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 settingnull
here or limit it to a selected date range:<minDate, now()>
.
Please notice, that this option is overriden by thesetCopyVersions(Calendar)
. You can't copy orphaned versions older than set insetCopyVersions(Calendar)
and if you setnull
there, this option will be ignored.- Parameters:
minDate
- minimum date of the orphaned versions to copy ornull
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)
-
-