jicarilla-sandbox/platform/components/http/api/src/java/org/jicarilla/http Encoding.java,1.2,1.3 ProtocolPolicy.java,1.1,1.2

Leo Simons <[email protected]>
Newsgroups gmane.comp.java.jicarilla.cvs
Message-ID <[email protected]>
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/api/src/java/org/jicarilla/http
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9759/platform/components/http/api/src/java/org/jicarilla/http

Modified Files:
	Encoding.java ProtocolPolicy.java 
Log Message:
more early code to tackle the higher-level protocol issues

Index: ProtocolPolicy.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/api/src/java/org/jicarilla/http/ProtocolPolicy.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ProtocolPolicy.java	9 Apr 2004 18:56:00 -0000	1.1
+++ ProtocolPolicy.java	9 Apr 2004 20:29:49 -0000	1.2
@@ -36,23 +36,111 @@
  * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
  * @version $Id$
  */
-public interface ProtocolPolicy
+public class ProtocolPolicy
 {
-    public RFC2119.Level persistentConnectionRequirement();
-    
-    public Date getLastModifiedDate();
-    
-    public EntityTag getEntityTag();
-    
-    public CachePolicy getCachePolicy();
-    
-    public Cookie[] getCookies();
-    
-    public String getContentType();
-    
-    public RFC2119.Level chunkedTransferCodingRequirement();
-    
-    public int getContentLength();
-    
-    public ContentCoding getContentCoding();
+    protected RFC2119.Level m_persistentConnectionRequirement;
+    protected Date m_lastModifiedDate;
+    protected EntityTag m_entityTag;
+    protected CachePolicy m_cachePolicy;
+    protected Cookie[] m_cookies;
+    protected String m_contentType;
+    protected RFC2119.Level m_chunkedTransferCodingRequirement;
+    protected int m_contentLength = -1;
+    protected ContentCoding m_contentCoding;
+
+    public ProtocolPolicy()
+    {
+    }
+
+    public RFC2119.Level getPersistentConnectionRequirement()
+    {
+        return m_persistentConnectionRequirement;
+    }
+
+    public void setPersistentConnectionRequirement(
+            RFC2119.Level persistentConnectionRequirement )
+    {
+        m_persistentConnectionRequirement = persistentConnectionRequirement;
+    }
+
+    public Date getLastModifiedDate()
+    {
+        return m_lastModifiedDate;
+    }
+
+    public void setLastModifiedDate( Date lastModifiedDate )
+    {
+        m_lastModifiedDate = lastModifiedDate;
+    }
+
+    public EntityTag getEntityTag()
+    {
+        return m_entityTag;
+    }
+
+    public void setEntityTag( EntityTag entityTag )
+    {
+        m_entityTag = entityTag;
+    }
+
+    public CachePolicy getCachePolicy()
+    {
+        return m_cachePolicy;
+    }
+
+    public void setCachePolicy( CachePolicy cachePolicy )
+    {
+        m_cachePolicy = cachePolicy;
+    }
+
+    public Cookie[] getCookies()
+    {
+        return m_cookies;
+    }
+
+    public void setCookies( Cookie[] cookies )
+    {
+        m_cookies = cookies;
+    }
+
+    public String getContentType()
+    {
+        return m_contentType;
+    }
+
+    public void setContentType( String contentType )
+    {
+        m_contentType = contentType;
+    }
+
+    public RFC2119.Level getChunkedTransferCodingRequirement()
+    {
+        return m_chunkedTransferCodingRequirement;
+    }
+
+    public void setChunkedTransferCodingRequirement(
+            RFC2119.Level chunkedTransferCodingRequirement )
+    {
+        m_chunkedTransferCodingRequirement = chunkedTransferCodingRequirement;
+    }
+
+    public int getContentLength()
+    {
+        return m_contentLength;
+    }
+
+    public void setContentLength( int contentLength )
+    {
+        m_contentLength = contentLength;
+    }
+
+    public ContentCoding getContentCoding()
+    {
+        return m_contentCoding;
+    }
+
+    public void setContentCoding( ContentCoding contentCoding )
+    {
+        m_contentCoding = contentCoding;
+    }
 }

Index: Encoding.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/api/src/java/org/jicarilla/http/Encoding.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Encoding.java	9 Apr 2004 18:56:00 -0000	1.2
+++ Encoding.java	9 Apr 2004 20:29:49 -0000	1.3
@@ -605,28 +605,44 @@
     public static final String HEADER_CONNECTION = "connection";
     public static final String HEADER_CONNECTION_CLOSE = " close";
     public static final String HEADER_LAST_MODIFIED = "last-modified";
+    public static final String HEADER_ETAG = "etag";
+    public static final String HEADER_CACHE_CONTROL = "cache-control";
+    public static final String HEADER_CACHE_CONTROL_MUST_REVALIDATE = "must-revalidate";
+    public static final String HEADER_CACHE_CONTROL_NO_CACHE = "no-cache";
+    public static final String HEADER_CACHE_CONTROL_NO_STORE = "no-store";
 
     public static final ByteBuffer HEADER_CONTENT_LENGTH_BUFFER;
     public static final ByteBuffer HEADER_CONNECTION_BUFFER;
     public static final ByteBuffer HEADER_CONNECTION_CLOSE_BUFFER;
     public static final ByteBuffer HEADER_LAST_MODIFIED_BUFFER;
+    public static final ByteBuffer HEADER_ETAG_BUFFER;
+    public static final ByteBuffer HEADER_CACHE_CONTROL_BUFFER;
+    public static final ByteBuffer HEADER_CACHE_CONTROL_MUST_REVALIDATE_BUFFER;
+    public static final ByteBuffer HEADER_CACHE_CONTROL_NO_CACHE_BUFFER;
+    public static final ByteBuffer HEADER_CACHE_CONTROL_NO_STORE_BUFFER;
 
     static
     {
-        byte[] arr = HEADER_CONTENT_LENGTH.getBytes();
-        HEADER_CONTENT_LENGTH_BUFFER = ByteBuffer.wrap( arr );
-
-        arr = HEADER_CONNECTION.getBytes();
-        HEADER_CONNECTION_BUFFER = ByteBuffer.wrap( arr );
-
-        arr = HEADER_CONNECTION_CLOSE.getBytes();
-        HEADER_CONNECTION_CLOSE_BUFFER = ByteBuffer.wrap( arr );
-
-        arr = HEADER_LAST_MODIFIED.getBytes();
-        HEADER_LAST_MODIFIED_BUFFER = ByteBuffer.wrap( arr );
+        HEADER_CONTENT_LENGTH_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CONTENT_LENGTH );
+        HEADER_CONNECTION_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CONNECTION );
+        HEADER_CONNECTION_CLOSE_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CONNECTION_CLOSE );
+        HEADER_LAST_MODIFIED_BUFFER = NioUtil.toByteBuffer(
+                HEADER_LAST_MODIFIED );
+        HEADER_ETAG_BUFFER = NioUtil.toByteBuffer(
+                HEADER_ETAG );
+        HEADER_CACHE_CONTROL_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CACHE_CONTROL );
+        HEADER_CACHE_CONTROL_MUST_REVALIDATE_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CACHE_CONTROL_MUST_REVALIDATE );
+        HEADER_CACHE_CONTROL_NO_CACHE_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CACHE_CONTROL_NO_CACHE );
+        HEADER_CACHE_CONTROL_NO_STORE_BUFFER = NioUtil.toByteBuffer(
+                HEADER_CACHE_CONTROL_NO_STORE );
     }
 
-
     //
     // UTILITY METHODS
     //



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.