org.glassfish.grizzly.http.server
Class Session

java.lang.Object
  extended by org.glassfish.grizzly.http.server.Session

public class Session
extends java.lang.Object

Simple session object.

Author:
Jeanfrancois Arcand

Constructor Summary
Session()
           
Session(java.lang.String requestedSessionId)
          Create a new session using a session identifier
 
Method Summary
 java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Object> attributes()
          Return a ConcurrentHashMap of attributes.
 java.lang.Object getAttribute(java.lang.String key)
          Return an attribute.
 java.lang.String getIdInternal()
          Return the session identifier for this session.
 long getSessionTimeout()
          Return a long representing the maximum idle time a session can be.
 long getTimestamp()
           
 boolean isValid()
          Is the current Session valid?
 java.lang.Object removeAttribute(java.lang.String key)
          Remove an attribute.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Add an attribute to this session.
 void setIdInternal(java.lang.String requestedSessionId)
          Return the session identifier for this session.
 void setSessionTimeout(long sessionTimeout)
          Set a long representing the maximum idle time a session can be.
 void setTimestamp(long timestamp)
          Set the timestamp when this session has been created.
 void setValid(boolean isValid)
          Set this object as validated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session()

Session

public Session(java.lang.String requestedSessionId)
Create a new session using a session identifier

Parameters:
requestedSessionId - session identifier
Method Detail

isValid

public boolean isValid()
Is the current Session valid?

Returns:
true if valid.

setValid

public void setValid(boolean isValid)
Set this object as validated.

Parameters:
isValid -

getIdInternal

public java.lang.String getIdInternal()
Return the session identifier for this session.


setIdInternal

public void setIdInternal(java.lang.String requestedSessionId)
Return the session identifier for this session.


setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Add an attribute to this session.

Parameters:
key -
value -

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Return an attribute.

Parameters:
key -
Returns:
an attribute

removeAttribute

public java.lang.Object removeAttribute(java.lang.String key)
Remove an attribute.

Parameters:
key -
Returns:
true if successful.

attributes

public java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Object> attributes()
Return a ConcurrentHashMap of attributes.

Returns:
the attributes associated with this session.

getSessionTimeout

public long getSessionTimeout()
Return a long representing the maximum idle time a session can be.

Returns:
a long representing the maximum idle time a session can be.

setSessionTimeout

public void setSessionTimeout(long sessionTimeout)
Set a long representing the maximum idle time a session can be.

Parameters:
sessionTimeout - a long representing the maximum idle time a session can be.

getTimestamp

public long getTimestamp()
Returns:
the timestamp when this session has been created.

setTimestamp

public void setTimestamp(long timestamp)
Set the timestamp when this session has been created.

Parameters:
timestamp - a long representing when the session has been created.


Copyright © 2011 Oracle Corpration. All Rights Reserved.