public class DefaultSVNAuthenticationManager extends java.lang.Object implements ISVNAuthenticationManager, ISVNSSLPasspharsePromptSupport, ISVNSSHHostVerifier
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultSVNAuthenticationManager.DumbAuthenticationProvider |
class |
DefaultSVNAuthenticationManager.ExtendedHostOptions |
class |
DefaultSVNAuthenticationManager.ExtendedHostOptionsProvider |
PASSWORD, SSH, SSL, USERNAME
Constructor and Description |
---|
DefaultSVNAuthenticationManager(java.io.File configDirectory,
boolean storeAuth,
java.lang.String userName,
java.lang.String password) |
DefaultSVNAuthenticationManager(java.io.File configDirectory,
boolean storeAuth,
java.lang.String userName,
java.lang.String password,
java.io.File privateKey,
java.lang.String passphrase) |
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeAuthentication(boolean accepted,
java.lang.String kind,
java.lang.String realm,
SVNErrorMessage errorMessage,
SVNAuthentication authentication)
Accepts the given authentication if it was successfully accepted by a
repository server, or not if authentication failed.
|
void |
acknowledgeTrustManager(javax.net.ssl.TrustManager manager)
Acknowledges the specified trust manager.
|
ISVNAuthenticationStorageOptions |
createAuthenticationStorageOptions() |
protected ISVNAuthenticationProvider |
createCacheAuthenticationProvider(java.io.File authDir,
java.lang.String userName) |
protected ISVNAuthenticationProvider |
createDefaultAuthenticationProvider(java.lang.String userName,
java.lang.String password,
java.io.File privateKey,
java.lang.String passphrase,
boolean allowSave) |
protected ISVNAuthenticationProvider |
createRuntimeAuthenticationProvider() |
protected ISVNAuthenticationProvider |
getAuthenticationProvider() |
ISVNAuthenticationStorageOptions |
getAuthenticationStorageOptions() |
java.util.Collection<java.lang.String> |
getAuthTypes(SVNURL url) |
protected java.io.File |
getConfigDirectory() |
int |
getConnectTimeout(SVNRepository repository)
Returns the connection timeout value in milliseconds which
repository
should use in network connection operations. |
DefaultSVNOptions |
getDefaultOptions() |
protected SVNSSHAuthentication |
getDefaultSSHAuthentication(SVNURL url) |
SVNAuthentication |
getFirstAuthentication(java.lang.String kind,
java.lang.String realm,
SVNURL url)
Retrieves the first user credential.
|
ISVNHostOptionsProvider |
getHostOptionsProvider() |
SVNAuthentication |
getNextAuthentication(java.lang.String kind,
java.lang.String realm,
SVNURL url)
Retrieves the next user credential if the first try failed.
|
ISVNProxyManager |
getProxyManager(SVNURL url)
Returns a proxy manager that keeps settings for that proxy
server over which HTTP requests are send to a repository server.
|
int |
getReadTimeout(SVNRepository repository)
Returns the read timeout value in milliseconds which
repository should use in
socket read operations. |
protected ISVNAuthenticationStorage |
getRuntimeAuthStorage() |
javax.net.ssl.TrustManager |
getTrustManager(SVNURL url)
Returns a manager which handles trust data for the specified
url . |
boolean |
isAuthenticationForced()
Checks whether client should send authentication credentials to
a repository server not waiting for the server's challenge.
|
boolean |
isSSLPassphrasePromtSupported() |
void |
setAuthenticationForced(boolean forced)
Specifies the way how credentials are to be supplied to a
repository server.
|
void |
setAuthenticationProvider(ISVNAuthenticationProvider provider)
Sets a custom authentication provider that will provide user
credentials for authentication.
|
void |
setAuthenticationStorageOptions(ISVNAuthenticationStorageOptions authOptions) |
protected void |
setHostOptionsProvider(ISVNHostOptionsProvider hostOptionsProvider) |
void |
setInMemoryConfigOptions(java.util.Map configOptions) |
void |
setInMemoryServersOptions(java.util.Map serversOptions) |
void |
setRuntimeStorage(ISVNAuthenticationStorage storage)
Sets a specific runtime authentication storage manager.
|
void |
verifyHostKey(java.lang.String hostName,
int port,
java.lang.String keyAlgorithm,
byte[] hostKey) |
public DefaultSVNAuthenticationManager(java.io.File configDirectory, boolean storeAuth, java.lang.String userName, java.lang.String password)
public DefaultSVNAuthenticationManager(java.io.File configDirectory, boolean storeAuth, java.lang.String userName, java.lang.String password, java.io.File privateKey, java.lang.String passphrase)
public void setInMemoryServersOptions(java.util.Map serversOptions)
public void setInMemoryConfigOptions(java.util.Map configOptions)
public ISVNAuthenticationStorageOptions getAuthenticationStorageOptions()
public void setAuthenticationStorageOptions(ISVNAuthenticationStorageOptions authOptions)
public void setAuthenticationProvider(ISVNAuthenticationProvider provider)
ISVNAuthenticationManager
setAuthenticationProvider
in interface ISVNAuthenticationManager
provider
- an authentication providerprotected java.io.File getConfigDirectory()
public DefaultSVNOptions getDefaultOptions()
public ISVNHostOptionsProvider getHostOptionsProvider()
protected void setHostOptionsProvider(ISVNHostOptionsProvider hostOptionsProvider)
public java.util.Collection<java.lang.String> getAuthTypes(SVNURL url)
public ISVNProxyManager getProxyManager(SVNURL url) throws SVNException
ISVNAuthenticationManager
A default auth manager uses proxy settings from the standard servers file.
getProxyManager
in interface ISVNAuthenticationManager
url
- a repository location that will be accessed
over the proxy server for which a manager is neededSVNException
public javax.net.ssl.TrustManager getTrustManager(SVNURL url) throws SVNException
ISVNAuthenticationManager
url
.
Note: in pre-1.2.0 versions ISVNAuthenticationManager
used to provide ISVNSSLManager
via a method getSSLManager()
which is now replaced by this one. ISVNSSLManager
is no longer used (replaced by TrustManager
).getTrustManager
in interface ISVNAuthenticationManager
url
- repository urlSVNException
public SVNAuthentication getFirstAuthentication(java.lang.String kind, java.lang.String realm, SVNURL url) throws SVNException
ISVNAuthenticationManager
getNextAuthentication()
and sends the next credential.
For each credential kind
an implementor should return a kind-specific
credential. The following table matches kinds to proper credential classes:
getFirstAuthentication
in interface ISVNAuthenticationManager
kind
- a credential kindrealm
- a repository authentication realmurl
- a repository location that is to be accessedSVNException
public SVNAuthentication getNextAuthentication(java.lang.String kind, java.lang.String realm, SVNURL url) throws SVNException
ISVNAuthenticationManager
getFirstAuthentication()
and
sends the retrieved credential.
For each credential kind
an implementor should return a kind-specific
credential. The following table matches kinds to proper credential classes:
getNextAuthentication
in interface ISVNAuthenticationManager
kind
- a credential kindrealm
- a repository authentication realmurl
- a repository location that is to be accessedSVNException
public void acknowledgeAuthentication(boolean accepted, java.lang.String kind, java.lang.String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException
ISVNAuthenticationManager
acknowledgeAuthentication
in interface ISVNAuthenticationManager
accepted
- true if
the credential was accepted by the server,
otherwise falsekind
- a credential kind (ISVNAuthenticationManager.PASSWORD
or ISVNAuthenticationManager.SSH
or ISVNAuthenticationManager.USERNAME
)realm
- a repository authentication realmerrorMessage
- the reason of the authentication failureauthentication
- a user credential to accept/dropSVNException
public void acknowledgeTrustManager(javax.net.ssl.TrustManager manager)
ISVNAuthenticationManager
manager
.acknowledgeTrustManager
in interface ISVNAuthenticationManager
manager
- trust manager to acknowledge (one returned by ISVNAuthenticationManager.getTrustManager(SVNURL)
)public void setRuntimeStorage(ISVNAuthenticationStorage storage)
storage
- a custom auth storage managerprotected ISVNAuthenticationStorage getRuntimeAuthStorage()
protected ISVNAuthenticationProvider getAuthenticationProvider()
protected SVNSSHAuthentication getDefaultSSHAuthentication(SVNURL url)
protected ISVNAuthenticationProvider createDefaultAuthenticationProvider(java.lang.String userName, java.lang.String password, java.io.File privateKey, java.lang.String passphrase, boolean allowSave)
protected ISVNAuthenticationProvider createRuntimeAuthenticationProvider()
protected ISVNAuthenticationProvider createCacheAuthenticationProvider(java.io.File authDir, java.lang.String userName)
public ISVNAuthenticationStorageOptions createAuthenticationStorageOptions()
public boolean isAuthenticationForced()
ISVNAuthenticationManager
In some cases it may be necessary to send credentials beforehand, not waiting until the server asks to do it itself. To achieve such behaviour an implementor should return true from this routine.
isAuthenticationForced
in interface ISVNAuthenticationManager
public void setAuthenticationForced(boolean forced)
forced
- true to force
credentials sending; false
to put off sending credentials till a server challengeisAuthenticationForced()
public int getReadTimeout(SVNRepository repository)
ISVNAuthenticationManager
repository
should use in
socket read operations. Socket read operations will block only for this amount of time.getReadTimeout
in interface ISVNAuthenticationManager
repository
- a repository access driverpublic int getConnectTimeout(SVNRepository repository)
ISVNAuthenticationManager
repository
should use in network connection operations.getConnectTimeout
in interface ISVNAuthenticationManager
repository
- repository access objectpublic void verifyHostKey(java.lang.String hostName, int port, java.lang.String keyAlgorithm, byte[] hostKey) throws SVNException
verifyHostKey
in interface ISVNSSHHostVerifier
SVNException
public boolean isSSLPassphrasePromtSupported()
isSSLPassphrasePromtSupported
in interface ISVNSSLPasspharsePromptSupport
Copyright © 2004-2012 TMate Software Ltd. All Rights Reserved.