org.apache.tapestry.services.impl
Class CookieSourceImpl

java.lang.Object
  extended by org.apache.tapestry.services.impl.CookieSourceImpl
All Implemented Interfaces:
CookieSource

public class CookieSourceImpl
extends Object
implements CookieSource

Implementation of the CookieSource service interface.

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
CookieSourceImpl()
           
 
Method Summary
 String readCookieValue(String name)
          Returns the value of the first cookie whose name matches.
 void removeCookieValue(String name)
          Removes a previously written cookie, by writing a new cookie with a maxAge of 0.
 void setDefaultMaxAge(int defaultMaxAge)
           
 void setRequest(HttpServletRequest request)
           
 void setResponse(HttpServletResponse response)
           
 void writeCookieValue(String name, String value)
          Creates or updates a cookie value.
 void writeCookieValue(String name, String value, int maxAge)
          As with CookieSource.writeCookieValue(String, String) but an explicit maximum age may be set.
 void writeCookieValue(String name, String value, String path)
          As with CookieSource.writeCookieValue(String, String) but an explicit path may be set.
 void writeCookieValue(String name, String value, String path, String domain)
          As with CookieSource.writeCookieValue(String, String, String) but an explicit domain may be set.
 void writeDomainCookieValue(String name, String value, String domain)
          As with CookieSource.writeCookieValue(String, String) but an explicit path may be set.
 void writeDomainCookieValue(String name, String value, String domain, int maxAge)
          As with CookieSource.writeCookieValue(String, String) but an explicit path may be set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieSourceImpl

public CookieSourceImpl()
Method Detail

readCookieValue

public String readCookieValue(String name)
Description copied from interface: CookieSource
Returns the value of the first cookie whose name matches. Returns null if no such cookie exists. This method is only aware of cookies that are part of the incoming request; it does not know about additional cookies added since then (via CookieSource.writeCookieValue(String, String)).

Specified by:
readCookieValue in interface CookieSource

writeCookieValue

public void writeCookieValue(String name,
                             String value)
Description copied from interface: CookieSource
Creates or updates a cookie value. The value is stored using a max age (in seconds) defined by the symbol org.apache.tapestry.default-cookie-max-age. The factory default for this value is the equivalent of one week.

Specified by:
writeCookieValue in interface CookieSource

writeCookieValue

public void writeCookieValue(String name,
                             String value,
                             int maxAge)
Description copied from interface: CookieSource
As with CookieSource.writeCookieValue(String, String) but an explicit maximum age may be set.

Specified by:
writeCookieValue in interface CookieSource
Parameters:
name - the name of the cookie
value - the value to be stored in the cookie
maxAge - the maximum age, in seconds, to store the cookie

writeCookieValue

public void writeCookieValue(String name,
                             String value,
                             String path)
Description copied from interface: CookieSource
As with CookieSource.writeCookieValue(String, String) but an explicit path may be set.

Specified by:
writeCookieValue in interface CookieSource

writeDomainCookieValue

public void writeDomainCookieValue(String name,
                                   String value,
                                   String domain)
Description copied from interface: CookieSource
As with CookieSource.writeCookieValue(String, String) but an explicit path may be set.

Specified by:
writeDomainCookieValue in interface CookieSource

writeDomainCookieValue

public void writeDomainCookieValue(String name,
                                   String value,
                                   String domain,
                                   int maxAge)
Description copied from interface: CookieSource
As with CookieSource.writeCookieValue(String, String) but an explicit path may be set.

Specified by:
writeDomainCookieValue in interface CookieSource

writeCookieValue

public void writeCookieValue(String name,
                             String value,
                             String path,
                             String domain)
Description copied from interface: CookieSource
As with CookieSource.writeCookieValue(String, String, String) but an explicit domain may be set.

Specified by:
writeCookieValue in interface CookieSource

removeCookieValue

public void removeCookieValue(String name)
Description copied from interface: CookieSource
Removes a previously written cookie, by writing a new cookie with a maxAge of 0.

Specified by:
removeCookieValue in interface CookieSource

setRequest

public void setRequest(HttpServletRequest request)

setResponse

public void setResponse(HttpServletResponse response)

setDefaultMaxAge

public void setDefaultMaxAge(int defaultMaxAge)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.