Java Doc for IdempotentSequence.java in  » Net » SkunkDAV » 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 » SkunkDAV » HTTPClient 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   HTTPClient.IdempotentSequence

IdempotentSequence
class IdempotentSequence (Code)

This class checks whether a sequence of requests is idempotent. This is used to determine which requests may be automatically retried. This class also serves as a central place to record which methods have side effects and which methods are idempotent.

Note: unknown methods (i.e. a method which is not HEAD, GET, POST, PUT, DELETE, OPTIONS or TRACE) are treated conservatively, meaning they are assumed to have side effects and are not idempotent.

Usage:

 IdempotentSequence seq = new IdempotentSequence();
 seq.add(r1);
 ...
 if (seq.isIdempotent(r1)) ...
 ...
 

version:
   0.3-2 18/06/1999
author:
   Ronald Tschalär



Constructor Summary
public  IdempotentSequence()
     Start a new sequence of requests.

Method Summary
public  voidadd(Request req)
     Add the request to the end of the list of requests.
public  booleanisIdempotent(Request req)
     Is this request part of an idempotent sequence? This method must not be called before all requests have been added to this sequence; similarly, add() must not be called after this method was invoked.

We split up the sequence of requests into individual sub-sequences, or threads, with all requests in a thread having the same request-URI and no two threads having the same request-URI.

public static  voidmain(String args)
     Test code.
public static  booleanmethodHasSideEffects(String method)
    
public static  booleanmethodIsComplete(String method)
     A method is complete if any side effects of the request affect the complete resource.
public static  booleanmethodIsIdempotent(String method)
     A method is idempotent if the side effects of N identical requests is the same as for a single request (Section 9.1.2 of RFC-????).


Constructor Detail
IdempotentSequence
public IdempotentSequence()(Code)
Start a new sequence of requests.




Method Detail
add
public void add(Request req)(Code)
Add the request to the end of the list of requests. This is used to build the complete sequence of requests before determining whether the sequence is idempotent.
Parameters:
  req - the next request



isIdempotent
public boolean isIdempotent(Request req)(Code)
Is this request part of an idempotent sequence? This method must not be called before all requests have been added to this sequence; similarly, add() must not be called after this method was invoked.

We split up the sequence of requests into individual sub-sequences, or threads, with all requests in a thread having the same request-URI and no two threads having the same request-URI. Each thread is then marked as idempotent or not according to the following rules:

  1. If any method is UNKNOWN then the thread is not idempotent;
  2. else, if no method has side effects then the thread is idempotent;
  3. else, if the first method has side effects and is complete then the thread is idempotent;
  4. else, if the first method has side effects, is not complete, and no other method has side effects then the thread is idempotent;
  5. else the thread is not idempotent.

The major assumption here is that the side effects of any method only apply to resource specified. E.g. a "PUT /barbara.html" will only affect the resource "/barbara.html" and nothing else. This assumption is violated by POST of course; however, POSTs are not pipelined and will therefore never show up here.
Parameters:
  req - the request




main
public static void main(String args)(Code)
Test code.



methodHasSideEffects
public static boolean methodHasSideEffects(String method)(Code)



methodIsComplete
public static boolean methodIsComplete(String method)(Code)
A method is complete if any side effects of the request affect the complete resource. For example, a PUT is complete but a PUT with byte-ranges wouldn't be. In essence, if a request uses a method which has side effects and is complete then the state of the resource after the request is independent of the state of the resource before the request. true if method is complete



methodIsIdempotent
public static boolean methodIsIdempotent(String method)(Code)
A method is idempotent if the side effects of N identical requests is the same as for a single request (Section 9.1.2 of RFC-????). true if method is idempotent



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.