Overview | Package | Class | Tree | Deprecated | Index | Help
| JavaSVN Home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.tmatesoft.svn.core.auth
Class BasicAuthenticationManager

    java.lang.Object
      org.tmatesoft.svn.core.auth.BasicAuthenticationManager

All Implemented Interfaces:
  ISVNAuthenticationManager, ISVNProxyManager

public class BasicAuthenticationManager
extends Object
implements ISVNAuthenticationManager, ISVNProxyManager

The BasicAuthenticationManager is a simple implementation of ISVNAuthenticationManager for storing and providing credentials without using auth providers. A basic manager simply keeps the user credentials provided. Also this manager may store a single proxy server options context (for HHTP requests to go through a particular proxy server).

This manager does not use authentication providers (ISVNAuthenticationProvider) but only those credentials that was supplied to its constructor. Also this manager never caches credentials.

This manager is not used in JavaSVN internals.

Version:
  1.0
Author:
  TMate Software Ltd.
See Also:
  `ISVNAuthenticationProvider`

Field Summary

Fields inherited from interface org.tmatesoft.svn.core.auth.ISVNAuthenticationManager
`PASSWORD, SSH, SSL`

Constructor Summary
`BasicAuthenticationManager(String userName, File keyFile, String passphrase, int portNumber)` Creates an auth manager given a user credential - a username and an ssh private key.
`BasicAuthenticationManager(String userName, String password)` Creates an auth manager given a user credential - a username and password.
`BasicAuthenticationManager(SVNAuthentication[] authentications)` Creates an auth manager given user credentials.

Method Summary
`void` | `acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication)` Does nothing.
`void` | `acknowledgeProxyContext(boolean accepted, SVNErrorMessage errorMessage)` Does nothing.
`SVNAuthentication` | `getFirstAuthentication(String kind, String realm, SVNURL url)` Retrieves the first user credential.
`SVNAuthentication` | `getNextAuthentication(String kind, String realm, SVNURL url)` Retrieves the next user credential if the first try failed.
`String` | `getProxyHost()` Returns the proxy host for HTTP connection.
`ISVNProxyManager` | `getProxyManager(SVNURL url)` Returns itself as a proxy manager.
`String` | `getProxyPassword()` Returns the password to supply to the proxy machine.
`int` | `getProxyPort()` Returns the port number on the proxy host to use.
`String` | `getProxyUserName()` Returns the username to supply to the proxy machine.
`ISVNSSLManager` | `getSSLManager(SVNURL url)` Returns null.
`boolean` | `isAuthenticationForced()`
`void` | `setAuthenticationProvider(ISVNAuthenticationProvider provider)` Does nothing.
`void` | `setAuthentications(SVNAuthentication[] authentications)` Sets the given user credentials to this manager.
`void` | `setProxy(String proxyHost, int proxyPort, String proxyUserName, String proxyPassword)` Sets a proxy server context to this manager.
`void` | `setRuntimeStorage(ISVNAuthenticationStorage storage)` Does nothing.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BasicAuthenticationManager

    public BasicAuthenticationManager(String userName,
                                      String password)

  Creates an auth manager given a user credential - a username and password.

Parameters:
  `userName` - a username
  `password` - a password

### BasicAuthenticationManager

    public BasicAuthenticationManager(String userName,
                                      File keyFile,
                                      String passphrase,
                                      int portNumber)

  Creates an auth manager given a user credential - a username and an ssh private key.

Parameters:
  `userName` - a username
  `keyFile` - a private key file
  `passphrase` - a password to the private key
  `portNumber` - a port number over which an ssh tunnel is established

### BasicAuthenticationManager

    public BasicAuthenticationManager(SVNAuthentication[] authentications)

  Creates an auth manager given user credentials.

Parameters:
  `authentications` - user credentials

Method Detail

### setAuthentications

    public void setAuthentications(SVNAuthentication[] authentications)

  Sets the given user credentials to this manager.

  Parameters:
    `authentications` - user credentials

### setProxy

    public void setProxy(String proxyHost,
                         int proxyPort,
                         String proxyUserName,
                         String proxyPassword)

  Sets a proxy server context to this manager.

  Parameters:
    `proxyHost` - a proxy server hostname
    `proxyPort` - a proxy server port
    `proxyUserName` - a username to supply to a proxy machine
    `proxyPassword` - a password to supply to a proxy machine

### getFirstAuthentication

    public SVNAuthentication getFirstAuthentication(String kind,
                                                    String realm,
                                                    SVNURL url)
                                             throws SVNException

  Description copied from interface: `ISVNAuthenticationManager`
  Retrieves the first user credential. The scheme of retrieving credentials:
  - For the first try to authenticate a user to a repository (using the specifed realm) an SVNRepository driver calls getFirstAuthentication() and sends the retrieved credential.
  - If the credential is accepted, it may be stored. If not, the driver calls `getNextAuthentication()` and sends the next credential.
  - If the last credential was not accepted, the driver still tries to get the next credential for the same realm.

  Specified by:
    `getFirstAuthentication` in interface `ISVNAuthenticationManager`
  Parameters:
    `kind` - a credential kind (`ISVNAuthenticationManager.PASSWORD` or `ISVNAuthenticationManager.SSH`)
    `realm` - a repository authentication realm
    `url` - a repository location that is to be accessed
  Returns:
    the first try user credential
  Throws:
    `SVNException`

### getNextAuthentication

    public SVNAuthentication getNextAuthentication(String kind,
                                                   String realm,
                                                   SVNURL url)
                                            throws SVNException

  Description copied from interface: `ISVNAuthenticationManager`
  Retrieves the next user credential if the first try failed. The scheme of retrieving credentials:
  - For the first try to authenticate a user to a repository (using the specifed realm) an SVNRepository driver calls `getFirstAuthentication()` and sends the retrieved credential.
  - If the credential is accepted, it may be stored. If not, the driver calls getNextAuthentication() and sends the next credential.
  - If the last credential was not accepted, the driver still tries to get the next credential for the same realm.

  Specified by:
    `getNextAuthentication` in interface `ISVNAuthenticationManager`
  Parameters:
    `kind` - a credential kind (`ISVNAuthenticationManager.PASSWORD` or `ISVNAuthenticationManager.SSH`)
    `realm` - a repository authentication realm
    `url` - a repository location that is to be accessed
  Returns:
    the next try user credential
  Throws:
    `SVNException`

### setAuthenticationProvider

    public void setAuthenticationProvider(ISVNAuthenticationProvider provider)

  Does nothing.

  Specified by:
    `setAuthenticationProvider` in interface `ISVNAuthenticationManager`
  Parameters:
    `provider` -

### getProxyManager

    public ISVNProxyManager getProxyManager(SVNURL url)
                                     throws SVNException

  Returns itself as a proxy manager.

  Specified by:
    `getProxyManager` in interface `ISVNAuthenticationManager`
  Parameters:
    `url` - a repository location that will be accessed over the proxy server for which a manager is needed
  Returns:
    a proxy manager
  Throws:
    `SVNException`

### getSSLManager

    public ISVNSSLManager getSSLManager(SVNURL url)
                                 throws SVNException

  Returns null.

  Specified by:
    `getSSLManager` in interface `ISVNAuthenticationManager`
  Parameters:
    `url` -
  Returns:
    null
  Throws:
    `SVNException`

### acknowledgeAuthentication

    public void acknowledgeAuthentication(boolean accepted,
                                          String kind,
                                          String realm,
                                          SVNErrorMessage errorMessage,
                                          SVNAuthentication authentication)

  Does nothing.

  Specified by:
    `acknowledgeAuthentication` in interface `ISVNAuthenticationManager`
  Parameters:
    `accepted` -
    `kind` -
    `realm` -
    `errorMessage` -
    `authentication` -

### setRuntimeStorage

    public void setRuntimeStorage(ISVNAuthenticationStorage storage)

  Does nothing.

  Specified by:
    `setRuntimeStorage` in interface `ISVNAuthenticationManager`
  Parameters:
    `storage` -

### isAuthenticationForced

    public boolean isAuthenticationForced()

  Specified by:
    `isAuthenticationForced` in interface `ISVNAuthenticationManager`

### getProxyHost

    public String getProxyHost()

  Description copied from interface: `ISVNProxyManager`
  Returns the proxy host for HTTP connection.

  Specified by:
    `getProxyHost` in interface `ISVNProxyManager`
  Returns:
    the hostname of the proxy server through which HTTP-based requests must pass

### getProxyPort

    public int getProxyPort()

  Description copied from interface: `ISVNProxyManager`
  Returns the port number on the proxy host to use.

  Specified by:
    `getProxyPort` in interface `ISVNProxyManager`
  Returns:
    a port number

### getProxyUserName

    public String getProxyUserName()

  Description copied from interface: `ISVNProxyManager`
  Returns the username to supply to the proxy machine.

  Specified by:
    `getProxyUserName` in interface `ISVNProxyManager`
  Returns:
    a username

### getProxyPassword

    public String getProxyPassword()

  Description copied from interface: `ISVNProxyManager`
  Returns the password to supply to the proxy machine.

  Specified by:
    `getProxyPassword` in interface `ISVNProxyManager`
  Returns:
    a password

### acknowledgeProxyContext

    public void acknowledgeProxyContext(boolean accepted,
                                        SVNErrorMessage errorMessage)

  Does nothing.

  Specified by:
    `acknowledgeProxyContext` in interface `ISVNProxyManager`
  Parameters:
    `accepted` -
    `errorMessage` -

Overview | Package | Class | Tree | Deprecated | Index | Help
| JavaSVN Home
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.