|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.session.SimplePersistentSession
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);
PersistentSession,
Serialized Form| Constructor Summary | |
SimplePersistentSession()
Creates new SimplePersistentSession |
|
| Method Summary | |
Object |
getAttribute(String attribName)
Retrieves the object from the request context. |
Enumeration |
getAttributeNames()
Retrieves all attribute names in the request context. |
String |
getClientAttribute(String attribName)
Retrieves a value of a cookie set on the client's system. |
Enumeration |
getPeristentAttributeNames()
Retrieves all attribute names from the session context. |
Object |
getPersistentAttribute(String attribName)
Retrieves the object from the session context. |
Map |
getPersistentAttributes()
Retrieves the persistent attributes table. |
void |
invalidate()
Clear out the session. |
void |
removeAttribute(String attribName)
Clears an attribute from the request context |
void |
removePersistentAttribute(String attribName)
Clears an attribute from the session context |
void |
setAttribute(String attribName,
Object attribValue)
Sets an attribute that is valid for the duration of the request. |
void |
setClientAttribute(String attribName,
String attribValue)
Does nothing. |
void |
setPersistentAttribute(String attribName,
Object attribValue)
Saves an attribute to the actual session, rather than simply the response. |
void |
setPersistentAttributes(Map newAttributes)
Sets the persistent attributes that may have been saved across instances of command line 'session' |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimplePersistentSession()
| Method Detail |
public void setAttribute(String attribName,
Object attribValue)
setAttribute in interface PersistentSessionattribName - The name of the object you wish to set.attribValue - the object you want to set.public Object getAttribute(String attribName)
getAttribute in interface PersistentSessionattribName - the name of the object to retrieve
public Enumeration getAttributeNames()
getAttributeNames in interface PersistentSession
public void setClientAttribute(String attribName,
String attribValue)
setClientAttribute in interface PersistentSessionattribName - the name of the attribute toattribValue - the value of the attribute to set.public String getClientAttribute(String attribName)
expresso-config.xml
file.
getClientAttribute in interface PersistentSessionattribName - the name of the cookie to retrieve
public Map getPersistentAttributes()
public void setPersistentAttributes(Map newAttributes)
newAttributes - Map of attributes to set for the session.public Enumeration getPeristentAttributeNames()
getPeristentAttributeNames in interface PersistentSession
public void setPersistentAttribute(String attribName,
Object attribValue)
setPersistentAttribute in interface PersistentSessionattribName - the name of the attribute to setattribValue - a Serializable java object.Serializablepublic Object getPersistentAttribute(String attribName)
getPersistentAttribute in interface PersistentSessionattribName - the name of the object to retrieve
public void invalidate()
invalidate in interface PersistentSessionpublic void removeAttribute(String attribName)
removeAttribute in interface PersistentSessionattribName - the name of the attribute to remove.public void removePersistentAttribute(String attribName)
removePersistentAttribute in interface PersistentSessionattribName - the name of the attribute to remove.
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||