org.apache.commons.latka.http
Class SessionImpl

java.lang.Object
  |
  +--org.apache.commons.latka.http.SessionImpl
All Implemented Interfaces:
Session

public class SessionImpl
extends java.lang.Object
implements Session

An implementation of a Latka Session interface based on the Jakarta Commons HttpClient package.

Author:
Doug Sale, Morgan Delagrange

Constructor Summary
SessionImpl()
           
 
Method Summary
 void addCookie(java.lang.String domain, java.lang.String path, java.lang.String name, java.lang.String value)
          Adds a cookie to all HTTP requests whose domain and path match (according to RFC2109).
 Request createRequest(java.lang.String label, java.net.URL url, int httpMethod, boolean followRedirects)
          Creates a request object with the specified URL and HTTP Method.
 Request createRequest(java.net.URL url, int httpMethod)
          Creates a request object with the specified URL and HTTP Method.
 java.lang.String getCookieValue(java.lang.String name)
          Returns the value of cookie name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionImpl

public SessionImpl()
Method Detail

addCookie

public void addCookie(java.lang.String domain,
                      java.lang.String path,
                      java.lang.String name,
                      java.lang.String value)
Adds a cookie to all HTTP requests whose domain and path match (according to RFC2109).
Specified by:
addCookie in interface Session
Parameters:
domain - the domain to which the cookie should apply
path - the path to which the cookie should apply
name - the name of the cookie
value - the value of the cookie

createRequest

public Request createRequest(java.lang.String label,
                             java.net.URL url,
                             int httpMethod,
                             boolean followRedirects)
Creates a request object with the specified URL and HTTP Method. Note: in the current implementation, old request objects will not
Specified by:
createRequest in interface Session
Parameters:
label - Name of the request
url - The URL to request of the HTTP server.
httpMethod - An integer representing the HTTP method (e.g. GET, PUT) used to communicate with server.
Returns:
a new Request object representing the url and httpMethod
See Also:
Request.HTTP_METHOD_GET, Request.HTTP_METHOD_POST

createRequest

public Request createRequest(java.net.URL url,
                             int httpMethod)
Creates a request object with the specified URL and HTTP Method.
Specified by:
createRequest in interface Session
Parameters:
url - The URL to request of the HTTP server.
httpMethod - An integer representing the HTTP method (e.g. GET, PUT) used to communicate with server.
Returns:
a new Request object representing the url and httpMethod
See Also:
Request.HTTP_METHOD_GET, Request.HTTP_METHOD_POST

getCookieValue

public java.lang.String getCookieValue(java.lang.String name)
Returns the value of cookie name.
Specified by:
getCookieValue in interface Session
Parameters:
name - the name of the cookie
Returns:
the value of the cookie, or null if the cookie isn't set


Copyright © 2001 Apache Software Foundation. Documenation generated September 13 2001.