Java Doc for DefaultCredentialsProvider.java in  » Testing » htmlunit » com » gargoylesoftware » htmlunit » 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 » Testing » htmlunit » com.gargoylesoftware.htmlunit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.gargoylesoftware.htmlunit.DefaultCredentialsProvider

DefaultCredentialsProvider
public class DefaultCredentialsProvider implements CredentialsProvider,Serializable(Code)
Default HtmlUnit implementation of the CredentialsProvider interface. Provides credentials for both web servers and proxies. Supports NTLM authentication, Digest authentication, and Basic HTTP authentication.
version:
   $Revision: 2132 $
author:
   Daniel Gredler
author:
   Vikram Shitole
author:
   Marc Guillemot
author:
   Ahmed Ashour



Constructor Summary
public  DefaultCredentialsProvider()
     Creates a new DefaultCredentialsProvider instance.

Method Summary
public  voidaddCredentials(String username, String password)
     Adds credentials for the specified username/password for any host/port/realm combination. The credentials may be for any authentication scheme, including NTLM, digest and basic HTTP authentication.
public  voidaddCredentials(String username, String password, String host, int port, String realm)
     Adds credentials for the specified username/password on the specified host/port for the specified realm.
public  voidaddNTLMCredentials(String username, String password, String host, int port, String clientHost, String clientDomain)
     Adds NTLM credentials for the specified username/password on the specified host/port.
Parameters:
  username - The username for the new credentials.
public  voidaddNTLMProxyCredentials(String username, String password, String host, int port, String clientHost, String clientDomain)
     Adds NTLM proxy credentials for the specified username/password on the specified host/port.
Parameters:
  username - The username for the new credentials.
public  voidaddProxyCredentials(String username, String password)
     Adds proxy credentials for the specified username/password for any host/port/realm combination.
public  voidaddProxyCredentials(String username, String password, String host, int port)
     Adds proxy credentials for the specified username/password on the specified host/port.
protected  booleanalreadyAnswered(AuthScheme scheme, String host, int port, boolean proxy)
     Indicates if this provider has already provided an answer for this (scheme, host, port, proxy).
protected  ObjectbuildKey(AuthScheme scheme, String host, int port, boolean proxy)
    
protected  voidclearAnswered()
     Clears the cache of answered (scheme, host, port, proxy) combinations.
public  CredentialsgetCredentials(AuthScheme scheme, String host, int port, boolean proxy)
     Returns the credentials associated with the specified scheme, host and port
Parameters:
  scheme - The authentication scheme being used (basic, digest, NTLM, etc).
Parameters:
  host - The host we are authenticating for.
Parameters:
  port - The port we are authenticating for.
Parameters:
  proxy - Whether or not we are authenticating using a proxy.
final protected  LoggetLog()
    
protected  voidmarkAsAnswered(AuthScheme scheme, String host, int port, boolean proxy)
    
protected  booleanmatchHost(AuthScope scope, String host)
    
protected  booleanmatchPort(AuthScope scope, int port)
    
protected  booleanmatchRealm(AuthScope scope, AuthScheme scheme)
    
protected  booleanmatchScheme(AuthScope scope, AuthScheme scheme)
    


Constructor Detail
DefaultCredentialsProvider
public DefaultCredentialsProvider()(Code)
Creates a new DefaultCredentialsProvider instance.




Method Detail
addCredentials
public void addCredentials(String username, String password)(Code)
Adds credentials for the specified username/password for any host/port/realm combination. The credentials may be for any authentication scheme, including NTLM, digest and basic HTTP authentication. If you are using sensitive username/password information, please do NOT use this method. If you add credentials using this method, any server that requires authentication will receive the specified username and password.
Parameters:
  username - The username for the new credentials.
Parameters:
  password - The password for the new credentials.



addCredentials
public void addCredentials(String username, String password, String host, int port, String realm)(Code)
Adds credentials for the specified username/password on the specified host/port for the specified realm. The credentials may be for any authentication scheme, including NTLM, digest and basic HTTP authentication.
Parameters:
  username - The username for the new credentials.
Parameters:
  password - The password for the new credentials.
Parameters:
  host - The host to which to the new credentials apply (null if applicable to any host).
Parameters:
  port - The port to which to the new credentials apply (negative if applicable to any port).
Parameters:
  realm - The realm to which to the new credentials apply (null if applicable to any realm).



addNTLMCredentials
public void addNTLMCredentials(String username, String password, String host, int port, String clientHost, String clientDomain)(Code)
Adds NTLM credentials for the specified username/password on the specified host/port.
Parameters:
  username - The username for the new credentials. This should not include the domain to authenticate with.For example: "user" is correct whereas "DOMAIN\\user" is not.
Parameters:
  password - The password for the new credentials.
Parameters:
  host - The host to which to the new credentials apply (null if applicable to any host).
Parameters:
  port - The port to which to the new credentials apply (negative if applicable to any port).
Parameters:
  clientHost - The host the authentication request is originating from. Essentially, the computer name forthis machine.
Parameters:
  clientDomain - The domain to authenticate within.



addNTLMProxyCredentials
public void addNTLMProxyCredentials(String username, String password, String host, int port, String clientHost, String clientDomain)(Code)
Adds NTLM proxy credentials for the specified username/password on the specified host/port.
Parameters:
  username - The username for the new credentials. This should not include the domain to authenticate with.For example: "user" is correct whereas "DOMAIN\\user" is not.
Parameters:
  password - The password for the new credentials.
Parameters:
  host - The host to which to the new credentials apply (null if applicable to any host).
Parameters:
  port - The port to which to the new credentials apply (negative if applicable to any port).
Parameters:
  clientHost - The host the authentication request is originating from. Essentially, the computer name forthis machine.
Parameters:
  clientDomain - The domain to authenticate within.



addProxyCredentials
public void addProxyCredentials(String username, String password)(Code)
Adds proxy credentials for the specified username/password for any host/port/realm combination.
Parameters:
  username - The username for the new credentials.
Parameters:
  password - The password for the new credentials.



addProxyCredentials
public void addProxyCredentials(String username, String password, String host, int port)(Code)
Adds proxy credentials for the specified username/password on the specified host/port.
Parameters:
  username - The username for the new credentials.
Parameters:
  password - The password for the new credentials.
Parameters:
  host - The host to which to the new credentials apply (null if applicable to any host).
Parameters:
  port - The port to which to the new credentials apply (negative if applicable to any port).



alreadyAnswered
protected boolean alreadyAnswered(AuthScheme scheme, String host, int port, boolean proxy)(Code)
Indicates if this provider has already provided an answer for this (scheme, host, port, proxy).
Parameters:
  scheme - The scheme
Parameters:
  host - the server name.
Parameters:
  port - the server port.
Parameters:
  proxy - is proxy true if the provider has already provided an answer for this.



buildKey
protected Object buildKey(AuthScheme scheme, String host, int port, boolean proxy)(Code)
Build a key with the specified data
Parameters:
  scheme - The scheme
Parameters:
  host - the server name.
Parameters:
  port - the server port.
Parameters:
  proxy - is proxy the new key.



clearAnswered
protected void clearAnswered()(Code)
Clears the cache of answered (scheme, host, port, proxy) combinations.



getCredentials
public Credentials getCredentials(AuthScheme scheme, String host, int port, boolean proxy) throws CredentialsNotAvailableException(Code)
Returns the credentials associated with the specified scheme, host and port
Parameters:
  scheme - The authentication scheme being used (basic, digest, NTLM, etc).
Parameters:
  host - The host we are authenticating for.
Parameters:
  port - The port we are authenticating for.
Parameters:
  proxy - Whether or not we are authenticating using a proxy. The credentials corresponding to the specified scheme, host and port or nullif already asked for it to avoid infinite loop
throws:
  CredentialsNotAvailableException - If the specified credentials cannot be provided due to an error.
See Also:   CredentialsProvider.getCredentials(AuthSchemeStringintboolean)



getLog
final protected Log getLog()(Code)
Return the log object for this class The log object



markAsAnswered
protected void markAsAnswered(AuthScheme scheme, String host, int port, boolean proxy)(Code)

Parameters:
  scheme - The scheme
Parameters:
  host - the server name.
Parameters:
  port - the server port.
Parameters:
  proxy - is proxy



matchHost
protected boolean matchHost(AuthScope scope, String host)(Code)

Parameters:
  host - the request host for which Credentials are asked
Parameters:
  scope - the configured authorization scope true if the scope's host matches the provided one



matchPort
protected boolean matchPort(AuthScope scope, int port)(Code)

Parameters:
  port - the request port for which Credentials are asked
Parameters:
  scope - the configured authorization scope true if the scope's port matches the provided one



matchRealm
protected boolean matchRealm(AuthScope scope, AuthScheme scheme)(Code)

Parameters:
  scheme - the request scheme for which Credentials are asked
Parameters:
  scope - the configured authorization scope true if the scope's realm matches the one of the scheme



matchScheme
protected boolean matchScheme(AuthScope scope, AuthScheme scheme)(Code)

Parameters:
  scheme - the request scheme for which Credentials are asked
Parameters:
  scope - the configured authorization scope true if the scope's scheme matches the provided one



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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