org.apache.tapestry.web
Interface WebSession

All Superinterfaces:
AttributeHolder, Describable
All Known Implementing Classes:
PortletWebSession, ServletWebSession

public interface WebSession
extends AttributeHolder, Describable

Primarily concerned with maintaining server-side state as attributes.

Since:
4.0
Author:
Howard M. Lewis Ship

Method Summary
 long getCreationTime()
          Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
 String getId()
          Returns a unique string identifier used to identify the session.
 long getLastAccessedTime()
          Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container recieved the request.
 int getMaxInactiveInterval()
          Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses.
 void invalidate()
          Invalidates this session then unbinds any objects bound to it.
 boolean isNew()
          Returns true if the client does not yet know about the session or if the client chooses not to join the session.
 void setMaxInactiveInterval(int interval)
          Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.
 
Methods inherited from interface org.apache.tapestry.web.AttributeHolder
getAttribute, getAttributeNames, setAttribute
 
Methods inherited from interface org.apache.tapestry.describe.Describable
describeTo
 

Method Detail

getId

String getId()
Returns a unique string identifier used to identify the session. This value is provided by the container, and is typically incorporated into URLs, or stored as a HTTP cookie.

See Also:
.

isNew

boolean isNew()
Returns true if the client does not yet know about the session or if the client chooses not to join the session.


invalidate

void invalidate()
Invalidates this session then unbinds any objects bound to it.

Throws:
IllegalStateException - if the session is already invalidated.

getCreationTime

long getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.

Returns:
a long specifying when this session was created, expressed in milliseconds since 1/1/1970 GMT

getLastAccessedTime

long getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container recieved the request.

Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.

Returns:
a long representing the last time the client sent a request associated with this session, expressed in milliseconds since 1/1/1970 GMT

getMaxInactiveInterval

int getMaxInactiveInterval()
Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.

Returns:
an integer specifying the number of seconds this session remains open between client requests

setMaxInactiveInterval

void setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.

Parameters:
interval - - An integer specifying the number of seconds


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.