com.dyuproject.web
Class CookieSession

java.lang.Object
  extended by com.dyuproject.web.CookieSession
All Implemented Interfaces:
org.mortbay.util.ajax.JSON.Convertible

public class CookieSession
extends Object
implements org.mortbay.util.ajax.JSON.Convertible

Session attribues being stored on the client cookie.

Author:
David Yu

Constructor Summary
CookieSession()
           
 
Method Summary
 void fromJSON(Map map)
           
 Object getAttribute(String name)
           
 Set<String> getAttributeNames()
           
 Map<String,Object> getAttributes()
           
 Map<String,Object> getAttrs()
           
 long getTimeCreated()
           
 long getTimeUpdated()
           
 boolean isPersisted()
           
 boolean removeAttribute(String name)
           
 void setAttribute(String name, Object value)
           
 void toJSON(org.mortbay.util.ajax.JSON.Output out)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CookieSession

public CookieSession()
Method Detail

setAttribute

public void setAttribute(String name,
                         Object value)
Parameters:
name -
value - The value should be a Map, Collection, String, Number(Long or Double) or JSON.Convertible. You will get a ClassCastException from getAttribute(name) if the value was not any of the specified objects. The value could also be an array of the specified objects.

getAttribute

public Object getAttribute(String name)

getAttributeNames

public Set<String> getAttributeNames()

getAttributes

public Map<String,Object> getAttributes()

removeAttribute

public boolean removeAttribute(String name)

getAttrs

public Map<String,Object> getAttrs()

getTimeCreated

public long getTimeCreated()

getTimeUpdated

public long getTimeUpdated()

isPersisted

public boolean isPersisted()

fromJSON

public void fromJSON(Map map)
Specified by:
fromJSON in interface org.mortbay.util.ajax.JSON.Convertible

toJSON

public void toJSON(org.mortbay.util.ajax.JSON.Output out)
Specified by:
toJSON in interface org.mortbay.util.ajax.JSON.Convertible

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.