org.apache.subversion.javahl
Class SVNRepos

java.lang.Object
  extended by 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
protected  long cppAddr
          slot for the adress of the native peer.
 
Fields inherited from interface org.apache.subversion.javahl.ISVNRepos
BDB, FSFS
 
Constructor Summary
SVNRepos()
          Standard empty contructor, builds just the native peer.
 
Method Summary
 void cancelOperation()
          cancel the active operation
 void 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 repository
 void 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 repository
 void finalize()
          release the native peer (should use dispose instead) public for backward compat.
 long getCppAddr()
          Don't call this function! public for backward compat purposes.
 Version getVersion()
           
 void hotcopy(File path, File targetPath, boolean cleanLogs)
          make a hot copy of the repository
 void listDBLogs(File path, ISVNRepos.MessageReceiver receiver)
          list all logfiles (BDB) in use or not)
 void listUnusedDBLogs(File path, ISVNRepos.MessageReceiver receiver)
          list unused logfiles
 void 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 repository,
 Set<Lock> lslocks(File path, Depth depth)
          list all locks in the repository
 void lstxns(File path, ISVNRepos.MessageReceiver receiver)
          list all open transactions in a repository
 void pack(File path, ReposNotifyCallback callback)
          pack the repository
 long recover(File path, ReposNotifyCallback callback)
          recover the berkeley db of a repository, returns youngest revision
 void rmlocks(File path, String[] locks)
          remove multiple locks from the repository
 void rmtxns(File path, String[] transactions)
          remove open transaction in a repository
 void setRevProp(File path, Revision rev, String propName, String propValue, boolean usePreRevPropChangeHook, boolean usePostRevPropChangeHook)
          Change the value of the revision property propName to propValue.
 void upgrade(File path, ReposNotifyCallback callback)
          upgrade the repository format
 void verify(File path, Revision start, Revision end, ReposNotifyCallback callback)
          Verify the repository at path between revisions start and end.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cppAddr

protected long cppAddr
slot for the adress of the native peer. The JNI code is the only user of this member

Constructor Detail

SVNRepos

public SVNRepos()
Standard empty contructor, builds just the native peer.

Method Detail

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)

Specified by:
dispose in interface ISVNRepos

finalize

public void finalize()
release the native peer (should use dispose instead) public for backward compat. Shouldn't call this directly.

Overrides:
finalize in class Object

getVersion

public Version getVersion()
Specified by:
getVersion in interface ISVNRepos
Returns:
Version information about the underlying native libraries.

create

public void create(File path,
                   boolean disableFsyncCommit,
                   boolean keepLog,
                   File configPath,
                   String fstype)
            throws ClientException
create a subversion repository.

Specified by:
create in interface ISVNRepos
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

public void deltify(File path,
                    Revision start,
                    Revision end)
             throws ClientException
deltify the revisions in the repository

Specified by:
deltify in interface ISVNRepos
Parameters:
path - the path to the repository
start - start revision
end - 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 ClientException
Description copied from interface: ISVNRepos
dump the data in a repository

Specified by:
dump in interface ISVNRepos
Parameters:
path - the path to the repository
dataOut - the data will be outputed here
start - the first revision to be dumped
end - the last revision to be dumped
incremental - the dump will be incremantal
useDeltas - the dump will contain deltas between nodes
callback - the callback to recieve notifications
Throws:
ClientException - throw in case of problem

hotcopy

public void hotcopy(File path,
                    File targetPath,
                    boolean cleanLogs)
             throws ClientException
make a hot copy of the repository

Specified by:
hotcopy in interface ISVNRepos
Parameters:
path - the path to the source repository
targetPath - the path to the target repository
cleanLogs - clean the unused log files in the source repository
Throws:
ClientException - throw in case of problem

listDBLogs

public void listDBLogs(File path,
                       ISVNRepos.MessageReceiver receiver)
                throws ClientException
list all logfiles (BDB) in use or not)

Specified by:
listDBLogs in interface ISVNRepos
Parameters:
path - the path to the repository
receiver - interface to receive the logfile names
Throws:
ClientException - throw in case of problem

listUnusedDBLogs

public void listUnusedDBLogs(File path,
                             ISVNRepos.MessageReceiver receiver)
                      throws ClientException
list unused logfiles

Specified by:
listUnusedDBLogs in interface ISVNRepos
Parameters:
path - the path to the repository
receiver - 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 ClientException
Description copied from interface: ISVNRepos
load the data of a dump into a repository,

Specified by:
load in interface ISVNRepos
Parameters:
path - the path to the repository
dataInput - the data input source
ignoreUUID - ignore any UUID found in the input stream
forceUUID - set the repository UUID to any found in the stream
usePreCommitHook - use the pre-commit hook when processing commits
usePostCommitHook - use the post-commit hook when processing commits
relativePath - 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

public void lstxns(File path,
                   ISVNRepos.MessageReceiver receiver)
            throws ClientException
list all open transactions in a repository

Specified by:
lstxns in interface ISVNRepos
Parameters:
path - the path to the repository
receiver - receives one transaction name per call
Throws:
ClientException - throw in case of problem

recover

public long recover(File path,
                    ReposNotifyCallback callback)
             throws ClientException
Description copied from interface: ISVNRepos
recover the berkeley db of a repository, returns youngest revision

Specified by:
recover in interface ISVNRepos
Parameters:
path - the path to the repository
Throws:
ClientException - throw in case of problem

rmtxns

public void rmtxns(File path,
                   String[] transactions)
            throws ClientException
remove open transaction in a repository

Specified by:
rmtxns in interface ISVNRepos
Parameters:
path - the path to the repository
transactions - 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 SubversionException
Change the value of the revision property propName to propValue. By default, does not run pre-/post-revprop-change hook scripts.

Specified by:
setRevProp in interface ISVNRepos
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 ClientException
Description copied from interface: ISVNRepos
Verify the repository at path between revisions start and end.

Specified by:
verify in interface ISVNRepos
Parameters:
path - the path to the repository
start - the first revision
end - the last revision
callback - the callback to recieve notifications
Throws:
ClientException - If an error occurred.

lslocks

public Set<Lock> lslocks(File path,
                         Depth depth)
                  throws ClientException
list all locks in the repository

Specified by:
lslocks in interface ISVNRepos
Parameters:
path - the path to the repository
depth - the depth to recurse
Throws:
ClientException - throw in case of problem

rmlocks

public void rmlocks(File path,
                    String[] locks)
             throws ClientException
remove multiple locks from the repository

Specified by:
rmlocks in interface ISVNRepos
Parameters:
path - the path to the repository
locks - the name of the locked items
Throws:
ClientException - throw in case of problem

upgrade

public void upgrade(File path,
                    ReposNotifyCallback callback)
Description copied from interface: ISVNRepos
upgrade the repository format

Specified by:
upgrade in interface ISVNRepos
Parameters:
path - the path to the repository
callback - for notification

pack

public void pack(File path,
                 ReposNotifyCallback callback)
Description copied from interface: ISVNRepos
pack the repository

Specified by:
pack in interface ISVNRepos
Parameters:
path - the path to the repository
callback - for notification

cancelOperation

public void cancelOperation()
                     throws ClientException
Description copied from interface: ISVNRepos
cancel the active operation

Specified by:
cancelOperation in interface ISVNRepos
Throws:
ClientException