Java Doc for PushCacheProtocol.java in  » Web-Server » Jigsaw » org » w3c » www » protocol » http » cache » push » 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 » Web Server » Jigsaw » org.w3c.www.protocol.http.cache.push 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.www.protocol.http.cache.push.PushCacheProtocol

PushCacheProtocol
public class PushCacheProtocol (Code)
PushCacheProtocol Characteristics of the protocol used to control the push cache, and methods for common operations

Protocol Description

To request that "/home/abc/page.html" is inserted in cache as "http://www.abc.com/page.html" the client sends a packet with command="ADD", and remain_len set to sizeof(add_packet_t) plus the sum of the lengths of the path and the urls including their null terminators. The client then sends an add_packet describing the lengths of the two strings followed by the path and then the url.

The server replies with either command="OK" and remain_len=0 or command="ERR" and remain_len set the the length of the error string that follows immediately. In the event of an "ERR" message the connection is closed by the server.

To request that the page associated with "http://www.abc.com/page.html" be removed from the cache the client sends a packet with command="DEL", and remain_len set to sizeof(int) plus the length of the url string including the trailing null character. The server replies as with ADD above. Attempting to remove a url that is not present in the cache results in an "OK" packet being returned, the cache is unchanged.

The client can ask if a url is present in the cache by sending a packet with command="PRS", and url information as with the DEL command. The server will reply with "OK" if the url is present, "NO" if the url is not present and "ERR" if an error was encountered.

The client can request that the cache be emptied of all urls by sending a packet with command="CLN" (clean). The remain_len field is set to zero. The server will reply with either OK or ERR.

The client can terminate the dialogue by sending a command="BYE" packet and then closing the connection.

'C' code describing the packet structures are shown below

 typedef struct {
 // Bytes  Notes
 // -----  -----
 char  tag[4];         // 0-3    = {'P','C','P','P'}
 short major_version;  // 4-5    = 1
 short minor_version;  // 6-7    = 1
 char  command[4];     // 8-11   Null terminated command string 
 int   remain_len;     // 12-15  number of remaining bytes to read
 } packet_t;
 typedef struct {
 int   path_len;       // 4      Length of pathname (including null)
 int   url_len;        // 8      Length of URL (including null)
 } add_packet_t;
 Note that the command is always 4 characters in length and that the
 null characters are considered part of the command, so in Java (but
 not C) we must include the \0 when comparing strings:
 "ADD\0", "BYE\0", "OK\0\0", "ERR\0", "CLN\0", "PRS\0", "DEL\0"
 

author:
   Paul Henshaw, The Fantastic Corporation, Paul.Henshaw@fantastic.com
version:
   $Revision: 1.1 $
version:
   $Id: PushCacheProtocol.java,v 1.1 2001/10/03 15:00:46 ylafon Exp $


Field Summary
final public static  intCOMMAND_LEN
    
final public static  intHEADER_LEN
    
final public static  shortMAJ_PROTO_VERSION
    
final public static  intMAX_PAYLOAD_LEN
    
final public static  intMAX_STRING_LEN
    
final public static  shortMIN_PROTO_VERSION
    
final public static  intNO_SUCH_COMMANDERRADDDELCLNPRSBYEOKNONOP
    
final public static  intPACKET_LEN
    
final public static  intTAG_LEN
    

Constructor Summary
protected  PushCacheProtocol()
    

Method Summary
public  byte[]errorPacket(String message)
    
public  byte[]header()
    
public static  PushCacheProtocolinstance()
    
public  booleanisValidProtocolTag(byte[] packet)
    
public  byte[]noPacket()
    
public  byte[]okPacket()
    
public  intparseCommand(String command)
    

Field Detail
COMMAND_LEN
final public static int COMMAND_LEN(Code)
Size of command string in bytes (including null terminator)



HEADER_LEN
final public static int HEADER_LEN(Code)
Combined size of tag and version information



MAJ_PROTO_VERSION
final public static short MAJ_PROTO_VERSION(Code)
Protocol Major version



MAX_PAYLOAD_LEN
final public static int MAX_PAYLOAD_LEN(Code)
Maximum size of payload (follows basic packet)



MAX_STRING_LEN
final public static int MAX_STRING_LEN(Code)
Maximum size of strings (urls, paths, error messages)



MIN_PROTO_VERSION
final public static short MIN_PROTO_VERSION(Code)
Protocol minor version



NO_SUCH_COMMANDERRADDDELCLNPRSBYEOKNONOP
final public static int NO_SUCH_COMMANDERRADDDELCLNPRSBYEOKNONOP(Code)
Numeric codes for commands,



PACKET_LEN
final public static int PACKET_LEN(Code)
Size of basic packet in bytes



TAG_LEN
final public static int TAG_LEN(Code)
Size of packet tag




Constructor Detail
PushCacheProtocol
protected PushCacheProtocol()(Code)
Singleton, no public constructor, use PushCacheProtocol.instance
See Also:   PushCacheProtocol.instance




Method Detail
errorPacket
public byte[] errorPacket(String message)(Code)
Create error packet for specified error message



header
public byte[] header()(Code)



instance
public static PushCacheProtocol instance()(Code)
Access to single instance of this class



isValidProtocolTag
public boolean isValidProtocolTag(byte[] packet)(Code)
True iff first four bytes of packet are identical to the protocol tag



noPacket
public byte[] noPacket()(Code)
Byte array for NO packet



okPacket
public byte[] okPacket()(Code)
Byte array for OK packet



parseCommand
public int parseCommand(String command)(Code)
Utility function for command string parsing



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)

ww_w___.___ja_v_a___2___s___._c_o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.