|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tmatesoft.svn.core.auth.BasicAuthenticationManager
public class BasicAuthenticationManager
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 SVNKit internals. You may use a default
manager (how to get it read javadoc for ISVNAuthenticationManager
),
this basic manager or implement your own one.
ISVNAuthenticationProvider
Field Summary |
---|
Fields inherited from interface org.tmatesoft.svn.core.auth.ISVNAuthenticationManager |
---|
PASSWORD, SSH, SSL, USERNAME |
Constructor Summary | |
---|---|
BasicAuthenticationManager(java.lang.String userName,
java.io.File keyFile,
java.lang.String passphrase,
int portNumber)
Creates an auth manager given a user credential - a username and an ssh private key. |
|
BasicAuthenticationManager(java.lang.String userName,
java.lang.String password)
Creates an auth manager given a user credential - a username and password. |
|
BasicAuthenticationManager(SVNAuthentication[] authentications)
Creates an auth manager given user credentials to use. |
Method Summary | |
---|---|
void |
acknowledgeAuthentication(boolean accepted,
java.lang.String kind,
java.lang.String realm,
SVNErrorMessage errorMessage,
SVNAuthentication authentication)
Does nothing. |
static void |
acknowledgeAuthentication(boolean accepted,
java.lang.String kind,
java.lang.String realm,
SVNErrorMessage errorMessage,
SVNAuthentication authentication,
SVNURL accessedURL,
ISVNAuthenticationManager authManager)
|
void |
acknowledgeProxyContext(boolean accepted,
SVNErrorMessage errorMessage)
Does nothing. |
void |
acknowledgeTrustManager(javax.net.ssl.TrustManager manager)
Does nothing. |
int |
getConnectTimeout(SVNRepository repository)
Returns connection timeout value. |
SVNAuthentication |
getFirstAuthentication(java.lang.String kind,
java.lang.String realm,
SVNURL url)
Returns the first user's authentication credentials. |
SVNAuthentication |
getNextAuthentication(java.lang.String kind,
java.lang.String realm,
SVNURL url)
Returns next user authentication credentials. |
java.lang.String |
getProxyHost()
Returns the proxy host name. |
ISVNProxyManager |
getProxyManager(SVNURL url)
Returns itself as a proxy manager. |
java.lang.String |
getProxyPassword()
Returns the password to authenticate against the proxy server. |
int |
getProxyPort()
Returns the proxy port number. |
java.lang.String |
getProxyUserName()
Returns the proxy user name. |
int |
getReadTimeout(SVNRepository repository)
Returns connection timeout value. |
javax.net.ssl.TrustManager |
getTrustManager(SVNURL url)
Returns null. |
boolean |
isAuthenticationForced()
Tells whether authentication should be tried despite not being challenged from the server yet. |
void |
setAuthenticationForced(boolean forced)
Sets whether authentication should be forced or not. |
void |
setAuthenticationProvider(ISVNAuthenticationProvider provider)
Does nothing. |
void |
setAuthentications(SVNAuthentication[] authentications)
Sets the given user credentials to this manager. |
void |
setProxy(java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUserName,
java.lang.String proxyPassword)
Sets a proxy server context to this manager. |
void |
verifyHostKey(java.lang.String hostName,
int port,
java.lang.String keyAlgorithm,
byte[] hostKey)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAuthenticationManager(java.lang.String userName, java.lang.String password)
userName
- a usernamepassword
- a passwordpublic BasicAuthenticationManager(java.lang.String userName, java.io.File keyFile, java.lang.String passphrase, int portNumber)
userName
- a usernamekeyFile
- a private key filepassphrase
- a password to the private keyportNumber
- a port number over which an ssh tunnel is establishedpublic BasicAuthenticationManager(SVNAuthentication[] authentications)
authentications
- user credentialsMethod Detail |
---|
public static void acknowledgeAuthentication(boolean accepted, java.lang.String kind, java.lang.String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication, SVNURL accessedURL, ISVNAuthenticationManager authManager) throws SVNException
SVNException
public void setAuthentications(SVNAuthentication[] authentications)
authentications
- user credentialspublic void setProxy(java.lang.String proxyHost, int proxyPort, java.lang.String proxyUserName, java.lang.String proxyPassword)
proxyHost
- a proxy server hostnameproxyPort
- a proxy server portproxyUserName
- a username to supply to a proxy machineproxyPassword
- a password to supply to a proxy machinepublic SVNAuthentication getFirstAuthentication(java.lang.String kind, java.lang.String realm, SVNURL url) throws SVNException
getFirstAuthentication
in interface ISVNAuthenticationManager
kind
- credentials kind; valid kinds are ISVNAuthenticationManager.SSH
,
ISVNAuthenticationManager.PASSWORD
, ISVNAuthenticationManager.USERNAME
,
ISVNAuthenticationManager.SSL
, ISVNAuthenticationManager.USERNAME
realm
- authentication realmurl
- repository url
SVNException
- exception with SVNErrorCode.RA_NOT_AUTHORIZED
error code - in case of invalid kind
public SVNAuthentication getNextAuthentication(java.lang.String kind, java.lang.String realm, SVNURL url) throws SVNException
getFirstAuthentication(String, String, SVNURL)
failed to authenticate the user.
getNextAuthentication
in interface ISVNAuthenticationManager
kind
- credentials kind; valid kinds are ISVNAuthenticationManager.SSH
,
ISVNAuthenticationManager.PASSWORD
, ISVNAuthenticationManager.USERNAME
,
ISVNAuthenticationManager.SSL
, ISVNAuthenticationManager.USERNAME
realm
- authentication realmurl
- repository url
SVNException
- exception with SVNErrorCode.RA_NOT_AUTHORIZED
error code - in case of invalid kind
public void setAuthenticationProvider(ISVNAuthenticationProvider provider)
setAuthenticationProvider
in interface ISVNAuthenticationManager
provider
- public ISVNProxyManager getProxyManager(SVNURL url) throws SVNException
getProxyManager
in interface ISVNAuthenticationManager
url
- a repository location that will be accessed
over the proxy server for which a manager is needed
SVNException
public javax.net.ssl.TrustManager getTrustManager(SVNURL url) throws SVNException
getTrustManager
in interface ISVNAuthenticationManager
url
- repository url
SVNException
public void acknowledgeAuthentication(boolean accepted, java.lang.String kind, java.lang.String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication)
acknowledgeAuthentication
in interface ISVNAuthenticationManager
accepted
- kind
- realm
- errorMessage
- authentication
- public void acknowledgeTrustManager(javax.net.ssl.TrustManager manager)
acknowledgeTrustManager
in interface ISVNAuthenticationManager
manager
- public boolean isAuthenticationForced()
setAuthenticationForced(boolean)
.
isAuthenticationForced
in interface ISVNAuthenticationManager
public void setAuthenticationForced(boolean forced)
forced
- authentication force flagisAuthenticationForced()
public java.lang.String getProxyHost()
getProxyHost
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic int getProxyPort()
getProxyPort
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic java.lang.String getProxyUserName()
getProxyUserName
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic java.lang.String getProxyPassword()
getProxyPassword
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic void acknowledgeProxyContext(boolean accepted, SVNErrorMessage errorMessage)
acknowledgeProxyContext
in interface ISVNProxyManager
accepted
- errorMessage
- public int getReadTimeout(SVNRepository repository)
http
or https
access operations. If repository
uses a different access protocol,
the return value will be 0.
getReadTimeout
in interface ISVNAuthenticationManager
repository
- repository access object
public int getConnectTimeout(SVNRepository repository)
http
or https
access operations. If repository
uses a different access protocol,
the return value will be 0.
getConnectTimeout
in interface ISVNAuthenticationManager
repository
- repository access object
public void verifyHostKey(java.lang.String hostName, int port, java.lang.String keyAlgorithm, byte[] hostKey) throws SVNException
verifyHostKey
in interface ISVNSSHHostVerifier
SVNException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |