Weaver 3.1.0a1-D1

com.oldlight.weaver.interpreter
Class WeaverSessionContextImpl

java.lang.Object
  extended bycom.oldlight.weaver.interpreter.WeaverSessionContextImpl
All Implemented Interfaces:
WeaverSessionContext

public class WeaverSessionContextImpl
extends Object
implements WeaverSessionContext

Representation of a browser session.

Author:
Paul Harvey

Field Summary
private  String SECURITY_CONTEXT
           
private  HttpSession session
          The actual servlet session object
 
Constructor Summary
WeaverSessionContextImpl(HttpSession session)
          Create a new WeaverSessionContext
 
Method Summary
 Object getAttribute(String name)
          Get a named session scoped attribute
 Map getAttributeMap()
          Get a map off session scoped attribute names to value.
 long getCreationTime()
          Gets the time that this session was created.
 long getLastAccessedTime()
          Get the last time that a request was made in this session.
 long getMaxInactiveInterval()
          Get the maximum time between requests before this session will time out.
 WeaverSecurityContext getSecurityContext()
          Gets the security context for this session
 String getSessionID()
          Get the ID of this session.
 void invalidate()
          Invalidates this session.
 void removeAttribute(String name)
          Remove a session scoped attribute.
 void setAttribute(String name, Object value)
          Set the value of a named session scoped attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECURITY_CONTEXT

private String SECURITY_CONTEXT

session

private HttpSession session
The actual servlet session object

Constructor Detail

WeaverSessionContextImpl

public WeaverSessionContextImpl(HttpSession session)
Create a new WeaverSessionContext

Parameters:
session - The HttpSession to wrap.
Method Detail

getSecurityContext

public WeaverSecurityContext getSecurityContext()
Gets the security context for this session

Specified by:
getSecurityContext in interface WeaverSessionContext
Returns:
The security context.

getAttribute

public Object getAttribute(String name)
Get a named session scoped attribute

Specified by:
getAttribute in interface WeaverSessionContext
Parameters:
name - The name of the attribute to retrieve.
Returns:
The named attribute, or null if the attribute cannot be found.

setAttribute

public void setAttribute(String name,
                         Object value)
Set the value of a named session scoped attribute.

Specified by:
setAttribute in interface WeaverSessionContext
Parameters:
name - The name of the attribute to set.
value - The value to set the attribute to.

removeAttribute

public void removeAttribute(String name)
Remove a session scoped attribute.

Specified by:
removeAttribute in interface WeaverSessionContext
Parameters:
name - The name of the attribute to remove.

getAttributeMap

public Map getAttributeMap()
Get a map off session scoped attribute names to value. (This method is used by the EL variable resolver).

Returns:
The requested map.

getLastAccessedTime

public long getLastAccessedTime()
Get the last time that a request was made in this session.

Specified by:
getLastAccessedTime in interface WeaverSessionContext
Returns:
The last time that a request was made in this session.

getSessionID

public String getSessionID()
Get the ID of this session.

Specified by:
getSessionID in interface WeaverSessionContext
Returns:
The requested session ID.

invalidate

public void invalidate()
Invalidates this session.

Specified by:
invalidate in interface WeaverSessionContext

getCreationTime

public long getCreationTime()
Gets the time that this session was created.

Specified by:
getCreationTime in interface WeaverSessionContext
Returns:
The session creation time.

getMaxInactiveInterval

public long getMaxInactiveInterval()
Get the maximum time between requests before this session will time out.

Specified by:
getMaxInactiveInterval in interface WeaverSessionContext
Returns:
The request time.

Copyright ©Paul Harvey