org.apache.subversion.javahl.remote
Class RemoteFactory

java.lang.Object
  extended by org.apache.subversion.javahl.remote.RemoteFactory

public class RemoteFactory
extends Object

Factory class for creating ISVNRemote instances.

Since:
1.9

Constructor Summary
RemoteFactory()
          Default constructor.
RemoteFactory(String configDirectory, String username, String password, AuthnCallback prompt, ProgressCallback progress, ConfigEvent configHandler, TunnelAgent tunnelAgent)
          Initializing constructor.
RemoteFactory(String configDirectory, String username, String password, UserPasswordCallback prompt, ProgressCallback progress, ConfigEvent configHandler, TunnelAgent tunnelAgent)
          Initializing constructor.
 
Method Summary
 ISVNRemote openRemoteSession(String url)
          Open a persistent session to a repository.
 ISVNRemote openRemoteSession(String url, int retryAttempts)
          Open a persistent session to a repository.
 ISVNRemote openRemoteSession(String url, String reposUUID)
          Open a persistent session to a repository.
 ISVNRemote openRemoteSession(String url, String reposUUID, int retryAttempts)
          Open a persistent session to a repository.
 void setConfigDirectory(String configDirectory)
          Set directory for the configuration information.
 void setConfigEventHandler(ConfigEvent configHandler)
          Set an event handler that will be called every time the configuration is loaded by the ISVNRemote objects created by this factory.
 void setPassword(String password)
          Sets the password used for authentication.
 void setProgressCallback(ProgressCallback progress)
          Set the progress callback for new sessions.
 void setPrompt(AuthnCallback prompt)
          Register callback interface to supply username and password on demand.
 void setPrompt(UserPasswordCallback prompt)
          Register callback interface to supply username and password on demand.
 void setTunnelAgent(TunnelAgent tunnelAgent)
          Set callbacks for ra_svn tunnel handling.
 void setUsername(String username)
          Sets the username used for authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFactory

public RemoteFactory()
Default constructor.


RemoteFactory

public RemoteFactory(String configDirectory,
                     String username,
                     String password,
                     AuthnCallback prompt,
                     ProgressCallback progress,
                     ConfigEvent configHandler,
                     TunnelAgent tunnelAgent)
Initializing constructor. Any or all of its arguments may be null.


RemoteFactory

public RemoteFactory(String configDirectory,
                     String username,
                     String password,
                     UserPasswordCallback prompt,
                     ProgressCallback progress,
                     ConfigEvent configHandler,
                     TunnelAgent tunnelAgent)
Initializing constructor. Any or all of its arguments may be null.

Method Detail

setUsername

public void setUsername(String username)
Sets the username used for authentication.

Parameters:
username - The username; Set to the null to clear it.
Throws:
IllegalArgumentException - If username is empty.
See Also:
#password(String)

setPassword

public void setPassword(String password)
Sets the password used for authentication.

Parameters:
password - The passwordp Set null to clear it.
Throws:
IllegalArgumentException - If password is empty.
See Also:
#username(String)

setPrompt

public void setPrompt(AuthnCallback prompt)
Register callback interface to supply username and password on demand. This callback can also be used to provide theequivalent of the --no-auth-cache and --non-interactive arguments accepted by the command-line client.

Parameters:
prompt - the callback interface

setPrompt

public void setPrompt(UserPasswordCallback prompt)
Register callback interface to supply username and password on demand. This callback can also be used to provide theequivalent of the --no-auth-cache and --non-interactive arguments accepted by the command-line client.

Parameters:
prompt - the callback interface

setProgressCallback

public void setProgressCallback(ProgressCallback progress)
Set the progress callback for new sessions.

Parameters:
progress - The progress callback.

setConfigDirectory

public void setConfigDirectory(String configDirectory)
Set directory for the configuration information.


setConfigEventHandler

public void setConfigEventHandler(ConfigEvent configHandler)
Set an event handler that will be called every time the configuration is loaded by the ISVNRemote objects created by this factory.


setTunnelAgent

public void setTunnelAgent(TunnelAgent tunnelAgent)
Set callbacks for ra_svn tunnel handling.


openRemoteSession

public ISVNRemote openRemoteSession(String url)
                             throws ClientException,
                                    SubversionException
Open a persistent session to a repository.

Note: The URL can point to a subtree of the repository.

Note: The session object inherits the progress callback, configuration directory and authentication info.

Parameters:
url - The initial session root URL.
Throws:
RetryOpenSession - If the session URL was redirected
SubversionException - If an URL redirect cycle was detected
ClientException

openRemoteSession

public ISVNRemote openRemoteSession(String url,
                                    int retryAttempts)
                             throws ClientException,
                                    SubversionException
Open a persistent session to a repository.

Note: The URL can point to a subtree of the repository.

Note: The session object inherits the progress callback, configuration directory and authentication info.

Parameters:
url - The initial session root URL.
retryAttempts - The number of times to retry the operation if the given URL is redirected.
Throws:
IllegalArgumentException - If retryAttempts is not positive
RetryOpenSession - If the session URL was redirected
SubversionException - If an URL redirect cycle was detected
ClientException

openRemoteSession

public ISVNRemote openRemoteSession(String url,
                                    String reposUUID)
                             throws ClientException,
                                    SubversionException
Open a persistent session to a repository.

Note: The URL can point to a subtree of the repository.

Note: If the UUID does not match the repository, this function fails.

Note: The session object inherits the progress callback, configuration directory and authentication info.

Parameters:
url - The initial session root URL.
reposUUID - The expected repository UUID; may not be null..
Throws:
IllegalArgumentException - If reposUUID is null.
RetryOpenSession - If the session URL was redirected
SubversionException - If an URL redirect cycle was detected
ClientException

openRemoteSession

public ISVNRemote openRemoteSession(String url,
                                    String reposUUID,
                                    int retryAttempts)
                             throws ClientException,
                                    SubversionException
Open a persistent session to a repository.

Note: The URL can point to a subtree of the repository.

Note: If the UUID does not match the repository, this function fails.

Note: The session object inherits the progress callback, configuration directory and authentication info.

Parameters:
url - The initial session root URL.
reposUUID - The expected repository UUID; may not be null..
retryAttempts - The number of times to retry the operation if the given URL is redirected.
Throws:
IllegalArgumentException - If reposUUID is null or retryAttempts is not positive
RetryOpenSession - If the session URL was redirected
SubversionException - If an URL redirect cycle was detected
ClientException