Package org.apache.subversion.javahl
Class SVNRepos
java.lang.Object
org.apache.subversion.javahl.SVNRepos
- All Implemented Interfaces:
ISVNRepos
public class SVNRepos extends Object implements ISVNRepos
This class offers the same commands as the svnadmin commandline
client.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.subversion.javahl.ISVNRepos
ISVNRepos.MessageReceiver
-
Field Summary
Fields Modifier and Type Field Description protected long
cppAddr
slot for the adress of the native peer. -
Constructor Summary
Constructors Constructor Description SVNRepos()
Standard empty constructor, builds just the native peer. -
Method Summary
Modifier and Type Method Description void
cancelOperation()
cancel the active operationvoid
create(File path, boolean disableFsyncCommit, boolean keepLog, File configPath, String fstype)
create a subversion repository.void
deltify(File path, Revision start, Revision end)
deltify the revisions in the repositoryvoid
dispose()
release the native peer (should not depend on finalize)void
dump(File path, OutputStream dataOut, Revision start, Revision end, boolean incremental, boolean useDeltas, ReposNotifyCallback callback)
dump the data in a repositoryvoid
finalize()
release the native peer (should use dispose instead) public for backward compat.void
freeze(ReposFreezeAction action, File... paths)
Take an exclusive lock on each of the listed repositories to prevent commits; then, while holding all the locks, call the action.invoke().long
getCppAddr()
Don't call this function! public for backward compat purposes.Version
getVersion()
void
hotcopy(File path, File targetPath, boolean cleanLogs)
void
hotcopy(File path, File targetPath, boolean cleanLogs, boolean incremental)
void
hotcopy(File path, File targetPath, boolean cleanLogs, boolean incremental, ReposNotifyCallback callback)
make a hot copy of the repositoryvoid
listDBLogs(File path, ISVNRepos.MessageReceiver receiver)
list all logfiles (BDB) in use or not)void
listUnusedDBLogs(File path, ISVNRepos.MessageReceiver receiver)
list unused logfilesvoid
load(File path, InputStream dataInput, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, String relativePath, ReposNotifyCallback callback)
load the data of a dump into a repositoryvoid
load(File path, InputStream dataInput, Revision start, Revision end, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, boolean validateProps, boolean ignoreDates, boolean normalizeProps, String relativePath, ReposNotifyCallback callback)
load the data of a dump into a repositoryvoid
load(File path, InputStream dataInput, Revision start, Revision end, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, boolean validateProps, boolean ignoreDates, String relativePath, ReposNotifyCallback callback)
load the data of a dump into a repositoryvoid
load(File path, InputStream dataInput, Revision start, Revision end, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, String relativePath, ReposNotifyCallback callback)
Load the data of a dump into a repository.Set<Lock>
lslocks(File path, Depth depth)
list all locks in the repositoryvoid
lstxns(File path, ISVNRepos.MessageReceiver receiver)
list all open transactions in a repositoryvoid
pack(File path, ReposNotifyCallback callback)
pack the repositorylong
recover(File path, ReposNotifyCallback callback)
recover the filesystem backend of a repositoryvoid
rmlocks(File path, String[] locks)
remove multiple locks from the repositoryvoid
rmtxns(File path, String[] transactions)
remove open transaction in a repositoryvoid
setRevProp(File path, Revision rev, String propName, String propValue, boolean usePreRevPropChangeHook, boolean usePostRevPropChangeHook)
Change the value of the revision propertypropName
topropValue
.void
upgrade(File path, ReposNotifyCallback callback)
upgrade the repository formatvoid
verify(File path, Revision start, Revision end, boolean checkNormalization, boolean metadataOnly, ReposNotifyCallback notifyCallback, ReposVerifyCallback verifyCallback)
Verify the repository atpath
between revisionsstart
andend
.void
verify(File path, Revision start, Revision end, ReposNotifyCallback callback)
Verify the repository atpath
between revisionsstart
andend
.
-
Field Details
-
cppAddr
protected long cppAddrslot for the adress of the native peer. The JNI code is the only user of this member
-
-
Constructor Details
-
SVNRepos
public SVNRepos()Standard empty constructor, builds just the native peer.
-
-
Method Details
-
getCppAddr
public long getCppAddr()Don't call this function! public for backward compat purposes. -
dispose
public void dispose()release the native peer (should not depend on finalize) -
finalize
public void finalize()release the native peer (should use dispose instead) public for backward compat. Shouldn't call this directly. -
getVersion
- Specified by:
getVersion
in interfaceISVNRepos
- Returns:
- Version information about the underlying native libraries.
-
create
public void create(File path, boolean disableFsyncCommit, boolean keepLog, File configPath, String fstype) throws ClientExceptioncreate a subversion repository.- Specified by:
create
in interfaceISVNRepos
- Parameters:
path
- the path where the repository will been created.disableFsyncCommit
- disable to fsync at the commit (BDB).keepLog
- keep the log files (BDB).configPath
- optional path for user configuration files.fstype
- the type of the filesystem (BDB or FSFS)- Throws:
ClientException
- throw in case of problem
-
deltify
deltify the revisions in the repository- Specified by:
deltify
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorystart
- start revisionend
- end revision- Throws:
ClientException
- throw in case of problem
-
dump
public void dump(File path, OutputStream dataOut, Revision start, Revision end, boolean incremental, boolean useDeltas, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
dump the data in a repository- Specified by:
dump
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorydataOut
- the data will be outputed herestart
- the first revision to be dumpedend
- the last revision to be dumpedincremental
- the dump will be incremantaluseDeltas
- the dump will contain deltas between nodescallback
- the callback to receive notifications- Throws:
ClientException
- throw in case of problem
-
hotcopy
public void hotcopy(File path, File targetPath, boolean cleanLogs, boolean incremental, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
make a hot copy of the repository- Specified by:
hotcopy
in interfaceISVNRepos
- Parameters:
path
- the path to the source repositorytargetPath
- the path to the target repositorycleanLogs
- clean the unused log files in the source repositorycallback
- the callback to receive notifications- Throws:
ClientException
- throw in case of problem
-
hotcopy
public void hotcopy(File path, File targetPath, boolean cleanLogs, boolean incremental) throws ClientException- Specified by:
hotcopy
in interfaceISVNRepos
- Throws:
ClientException
-
hotcopy
- Specified by:
hotcopy
in interfaceISVNRepos
- Throws:
ClientException
-
listDBLogs
list all logfiles (BDB) in use or not)- Specified by:
listDBLogs
in interfaceISVNRepos
- Parameters:
path
- the path to the repositoryreceiver
- interface to receive the logfile names- Throws:
ClientException
- throw in case of problem
-
listUnusedDBLogs
list unused logfiles- Specified by:
listUnusedDBLogs
in interfaceISVNRepos
- Parameters:
path
- the path to the repositoryreceiver
- interface to receive the logfile names- Throws:
ClientException
- throw in case of problem
-
load
public void load(File path, InputStream dataInput, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, String relativePath, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
load the data of a dump into a repository- Specified by:
load
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorydataInput
- the data input sourceignoreUUID
- ignore any UUID found in the input streamforceUUID
- set the repository UUID to any found in the streamusePreCommitHook
- use the pre-commit hook when processing commitsusePostCommitHook
- use the post-commit hook when processing commitsrelativePath
- the directory in the repository, where the data in put optional.callback
- the target for processing messages- Throws:
ClientException
- throw in case of problem
-
load
public void load(File path, InputStream dataInput, Revision start, Revision end, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, String relativePath, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
Load the data of a dump into a repository. SetsvalidateProps
andignoreDates
tofalse
.- Specified by:
load
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorydataInput
- the data input sourcestart
- the first revision to loadend
- the last revision to loadignoreUUID
- ignore any UUID found in the input streamforceUUID
- set the repository UUID to any found in the streamusePreCommitHook
- use the pre-commit hook when processing commitsusePostCommitHook
- use the post-commit hook when processing commitsrelativePath
- the directory in the repository, where the data in put optional.callback
- the target for processing messages- Throws:
ClientException
- throw in case of problem
-
load
public void load(File path, InputStream dataInput, Revision start, Revision end, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, boolean validateProps, boolean ignoreDates, String relativePath, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
load the data of a dump into a repository- Specified by:
load
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorydataInput
- the data input sourcestart
- the first revision to loadend
- the last revision to loadignoreUUID
- ignore any UUID found in the input streamforceUUID
- set the repository UUID to any found in the streamusePreCommitHook
- use the pre-commit hook when processing commitsusePostCommitHook
- use the post-commit hook when processing commitsvalidateProps
- validate "svn:" revision and node propertiesignoreDates
- ignore revision datestamps in the dump streamrelativePath
- the directory in the repository, where the data in put optional.callback
- the target for processing messages- Throws:
ClientException
- throw in case of problem
-
load
public void load(File path, InputStream dataInput, Revision start, Revision end, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, boolean validateProps, boolean ignoreDates, boolean normalizeProps, String relativePath, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
load the data of a dump into a repository- Specified by:
load
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorydataInput
- the data input sourcestart
- the first revision to loadend
- the last revision to loadignoreUUID
- ignore any UUID found in the input streamforceUUID
- set the repository UUID to any found in the streamusePreCommitHook
- use the pre-commit hook when processing commitsusePostCommitHook
- use the post-commit hook when processing commitsvalidateProps
- validate "svn:" revision and node propertiesignoreDates
- ignore revision datestamps in the dump streamnormalizeProps
- attempt to normalize invalid Subversion revision and node propertiesrelativePath
- the directory in the repository, where the data in put optional.callback
- the target for processing messages- Throws:
ClientException
- throw in case of problem
-
lstxns
list all open transactions in a repository- Specified by:
lstxns
in interfaceISVNRepos
- Parameters:
path
- the path to the repositoryreceiver
- receives one transaction name per call- Throws:
ClientException
- throw in case of problem
-
recover
Description copied from interface:ISVNRepos
recover the filesystem backend of a repository- Specified by:
recover
in interfaceISVNRepos
- Parameters:
path
- the path to the repository- Returns:
- youngest revision
- Throws:
ClientException
- throw in case of problem
-
freeze
Description copied from interface:ISVNRepos
Take an exclusive lock on each of the listed repositories to prevent commits; then, while holding all the locks, call the action.invoke(). The repositories may or may not be readable by Subversion while frozen, depending on implementation details of the repository's filesystem backend. Repositories are locked in the listed order.- Specified by:
freeze
in interfaceISVNRepos
- Parameters:
action
- describes the action to performpaths
- the set of repository paths- Throws:
ClientException
-
rmtxns
remove open transaction in a repository- Specified by:
rmtxns
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorytransactions
- the transactions to be removed- Throws:
ClientException
- throw in case of problem
-
setRevProp
public void setRevProp(File path, Revision rev, String propName, String propValue, boolean usePreRevPropChangeHook, boolean usePostRevPropChangeHook) throws SubversionExceptionChange the value of the revision propertypropName
topropValue
. By default, does not run pre-/post-revprop-change hook scripts.- Specified by:
setRevProp
in interfaceISVNRepos
- Parameters:
path
- The path to the repository.rev
- The revision for which to change a property value.propName
- The name of the property to change.propValue
- The new value to set for the property.usePreRevPropChangeHook
- Whether to run the pre-revprop-change hook script.usePostRevPropChangeHook
- Whether to run the post-revprop-change hook script.- Throws:
SubversionException
- If a problem occurs.
-
verify
public void verify(File path, Revision start, Revision end, ReposNotifyCallback callback) throws ClientExceptionDescription copied from interface:ISVNRepos
Verify the repository atpath
between revisionsstart
andend
.Note: Behaves like the 1.9 version with
checkNormailzation
andmetadataOnly
set tofalse
andverifyCallback
set tonull
.- Specified by:
verify
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorystart
- the first revisionend
- the last revisioncallback
- the callback to receive notifications- Throws:
ClientException
- If an error occurred.
-
verify
public void verify(File path, Revision start, Revision end, boolean checkNormalization, boolean metadataOnly, ReposNotifyCallback notifyCallback, ReposVerifyCallback verifyCallback) throws ClientExceptionDescription copied from interface:ISVNRepos
Verify the repository atpath
between revisionsstart
andend
.If
verifyCallback
isnull
, verification will stop at the first encountered error. Otherwise, the verification process may continue, depending on the value returned from the invocation ofverifyCallback
.- Specified by:
verify
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorystart
- the first revisionend
- the last revisioncheckNormalization
- report directory entry and mergeinfo name collisions caused by denormalized Unicode representationsmetadataOnly
- check only metadata, not file contentsnotifyCallback
- the callback to receive notificationsverifyCallback
- the callback to receive verification status- Throws:
ClientException
- If an error occurred.
-
lslocks
list all locks in the repository- Specified by:
lslocks
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorydepth
- the depth to recurse- Throws:
ClientException
- throw in case of problem
-
rmlocks
remove multiple locks from the repository- Specified by:
rmlocks
in interfaceISVNRepos
- Parameters:
path
- the path to the repositorylocks
- the name of the locked items- Throws:
ClientException
- throw in case of problem
-
upgrade
Description copied from interface:ISVNRepos
upgrade the repository format -
pack
Description copied from interface:ISVNRepos
pack the repository -
cancelOperation
Description copied from interface:ISVNRepos
cancel the active operation- Specified by:
cancelOperation
in interfaceISVNRepos
- Throws:
ClientException
-