org.apache.catalina
Interface Session


public interface Session

A Session is the Catalina-internal facade for an HttpSession that is used to maintain state information between requests for a particular user of a web application.

Version:
$Revision: 1.2 $ $Date: 2000/10/18 18:15:49 $
Author:
Craig R. McClanahan

Method Summary
 void access()
          Update the accessed time information for this session.
 void expire()
          Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
 java.lang.String getAuthType()
          Return the authentication type used to authenticate our cached Principal, if any.
 long getCreationTime()
          Return the creation time for this session.
 java.lang.String getId()
          Return the session identifier for this session.
 java.lang.String getInfo()
          Return descriptive information about this Session implementation and the corresponding version number, in the format <description>/<version>.
 long getLastAccessedTime()
          Return the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT.
 Manager getManager()
          Return the Manager within which this Session is valid.
 int getMaxInactiveInterval()
          Return the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.
 java.security.Principal getPrincipal()
          Return the authenticated Principal that is associated with this Session.
 javax.servlet.http.HttpSession getSession()
          Return the HttpSession for which this object is the facade.
 boolean isValid()
          Return the isValid flag for this session.
 void recycle()
          Release all object references, and initialize instance variables, in preparation for reuse of this object.
 void setAuthType(java.lang.String authType)
          Set the authentication type used to authenticate our cached Principal, if any.
 void setCreationTime(long time)
          Set the creation time for this session.
 void setId(java.lang.String id)
          Set the session identifier for this session.
 void setManager(Manager manager)
          Set the Manager within which this Session is valid.
 void setMaxInactiveInterval(int interval)
          Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.
 void setPrincipal(java.security.Principal principal)
          Set the authenticated Principal that is associated with this Session.
 

Method Detail

getAuthType

public java.lang.String getAuthType()
Return the authentication type used to authenticate our cached Principal, if any.

setAuthType

public void setAuthType(java.lang.String authType)
Set the authentication type used to authenticate our cached Principal, if any.
Parameters:
authType - The new cached authentication type

getCreationTime

public long getCreationTime()
Return the creation time for this session.

setCreationTime

public void setCreationTime(long time)
Set the creation time for this session. This method is called by the Manager when an existing Session instance is reused.
Parameters:
time - The new creation time

getId

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

setId

public void setId(java.lang.String id)
Set the session identifier for this session.
Parameters:
id - The new session identifier

getInfo

public java.lang.String getInfo()
Return descriptive information about this Session implementation and the corresponding version number, in the format <description>/<version>.

getLastAccessedTime

public long getLastAccessedTime()
Return the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.

getManager

public Manager getManager()
Return the Manager within which this Session is valid.

setManager

public void setManager(Manager manager)
Set the Manager within which this Session is valid.
Parameters:
manager - The new Manager

getMaxInactiveInterval

public int getMaxInactiveInterval()
Return the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. A negative time indicates that the session should never time out.

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)
Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. A negative time indicates that the session should never time out.
Parameters:
interval - The new maximum interval

getPrincipal

public java.security.Principal getPrincipal()
Return the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request. If there is no current associated Principal, return null.

setPrincipal

public void setPrincipal(java.security.Principal principal)
Set the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request.
Parameters:
principal - The new Principal, or null if none

getSession

public javax.servlet.http.HttpSession getSession()
Return the HttpSession for which this object is the facade.

access

public void access()
Update the accessed time information for this session. This method should be called by the context when a request comes in for a particular session, even if the application does not reference it.

expire

public void expire()
Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.

isValid

public boolean isValid()
Return the isValid flag for this session.

recycle

public void recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object.


Copyright © 2000 Apache Software Foundation. All Rights Reserved.