org.inria.ns.reflex.modules.web
Class CookieAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.modules.web.CookieAction
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory

public class CookieAction
extends AbstractAction

The <web:cookie> element creates a new #web:x-cookie item and stores it in the current context.

A #web:x-cookie item have to be stored within the attributes of the $web:response.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
CookieAction(Node node, AbstractAction parent, Expression name, Expression value, Expression comment, Expression domain, Expression path, Expression maxAge, Expression isSecure, Expression version)
          Creates a new instance of CookieAction.
 
Method Summary
 void runAction(DataSet dataSet)
          Return the computed value of the property, an XCookie.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          XML unmarshaller for CookieAction.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CookieAction

public CookieAction(Node node,
                    AbstractAction parent,
                    Expression name,
                    Expression value,
                    Expression comment,
                    Expression domain,
                    Expression path,
                    Expression maxAge,
                    Expression isSecure,
                    Expression version)
Creates a new instance of CookieAction.

Parameters:
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
name - Specifies the name of the cookie.
value - Specifies the value of the cookie.
comment - Specifies a comment that describes a cookie's purpose.
domain - Specifies the domain within which this cookie should be presented.
path - Specifies a path for the cookie to which the client should return the cookie.
maxAge - Sets the maximum age of the cookie in seconds. A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.
isSecure - Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
version - the version of the cookie protocol this cookie complies with. Version 0 complies with the original Netscape cookie specification. Version 1 complies with RFC 2109.
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException
XML unmarshaller for CookieAction.

Parameters:
parent - The action depending from
element - The XML element to unmarshall.
Returns:
The CookieAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Return the computed value of the property, an XCookie.

Overrides:
runAction in class AbstractAction
Parameters:
dataSet - The set of datas used when the action is running.
Throws:
ExecutionException - If the action can't be performed.
XPathException
See Also:
AbstractAction.runAction(org.inria.ns.reflex.processor.DataSet)