org.tigris.subversion.javahl
Class SVNAdmin

java.lang.Object
  extended by org.tigris.subversion.javahl.SVNAdmin

public class SVNAdmin
extends Object

This class offers the same commands as the svnadmin commandline client.


Nested Class Summary
static interface SVNAdmin.MessageReceiver
          interface to receive the messages
 
Field Summary
static String BDB
          Filesystem in a Berkeley DB
protected  long cppAddr
          slot for the adress of the native peer.
static String FSFS
          Filesystem in the filesystem
 
Constructor Summary
SVNAdmin()
          Standard empty contructor, builds just the native peer.
 
Method Summary
 void create(String path, boolean disableFsyncCommit, boolean keepLog, String configPath, String fstype)
          create a subversion repository.
 void deltify(String path, Revision start, Revision end)
          deltify the revisions in the repository
 void dispose()
          release the native peer (should not depend on finalize)
 void dump(String path, OutputInterface dataOut, OutputInterface errorOut, Revision start, Revision end, boolean incremental)
          dump the data in a repository
 void dump(String path, OutputInterface dataOut, OutputInterface errorOut, Revision start, Revision end, boolean incremental, boolean useDeltas)
          dump the data in a repository
protected  void finalize()
          release the native peer (should use dispose instead)
 Version getVersion()
           
 void hotcopy(String path, String targetPath, boolean cleanLogs)
          make a hot copy of the repository
 void listDBLogs(String path, SVNAdmin.MessageReceiver receiver)
          list all logfiles (BDB) in use or not)
 void listUnusedDBLogs(String path, SVNAdmin.MessageReceiver receiver)
          list unused logfiles
 void load(String path, InputInterface dataInput, OutputInterface messageOutput, boolean ignoreUUID, boolean forceUUID, boolean usePreCommitHook, boolean usePostCommitHook, String relativePath)
          load the data of a dump into a repository,
 void load(String path, InputInterface dataInput, OutputInterface messageOutput, boolean ignoreUUID, boolean forceUUID, String relativePath)
          load the data of a dump into a repository,
 Lock[] lslocks(String path)
          list all locks in the repository
 void lstxns(String path, SVNAdmin.MessageReceiver receiver)
          list all open transactions in a repository
 long recover(String path)
          recover the berkeley db of a repository, returns youngest revision
 void rmlocks(String path, String[] locks)
          remove multiple locks from the repository
 void rmtxns(String path, String[] transactions)
          remove open transaction in a repository
 void setLog(String path, Revision rev, String message, boolean bypassHooks)
          Deprecated. Use setRevProp() instead.
 void setRevProp(String path, Revision rev, String propName, String propValue, boolean usePreRevPropChangeHook, boolean usePostRevPropChangeHook)
          Change the value of the revision property propName to propValue.
 void verify(String path, OutputInterface messageOut, Revision start, Revision end)
          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


BDB

public static final String BDB
Filesystem in a Berkeley DB

See Also:
Constant Field Values

FSFS

public static final String FSFS
Filesystem in the filesystem

See Also:
Constant Field Values
Constructor Detail

SVNAdmin

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

Method Detail

dispose

public void dispose()
release the native peer (should not depend on finalize)


finalize

protected void finalize()
release the native peer (should use dispose instead)

Overrides:
finalize in class Object

getVersion

public Version getVersion()
Returns:
Version information about the underlying native libraries.

create

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

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(String path,
                    Revision start,
                    Revision end)
             throws ClientException
deltify the revisions in the repository

Parameters:
path - the path to the repository
start - start revision
end - end revision
Throws:
ClientException - throw in case of problem

dump

public void dump(String path,
                 OutputInterface dataOut,
                 OutputInterface errorOut,
                 Revision start,
                 Revision end,
                 boolean incremental)
          throws ClientException
dump the data in a repository

Parameters:
path - the path to the repository
dataOut - the data will be outputed here
errorOut - the messages will be outputed here
start - the first revision to be dumped
end - the last revision to be dumped
incremental - the dump will be incremantal
Throws:
ClientException - throw in case of problem

dump

public void dump(String path,
                 OutputInterface dataOut,
                 OutputInterface errorOut,
                 Revision start,
                 Revision end,
                 boolean incremental,
                 boolean useDeltas)
          throws ClientException
dump the data in a repository

Parameters:
path - the path to the repository
dataOut - the data will be outputed here
errorOut - the messages 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
Throws:
ClientException - throw in case of problem
Since:
1.5

hotcopy

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

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(String path,
                       SVNAdmin.MessageReceiver receiver)
                throws ClientException
list all logfiles (BDB) in use or not)

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(String path,
                             SVNAdmin.MessageReceiver receiver)
                      throws ClientException
list unused logfiles

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(String path,
                 InputInterface dataInput,
                 OutputInterface messageOutput,
                 boolean ignoreUUID,
                 boolean forceUUID,
                 String relativePath)
          throws ClientException
load the data of a dump into a repository,

Parameters:
path - the path to the repository
dataInput - the data input source
messageOutput - the target for processing messages
ignoreUUID - ignore any UUID found in the input stream
forceUUID - set the repository UUID to any found in the stream
relativePath - the directory in the repository, where the data in put optional.
Throws:
ClientException - throw in case of problem

load

public void load(String path,
                 InputInterface dataInput,
                 OutputInterface messageOutput,
                 boolean ignoreUUID,
                 boolean forceUUID,
                 boolean usePreCommitHook,
                 boolean usePostCommitHook,
                 String relativePath)
          throws ClientException
load the data of a dump into a repository,

Parameters:
path - the path to the repository
dataInput - the data input source
messageOutput - the target for processing messages
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.
Throws:
ClientException - throw in case of problem
Since:
1.5

lstxns

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

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(String path)
             throws ClientException
recover the berkeley db of a repository, returns youngest revision

Parameters:
path - the path to the repository
Throws:
ClientException - throw in case of problem

rmtxns

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

Parameters:
path - the path to the repository
transactions - the transactions to be removed
Throws:
ClientException - throw in case of problem

setLog

public void setLog(String path,
                   Revision rev,
                   String message,
                   boolean bypassHooks)
            throws ClientException
Deprecated. Use setRevProp() instead.

set the log message of a revision

Parameters:
path - the path to the repository
rev - the revision to be changed
message - the message to be set
bypassHooks - if to bypass all repository hooks
Throws:
ClientException - throw in case of problem

setRevProp

public void setRevProp(String 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.

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.
Since:
1.5.0

verify

public void verify(String path,
                   OutputInterface messageOut,
                   Revision start,
                   Revision end)
            throws ClientException
Verify the repository at path between revisions start and end.

Parameters:
path - the path to the repository
messageOut - the receiver of all messages
start - the first revision
end - the last revision
Throws:
ClientException - If an error occurred.

lslocks

public Lock[] lslocks(String path)
               throws ClientException
list all locks in the repository

Parameters:
path - the path to the repository
Throws:
ClientException - throw in case of problem
Since:
1.2

rmlocks

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

Parameters:
path - the path to the repository
locks - the name of the locked items
Throws:
ClientException - throw in case of problem
Since:
1.2