One item that has been published in the Tuscany future roadmap (http://tuscany.apache.org/sca-java-roadmap.html) is the need for Atom binding etag and server sided caching support. JIRA TUSCANY-2447 has been opened to track this feature.

I'd like to ask the Tuscany dev community for some of their ideas and needs on this issue. Here are some of my ideas on this item.

Requirements
1) Provide a set of Tuscany APIs, helper classes, etc that enable implementation of etag support and server side caching such as last-modified on entries. 2) Support common caching protocols as defined in Atom Publishing Protocol specification (see http://tools.ietf.org/html/rfc5023#section-9.5) 3) Implement HTTP header APIs and helper classes that enable conditional caching support as given in the HTTP 1.1 specifications (http://tools.ietf.org/html/rfc2616#section-13). Examples of these request and response header fields are If-Match, If-None-Match, If-Range)

Here are some use cases that show how a server should respond to various PUT and GET requests with provided etags:
1) Example HTTP PUT request (new entry put, new etag responded)
User client post request
       POST /myblog/entries HTTP/1.1
       Host: example.org
       Content-Type: application/atom+xml;type=entry
       Content-Length: nnn
       Slug: First Post
       <?xml version="1.0" ?>
       <entry xmlns="http://www.w3.org/2005/Atom";>...</entry>

Atom server response (note unique ETag)
       HTTP/1.1 201 Created
       Date: Fri, 23 Feb 2007 21:17:11 GMT
       Content-Length: nnn
       Content-Type: application/atom+xml;type=entry
       Location: http://example.org/edit/first-post.atom
       Content-Location: http://example.org/edit/first-post.atom
       ETag: "e180ee84f0671b1"
       <?xml version="1.0" ?>
       <entry xmlns="http://www.w3.org/2005/Atom";> ... </entry>

2) Conditional GET example (get with etag. entry is up to date)
User client GET request
      GET /edit/first-post.atom HTTP/1.1
       Host: example.org
       If-None-Match: "e180ee84f0671b1"

Atom server response (item was up to date)
       HTTP/1.1 304 Not Modified
       Date: Sat, 24 Feb 2007 13:17:11 GMT

3) Conditional POST request (post with etag. entry provided is stale)
User client POST request
       PUT /edit/first-post.atom HTTP/1.1
       Host: example.org
       Content-Type: application/atom+xml;type=entry
       Content-Length: nnn
       If-Match: "e180ee84f0671b1"
       <?xml version="1.0" ?>
       <entry xmlns="http://www.w3.org/2005/Atom";> ... </entry>

Atom server response (item was edited by another user)
       HTTP/1.1 412 Precondition Failed
       Date: Sat, 24 Feb 2007 16:34:11 GMT

I am by no means an expert on defining Tuscany requirements in this area, so please correct me if I am off base. I would appreciate other Tuscany users and developers views on what is needed.

--
Thanks, Dan Becker

Reply via email to