Java Doc for HttpState.java in  » Net » Apache-common-HttpClient » org » apache » commons » httpclient » 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 » Net » Apache common HttpClient » org.apache.commons.httpclient 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.httpclient.HttpState

HttpState
public class HttpState (Code)

A container for HTTP attributes that may persist from request to request, such as Cookie cookies and authentication Credentials credentials .


author:
   Remy Maucherat
author:
   Rodney Waldhoff
author:
   Jeff Dever
author:
   Sean C. Sullivan
author:
   Michael Becke
author:
   Oleg Kalnichevski
author:
   Mike Bowler
author:
   Adrian Sutton
version:
   $Revision: 561099 $ $Date: 2007-07-30 21:41:17 +0200 (Mon, 30 Jul 2007) $


Field Summary
final public static  StringPREEMPTIVE_DEFAULT
     The default value for HttpState.PREEMPTIVE_PROPERTY .
final public static  StringPREEMPTIVE_PROPERTY
     The boolean system property name to turn on preemptive authentication.
protected  ArrayListcookies
     Array of Cookie cookies that this HTTP state contains.
protected  HashMapcredMap
     Map of Credentials credentials by realm that this HTTP state contains.
protected  HashMapproxyCred
    

Constructor Summary
public  HttpState()
     Default constructor.

Method Summary
public synchronized  voidaddCookie(Cookie cookie)
     Adds an Cookie HTTP cookie , replacing any existing equivalent cookies.
public synchronized  voidaddCookies(Cookie[] cookies)
     Adds an array of Cookie HTTP cookies .
public  voidclear()
     Clears the state information (all cookies, credentials and proxy credentials).
public synchronized  voidclearCookies()
     Clears all cookies.
public  voidclearCredentials()
     Clears all credentials.
public  voidclearProxyCredentials()
     Clears all proxy credentials.
public  intgetCookiePolicy()
     Returns the current CookiePolicy cookie policy for this HTTP state.
public synchronized  Cookie[]getCookies()
     Returns an array of Cookie cookies that this HTTP state currently contains.
public synchronized  Cookie[]getCookies(String domain, int port, String path, boolean secure)
     Returns an array of Cookie cookies in this HTTP state that match the given request parameters.
public synchronized  CredentialsgetCredentials(String realm, String host)
     Get the Credentials credentials for the given authentication scope on the given host. If the realm exists on host, return the coresponding credentials. If the host exists with a null realm, return the corresponding credentials. If the realm exists with a null host, return the corresponding credentials.
public synchronized  CredentialsgetCredentials(AuthScope authscope)
     Get the Credentials credentials for the given authentication scope.
public synchronized  CredentialsgetProxyCredentials(String realm, String proxyHost)
     Get the Credentials credentials for the proxy host with the given authentication scope. If the realm exists on host, return the coresponding credentials. If the host exists with a null realm, return the corresponding credentials. If the realm exists with a null host, return the corresponding credentials.
public synchronized  CredentialsgetProxyCredentials(AuthScope authscope)
     Get the Credentials proxy credentials for the given authentication scope.
public  booleanisAuthenticationPreemptive()
     Returns true if preemptive authentication should be attempted, false otherwise.
public synchronized  booleanpurgeExpiredCookies()
     Removes all of Cookie cookies in this HTTP state that have expired according to the current system time.
public synchronized  booleanpurgeExpiredCookies(Date date)
     Removes all of Cookie cookies in this HTTP state that have expired by the specified java.util.Date date .
public  voidsetAuthenticationPreemptive(boolean value)
     Defines whether preemptive authentication should be attempted.
Parameters:
  value - true if preemptive authentication should be attempted, false otherwise.
public  voidsetCookiePolicy(int policy)
     Sets the current CookiePolicy cookie policy for this HTTP state to one of the following supported policies: CookiePolicy.COMPATIBILITY , CookiePolicy.NETSCAPE_DRAFT or CookiePolicy.RFC2109 .
public synchronized  voidsetCredentials(String realm, String host, Credentials credentials)
     Sets the Credentials credentials for the given authentication realm on the given host.
public synchronized  voidsetCredentials(AuthScope authscope, Credentials credentials)
     Sets the Credentials credentials for the given authentication scope.
public synchronized  voidsetProxyCredentials(String realm, String proxyHost, Credentials credentials)
     Sets the Credentials credentials for the given proxy authentication realm on the given proxy host.
public synchronized  voidsetProxyCredentials(AuthScope authscope, Credentials credentials)
     Sets the Credentials proxy credentials for the given authentication realm.
public synchronized  StringtoString()
     Returns a string representation of this HTTP state.

Field Detail
PREEMPTIVE_DEFAULT
final public static String PREEMPTIVE_DEFAULT(Code)
The default value for HttpState.PREEMPTIVE_PROPERTY .



PREEMPTIVE_PROPERTY
final public static String PREEMPTIVE_PROPERTY(Code)
The boolean system property name to turn on preemptive authentication.



cookies
protected ArrayList cookies(Code)
Array of Cookie cookies that this HTTP state contains.



credMap
protected HashMap credMap(Code)
Map of Credentials credentials by realm that this HTTP state contains.



proxyCred
protected HashMap proxyCred(Code)
Map of Credentials proxy credentials by realm that this HTTP state contains




Constructor Detail
HttpState
public HttpState()(Code)
Default constructor.




Method Detail
addCookie
public synchronized void addCookie(Cookie cookie)(Code)
Adds an Cookie HTTP cookie , replacing any existing equivalent cookies. If the given cookie has already expired it will not be added, but existing values will still be removed.
Parameters:
  cookie - the Cookie cookie to be added
See Also:   HttpState.addCookies(Cookie[])



addCookies
public synchronized void addCookies(Cookie[] cookies)(Code)
Adds an array of Cookie HTTP cookies . Cookies are added individually and in the given array order. If any of the given cookies has already expired it will not be added, but existing values will still be removed.
Parameters:
  cookies - the Cookie cookies to be added
See Also:   HttpState.addCookie(Cookie)



clear
public void clear()(Code)
Clears the state information (all cookies, credentials and proxy credentials).



clearCookies
public synchronized void clearCookies()(Code)
Clears all cookies.



clearCredentials
public void clearCredentials()(Code)
Clears all credentials.



clearProxyCredentials
public void clearProxyCredentials()(Code)
Clears all proxy credentials.



getCookiePolicy
public int getCookiePolicy()(Code)
Returns the current CookiePolicy cookie policy for this HTTP state. The CookiePolicy cookie policy.org.apache.commons.httpclient.params.HttpMethodParams.getCookiePolicyHttpMethod.getParams



getCookies
public synchronized Cookie[] getCookies()(Code)
Returns an array of Cookie cookies that this HTTP state currently contains. an array of Cookie cookies.
See Also:   HttpState.getCookies(String,int,String,boolean)



getCookies
public synchronized Cookie[] getCookies(String domain, int port, String path, boolean secure)(Code)
Returns an array of Cookie cookies in this HTTP state that match the given request parameters.
Parameters:
  domain - the request domain
Parameters:
  port - the request port
Parameters:
  path - the request path
Parameters:
  secure - true when using HTTPS an array of Cookie cookies.
See Also:   HttpState.getCookies()



getCredentials
public synchronized Credentials getCredentials(String realm, String host)(Code)
Get the Credentials credentials for the given authentication scope on the given host. If the realm exists on host, return the coresponding credentials. If the host exists with a null realm, return the corresponding credentials. If the realm exists with a null host, return the corresponding credentials. If the realm does not exist, return the default Credentials. If there are no default credentials, return null.
Parameters:
  realm - the authentication realm
Parameters:
  host - the host the realm is on the credentials
See Also:   HttpState.setCredentials(String,String,Credentials)



getCredentials
public synchronized Credentials getCredentials(AuthScope authscope)(Code)
Get the Credentials credentials for the given authentication scope.
Parameters:
  authscope - the AuthScope authentication scope the credentials
See Also:   HttpState.setCredentials(AuthScope,Credentials)
since:
   3.0



getProxyCredentials
public synchronized Credentials getProxyCredentials(String realm, String proxyHost)(Code)
Get the Credentials credentials for the proxy host with the given authentication scope. If the realm exists on host, return the coresponding credentials. If the host exists with a null realm, return the corresponding credentials. If the realm exists with a null host, return the corresponding credentials. If the realm does not exist, return the default Credentials. If there are no default credentials, return null.
Parameters:
  realm - the authentication realm
Parameters:
  proxyHost - the proxy host the realm is on the credentials
See Also:   HttpState.setProxyCredentials(String,String,Credentials)



getProxyCredentials
public synchronized Credentials getProxyCredentials(AuthScope authscope)(Code)
Get the Credentials proxy credentials for the given authentication scope.
Parameters:
  authscope - the AuthScope authentication scope the credentials
See Also:   HttpState.setProxyCredentials(AuthScope,Credentials)
since:
   3.0



isAuthenticationPreemptive
public boolean isAuthenticationPreemptive()(Code)
Returns true if preemptive authentication should be attempted, false otherwise. boolean flag.org.apache.commons.httpclient.params.HttpClientParams.isAuthenticationPreemptiveHttpClient.getParams



purgeExpiredCookies
public synchronized boolean purgeExpiredCookies()(Code)
Removes all of Cookie cookies in this HTTP state that have expired according to the current system time.
See Also:   HttpState.purgeExpiredCookies(java.util.Date)



purgeExpiredCookies
public synchronized boolean purgeExpiredCookies(Date date)(Code)
Removes all of Cookie cookies in this HTTP state that have expired by the specified java.util.Date date .
Parameters:
  date - The java.util.Date date to compare against. true if any cookies were purged.
See Also:   Cookie.isExpired(java.util.Date)
See Also:   HttpState.purgeExpiredCookies()



setAuthenticationPreemptive
public void setAuthenticationPreemptive(boolean value)(Code)
Defines whether preemptive authentication should be attempted.
Parameters:
  value - true if preemptive authentication should be attempted, false otherwise. org.apache.commons.httpclient.params.HttpClientParams.setAuthenticationPreemptive(boolean)HttpClient.getParams



setCookiePolicy
public void setCookiePolicy(int policy)(Code)
Sets the current CookiePolicy cookie policy for this HTTP state to one of the following supported policies: CookiePolicy.COMPATIBILITY , CookiePolicy.NETSCAPE_DRAFT or CookiePolicy.RFC2109 .
Parameters:
  policy - new CookiePolicy cookie policyorg.apache.commons.httpclient.params.HttpMethodParams.setCookiePolicy(String)HttpMethod.getParams



setCredentials
public synchronized void setCredentials(String realm, String host, Credentials credentials)(Code)
Sets the Credentials credentials for the given authentication realm on the given host. The null realm signifies default credentials for the given host, which should be used when no Credentials credentials have been explictly supplied for the challenging realm. The null host signifies default credentials, which should be used when no Credentials credentials have been explictly supplied for the challenging host. Any previous credentials for the given realm on the given host will be overwritten.
Parameters:
  realm - the authentication realm
Parameters:
  host - the host the realm belongs to
Parameters:
  credentials - the authentication Credentials credentials for the given realm.
See Also:   HttpState.getCredentials(String,String)
See Also:   HttpState.setProxyCredentials(String,String,Credentials)
See Also:   



setCredentials
public synchronized void setCredentials(AuthScope authscope, Credentials credentials)(Code)
Sets the Credentials credentials for the given authentication scope. Any previous credentials for the given scope will be overwritten.
Parameters:
  authscope - the AuthScope authentication scope
Parameters:
  credentials - the authentication Credentials credentials for the given scope.
See Also:   HttpState.getCredentials(AuthScope)
See Also:   HttpState.setProxyCredentials(AuthScope,Credentials)
See Also:   
since:
   3.0



setProxyCredentials
public synchronized void setProxyCredentials(String realm, String proxyHost, Credentials credentials)(Code)
Sets the Credentials credentials for the given proxy authentication realm on the given proxy host. The null proxy realm signifies default credentials for the given proxy host, which should be used when no Credentials credentials have been explictly supplied for the challenging proxy realm. The null proxy host signifies default credentials, which should be used when no Credentials credentials have been explictly supplied for the challenging proxy host. Any previous credentials for the given proxy realm on the given proxy host will be overwritten.
Parameters:
  realm - the authentication realm
Parameters:
  proxyHost - the proxy host
Parameters:
  credentials - the authentication credentials for the given realm
See Also:   HttpState.getProxyCredentials(AuthScope)
See Also:   HttpState.setCredentials(AuthScope,Credentials)



setProxyCredentials
public synchronized void setProxyCredentials(AuthScope authscope, Credentials credentials)(Code)
Sets the Credentials proxy credentials for the given authentication realm. Any previous credentials for the given realm will be overwritten.
Parameters:
  authscope - the AuthScope authentication scope
Parameters:
  credentials - the authentication Credentials credentials for the given realm.
See Also:   HttpState.getProxyCredentials(AuthScope)
See Also:   HttpState.setCredentials(AuthScope,Credentials)
See Also:   
since:
   3.0



toString
public synchronized String toString()(Code)
Returns a string representation of this HTTP state. The string representation of the HTTP state.
See Also:   java.lang.Object.toString



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.