You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2007/09/22 12:56:06 UTC

svn commit: r578403 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: auth/params/ conn/params/ cookie/ cookie/params/ impl/cookie/

Author: olegk
Date: Sat Sep 22 03:56:04 2007
New Revision: 578403

URL: http://svn.apache.org/viewvc?rev=578403&view=rev
Log:
* Added Port and commentURL attributes to Cookie interface (required by RFC2965)
* Added SetCookie2 interface representing the Set-Cookie2 header
* Copied CookieVersionSupport interface from HttpClient 3.1 branch 

Added:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieVersionSupport.java
      - copied, changed from r563549, jakarta/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieVersionSupport.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java   (with props)
Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/params/AuthPNames.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/ClientCookie.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SM.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/params/AuthPNames.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/params/AuthPNames.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/params/AuthPNames.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/params/AuthPNames.java Sat Sep 22 03:56:04 2007
@@ -31,10 +31,6 @@
 
 package org.apache.http.auth.params;
 
-import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.HTTP;
-
-
 /**
  * Parameter names for HttpAuth.
  * 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/params/ConnRoutePNames.java Sat Sep 22 03:56:04 2007
@@ -30,8 +30,6 @@
 
 package org.apache.http.conn.params;
 
-import org.apache.http.params.HttpParams;
-
 /**
  * Parameter names for routing in HttpConn.
  * 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/ClientCookie.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/ClientCookie.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/ClientCookie.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/ClientCookie.java Sat Sep 22 03:56:04 2007
@@ -55,6 +55,11 @@
     public static final String COMMENT_ATTR    = "comment";
     public static final String EXPIRES_ATTR    = "expires";
     
+    // RFC2965 attributes
+    public static final String PORT_ATTR       = "port";
+    public static final String COMMENTURL_ATTR = "commenturl";
+    public static final String DISCARD_ATTR    = "discard";
+    
     String getAttribute(String name);
     
     boolean containsAttribute(String name);

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java Sat Sep 22 03:56:04 2007
@@ -67,6 +67,12 @@
     String getComment();
 
     /**
+     * If a user agent (web browser) presents this cookie to a user, the
+     * cookie's purpose will be described by the information at this URL.
+     */
+    String getCommentURL();    
+    
+    /**
      * Returns the expiration {@link Date} of the cookie, or <tt>null</tt>
      * if none exists.
      * <p><strong>Note:</strong> the object returned by this method is 
@@ -98,6 +104,12 @@
      * @return The value of the path attribute.
      */
     String getPath();
+
+    /**
+     * Get the Port attribute. It restricts the ports to which a cookie
+     * may be returned in a Cookie request header.
+     */
+    int[] getPorts();
 
     /**
      * Indicates whether this cookie requires a secure connection.

Copied: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieVersionSupport.java (from r563549, jakarta/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieVersionSupport.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieVersionSupport.java?p2=jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieVersionSupport.java&p1=jakarta/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieVersionSupport.java&r1=563549&r2=578403&rev=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieVersionSupport.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieVersionSupport.java Sat Sep 22 03:56:04 2007
@@ -1,5 +1,5 @@
 /*
- * $Header: $
+ * $HeadURL$
  * $Revision$
  * $Date$
  *
@@ -28,9 +28,9 @@
  *
  */
 
-package org.apache.commons.httpclient.cookie;
+package org.apache.http.cookie;
 
-import org.apache.commons.httpclient.Header;
+import org.apache.http.Header;
 
 /**
  * Defines cookie specification specific capabilities

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SM.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SM.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SM.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SM.java Sat Sep 22 03:56:04 2007
@@ -40,8 +40,8 @@
  */
 public interface SM {
 
-    public static final String COOKIE= "Cookie";
-
+    public static final String COOKIE = "Cookie";
+    public static final String COOKIE_2 = "Cookie2";
     public static final String SET_COOKIE = "Set-Cookie";
        
 }

Added: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java?rev=578403&view=auto
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java (added)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java Sat Sep 22 03:56:04 2007
@@ -0,0 +1,57 @@
+/*
+ * $HeadURL$
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.cookie;
+
+/**
+ * This interface represents a <code>SetCookie2</code> response header sent by the 
+ * origin server to the HTTP agent in order to maintain a conversational state.
+ * 
+ * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
+ * 
+ * @since 4.0
+ */
+public interface SetCookie2 extends Cookie {
+
+    /**
+     * If a user agent (web browser) presents this cookie to a user, the
+     * cookie's purpose will be described by the information at this URL.
+     */
+    void setCommentURL(String commentURL);
+    
+    /**
+     * Sets the Port attribute. It restricts the ports to which a cookie
+     * may be returned in a Cookie request header.
+     */
+    void setPorts(int[] ports);
+    
+}
+

Propchange: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/SetCookie2.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java Sat Sep 22 03:56:04 2007
@@ -31,9 +31,6 @@
 
 package org.apache.http.cookie.params;
 
-import org.apache.http.params.HttpParams;
-
-
 /**
  * Parameter names for cookie specifications in HttpCookie.
  * 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java?rev=578403&r1=578402&r2=578403&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java Sat Sep 22 03:56:04 2007
@@ -126,6 +126,15 @@
         cookieComment = comment;
     }
 
+    
+    /**
+     * Returns null. Cookies prior to RFC2965 do not set this attribute
+     */
+    public String getCommentURL() {
+        return null;
+    }
+
+    
     /**
      * Returns the expiration {@link Date} of the cookie, or <tt>null</tt>
      * if none exists.
@@ -243,6 +252,15 @@
         isSecure = secure;
     }
 
+
+    /**
+     * Returns null. Cookies prior to RFC2965 do not set this attribute
+     */
+    public int[] getPorts() {
+        return null;
+    }
+
+    
     /**
      * Returns the version of the cookie specification to which this
      * cookie conforms.