This is an implementation of PersistentSession that is useful for command
line usage. The code containing the controller should hand the controller
an instantiated SimplePersistentSession so that the state handlers can use
ControllerRequest.getSession() and simply use it without any cares in the
world.
Example Usage:
SimplePersistentSession session = new SimplePersistentSession();
Controller con = ConfigManager.getControllerFactory().getController(
controllerName);
ControllerRequest params = new ControllerRequest();
params.setUid(3);
params.setSession(mySession);
Retrieves a value of a cookie set on the client's system. It also
decrypts the value with the password you set up in your expresso-config.xml
file.
Parameters: attribName - the name of the cookie to retrieve java.lang.String the value of the cookie or null if the cookie doesn't exist.
Retrieves the persistent attributes table. Useful if you wish to actually
persisten these attributes across a command line 'session'
java.util.HashMap since: Expresso 5.1
Sets an attribute that is valid for the duration of the request.
Parameters: attribName - The name of the object you wish to set. Parameters: attribValue - the object you want to set.
setClientAttribute
public void setClientAttribute(String attribName, String attribValue)(Code)
Does nothing. In a command line environment, cookies don't make
sense.
Parameters: attribName - the name of the attribute to Parameters: attribValue - the value of the attribute to set.
setPersistentAttribute
public void setPersistentAttribute(String attribName, Object attribValue)(Code)
Saves an attribute to the actual session, rather than simply the response.
Use this for storing objects between requests, but only use it with care
since the extra memory used may bog down systems under high load.
Parameters: attribName - the name of the attribute to set Parameters: attribValue - a Serializable java object.
setPersistentAttributes
public void setPersistentAttributes(Map newAttributes)(Code)
Sets the persistent attributes that may have been saved across instances
of command line 'session'
Parameters: newAttributes - Map of attributes to set for the session.