Java Doc for ISVNAuthenticationManager.java in  » Source-Control » tmatesoft-SVN » org » tmatesoft » svn » core » auth » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Source Control » tmatesoft SVN » org.tmatesoft.svn.core.auth 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.tmatesoft.svn.core.auth.ISVNAuthenticationManager

All known Subclasses:   org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager,  org.tmatesoft.svn.core.auth.BasicAuthenticationManager,
ISVNAuthenticationManager
public interface ISVNAuthenticationManager (Code)
The ISVNAuthenticationManager is implemented by manager classes used by SVNRepository drivers for user authentication purposes.

When an SVNRepository driver is created, you should provide an authentication manager via a call to:

 import org.tmatesoft.svn.core.io.SVNRepository;
 import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
 ...
 SVNRepository repository;
 ISVNAuthenticationManager authManger;
 ...
 repository.setAuthenticationManager(authManager);
 ...

SVNKit provides a default authentication manager implementation - org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager. This manager has got the following features:

  • uses the auth storage from the default Subversion runtime configuration area;
  • may use the auth storage in the directory you specify;
  • uses the ssh, ssl & proxy options from the standard config and servers files;
  • stores credentials in the in-memory cache during runtime;
You may also specify your own auth provider (ISVNAuthenticationProvider) to this default manager, it will be used along with those default ones, that implement the features listed above.

If using the https:// protocol and if no user's authentication provider implementation is set to the default manager, server certificates are accepted temporarily and therefore are not cached on the disk. To enable server CAs caching, a user should set an authentication provider implementation which ISVNAuthenticationProvider.acceptServerAuthentication(SVNURLStringObjectboolean) acceptServerAuthentication() method must return ISVNAuthenticationProvider.ACCEPTED . That will switch on certificate on-the-disk caching.

How to get a default auth manager instance see org.tmatesoft.svn.core.wc.SVNWCUtil .
version:
   1.1.1
author:
   TMate Software Ltd.
See Also:   org.tmatesoft.svn.core.io.SVNRepository



Field Summary
final public static  StringPASSWORD
    
final public static  StringSSH
    
final public static  StringSSL
    
final public static  StringUSERNAME
     A simple username credential kind ("svn.username").


Method Summary
public  voidacknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication)
     Accepts the given authentication if it was successfully accepted by a repository server, or not if authentication failed.
public  SVNAuthenticationgetFirstAuthentication(String kind, String realm, SVNURL url)
     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.
public  longgetHTTPTimeout(SVNRepository repository)
     Returns a connection timeout value.
public  SVNAuthenticationgetNextAuthentication(String kind, String realm, SVNURL url)
     Retrieves the next user credential if the first try failed. The scheme of retrieving credentials:
public  ISVNProxyManagergetProxyManager(SVNURL url)
     Returns a proxy manager that keeps settings for that proxy server over which HTTP requests are send to a repository server.
public  ISVNSSLManagergetSSLManager(SVNURL url)
     Returns the SSL manager for secure interracting with a repository.

A default implementation of ISVNAuthenticationManager returns an SSL manager that uses CA and user certificate files specified in the standard servers file.

Even if the default manager's getSSLManager() method returns null for the given url, a secure context will be created anymore, but, of course no user certificate files are provided to a server as well as server's certificates are not checked.

public  booleanisAuthenticationForced()
     Checks whether client should send authentication credentials to a repository server not waiting for the server's challenge.
public  voidsetAuthenticationForced(boolean forced)
     Specifies the way how credentials are to be supplied to a repository server.
public  voidsetAuthenticationProvider(ISVNAuthenticationProvider provider)
     Sets a custom authentication provider that will provide user credentials for authentication.
public  voidsetRuntimeStorage(ISVNAuthenticationStorage storage)
     Sets a specific runtime authentication storage manager.

Field Detail
PASSWORD
final public static String PASSWORD(Code)
A simple password credential kind ("svn.simple")



SSH
final public static String SSH(Code)
An ssh credential kind ("svn.ssh")



SSL
final public static String SSL(Code)
An ssl credential kind ("svn.ssl")



USERNAME
final public static String USERNAME(Code)
A simple username credential kind ("svn.username"). Only usernames are cached/provided matched against an appropriate realms (which are repository UUIDs in this case). In particular this kind is used in file:/// and svn+ssh:// access schemes.





Method Detail
acknowledgeAuthentication
public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException(Code)
Accepts the given authentication if it was successfully accepted by a repository server, or not if authentication failed. As a result the provided credential may be cached (authentication succeeded) or deleted from the cache (authentication failed).
Parameters:
  accepted - true if the credential was accepted by the server, otherwise false
Parameters:
  kind - a credential kind (ISVNAuthenticationManager.PASSWORD or ISVNAuthenticationManager.SSH or ISVNAuthenticationManager.USERNAME)
Parameters:
  realm - a repository authentication realm
Parameters:
  errorMessage - the reason of the authentication failure
Parameters:
  authentication - a user credential to accept/drop
throws:
  SVNException -



getFirstAuthentication
public SVNAuthentication getFirstAuthentication(String kind, String realm, SVNURL url) throws SVNException(Code)
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 ISVNAuthenticationManager.getNextAuthentication(String,String,SVNURL) 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.

For each credential kind an implementor should return a kind-specific credential. The following table matches kinds to proper credential classes:
Credential Kind Credential Class
ISVNAuthenticationManager.PASSWORD SVNPasswordAuthentication
ISVNAuthenticationManager.SSH SVNSSHAuthentication
ISVNAuthenticationManager.SSL SVNSSLAuthentication
ISVNAuthenticationManager.USERNAME SVNUserNameAuthentication

Parameters:
  kind - a credential kind
Parameters:
  realm - a repository authentication realm
Parameters:
  url - a repository location that is to be accessed the first try user credential
throws:
  SVNException -




getHTTPTimeout
public long getHTTPTimeout(SVNRepository repository)(Code)
Returns a connection timeout value.
Parameters:
  repository - a repository access driver connection timeout value
since:
   1.1



getNextAuthentication
public SVNAuthentication getNextAuthentication(String kind, String realm, SVNURL url) throws SVNException(Code)
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 ISVNAuthenticationManager.getFirstAuthentication(String,String,SVNURL) 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.

For each credential kind an implementor should return a kind-specific credential. The following table matches kinds to proper credential classes:
Credential Kind Credential Class
ISVNAuthenticationManager.PASSWORD SVNPasswordAuthentication
ISVNAuthenticationManager.SSH SVNSSHAuthentication
ISVNAuthenticationManager.SSL SVNSSLAuthentication
ISVNAuthenticationManager.USERNAME SVNUserNameAuthentication

Parameters:
  kind - a credential kind
Parameters:
  realm - a repository authentication realm
Parameters:
  url - a repository location that is to be accessed the next try user credential
throws:
  SVNException -




getProxyManager
public ISVNProxyManager getProxyManager(SVNURL url) throws SVNException(Code)
Returns a proxy manager that keeps settings for that proxy server over which HTTP requests are send to a repository server.

A default auth manager uses proxy settings from the standard servers file.
Parameters:
  url - a repository location that will be accessed over the proxy server for which a manager is needed a proxy manager
throws:
  SVNException -




getSSLManager
public ISVNSSLManager getSSLManager(SVNURL url) throws SVNException(Code)
Returns the SSL manager for secure interracting with a repository.

A default implementation of ISVNAuthenticationManager returns an SSL manager that uses CA and user certificate files specified in the standard servers file.

Even if the default manager's getSSLManager() method returns null for the given url, a secure context will be created anymore, but, of course no user certificate files are provided to a server as well as server's certificates are not checked.
Parameters:
  url - a repository location to access an appropriate SSL manager
throws:
  SVNException -




isAuthenticationForced
public boolean isAuthenticationForced()(Code)
Checks whether client should send authentication credentials to a repository server not waiting for the server's challenge.

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. true if authentication credentials are forced to be sent;false when credentials are to be sent only in response to a server challenge
See Also:   ISVNAuthenticationManager.setAuthenticationForced(boolean)




setAuthenticationForced
public void setAuthenticationForced(boolean forced)(Code)
Specifies the way how credentials are to be supplied to a repository server.
Parameters:
  forced - true to force credentials sending; false to put off sending credentials till a server challenge
See Also:   ISVNAuthenticationManager.isAuthenticationForced()



setAuthenticationProvider
public void setAuthenticationProvider(ISVNAuthenticationProvider provider)(Code)
Sets a custom authentication provider that will provide user credentials for authentication.
Parameters:
  provider - an authentication provider



setRuntimeStorage
public void setRuntimeStorage(ISVNAuthenticationStorage storage)(Code)
Sets a specific runtime authentication storage manager. This storage manager will be asked by this auth manager for cached credentials as well as used to cache new ones accepted recently.
Parameters:
  storage - a custom auth storage manager



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.