    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.jigsaw.servlet.JigsawHttpSession

    java.lang.Object
       |
       +----org.w3c.jigsaw.servlet.JigsawHttpSession

public class JigsawHttpSession
extends Object
implements HttpSession

##

JigsawHttpSession(JigsawHttpSessionContext, Cookie)

##

getCookie()
getCreationTime()
  Returns the time at which this session representation was created, in milliseconds since midnight, January 1, 1970 UTC.
getId()
  Returns the identifier assigned to this session.
getLastAccessedTime()
  Returns the last time the client sent a request carrying the identifier assigned to the session.
getSessionContext()
  Returns the context in which this session is bound.
getValue(String)
  Returns the object bound to the given name in the session's application layer data.
getValueNames()
  Returns an array of the names of all the application layer data objects bound into the session.
invalidate()
  Causes this representation of the session to be invalidated and removed from its context.
isNew()
  A session is considered to be "new" if it has been created by the server, but the client has not yet acknowledged joining the session.
isValid()
putValue(String, Object)
  Binds the specified object into the session's application layer data with the given name.
removeValue(String)
  Removes the object bound to the given name in the session's application layer data.
setLastAccessedTime()
setNoMoreNew()
valueBound(HttpSessionBindingListener, String)
valueUnbound(HttpSessionBindingListener, String)

##

JigsawHttpSession

     public JigsawHttpSession(JigsawHttpSessionContext context,
                              Cookie cookie)

##

getId

     public String getId()

  Returns the identifier assigned to this session. An HttpSession's identifier is a unique string that is created and maintained by HttpSessionContext.

  Returns:
    the identifier assigned to this session
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

getSessionContext

     public HttpSessionContext getSessionContext()

  Returns the context in which this session is bound.

  Returns:
    the context in which this session is bound.
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

getCreationTime

     public long getCreationTime()

  Returns the time at which this session representation was created, in milliseconds since midnight, January 1, 1970 UTC.

  Returns:
    the time when the session was created
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

getLastAccessedTime

     public long getLastAccessedTime()

  Returns the last time the client sent a request carrying the identifier assigned to the session. Time is expressed as milliseconds since midnight, January 1, 1970 UTC. Application level operations, such as getting or setting a value associated with the session, does not affect the access time.

  Returns:
    the last time the client sent a request carrying the identifier assigned to the session
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

setLastAccessedTime

     protected void setLastAccessedTime()

invalidate

     public void invalidate()

  Causes this representation of the session to be invalidated and removed from its context.

  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

getValue

     public Object getValue(String name)

  Returns the object bound to the given name in the session's application layer data. Returns null if there is no such binding.

  Parameters:
    name - - the name of the binding to find
  Returns:
    the value bound to that name, or null if the binding does not exist.
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

putValue

     public void putValue(String name,
                          Object value)

  Binds the specified object into the session's application layer data with the given name. Any existing binding with the same name is replaced. New (or existing) values that implement the HttpSessionBindingListener interface will call its valueBound() method.

  Parameters:
    name - - the name to which the data object will be bound. This parameter cannot be null.
    value - - the data object to be bound. This parameter cannot be null.
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

removeValue

     public void removeValue(String name)

  Removes the object bound to the given name in the session's application layer data. Does nothing if there is no object bound to the given name. The value that implements the HttpSessionBindingListener interface will call its valueUnbound() method.

  Parameters:
    name - - the name of the object to remove
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

valueBound

     protected void valueBound(HttpSessionBindingListener value,
                               String name)

valueUnbound

     protected void valueUnbound(HttpSessionBindingListener value,
                                 String name)

getValueNames

     public String[] getValueNames()

  Returns an array of the names of all the application layer data objects bound into the session. For example, if you want to delete all of the data objects bound into the session, use this method to obtain their names.

  Returns:
    an array containing the names of all of the application layer data objects bound into the session
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

isNew

     public boolean isNew()

  A session is considered to be "new" if it has been created by the server, but the client has not yet acknowledged joining the session. For example, if the server supported only cookie-based sessions and the client had completely disabled the use of cookies, then calls to HttpServletRequest.getSession() would always return "new" sessions.

  Returns:
    true if the session has been created by the server but the client has not yet acknowledged joining the session; false otherwise
  Throws: IllegalStateException
    if an attempt is made to access session data after the session has been invalidated

setNoMoreNew

     protected void setNoMoreNew()

isValid

     protected boolean isValid()

getCookie

     protected Cookie getCookie()

    All Packages  Class Hierarchy  This Package  Previous  Next  Index