org.norther.tammi.spray.session
Interface AuthenticatedSession

All Superinterfaces:
HttpSession
All Known Implementing Classes:
DefaultSession

public interface AuthenticatedSession
extends HttpSession

An interface to optionally authenticated sessions maintaining client data between requests.

Author:
Ilkka Priha

Method Summary
 void access()
          Updates the accessed time information for this session.
 Principal getUserPrincipal()
          Gets the authenticated principal that is associated with this session.
 boolean isValid()
          Checks whether the session is valid.
 HttpSession registerUserPrincipal(Principal principal)
          Registers the authenticated principal that is associated with this session or a joined one.
 
Methods inherited from interface javax.servlet.http.HttpSession
getAttribute, getAttributeNames, getCreationTime, getId, getLastAccessedTime, getMaxInactiveInterval, getServletContext, getSessionContext, getValue, getValueNames, invalidate, isNew, putValue, removeAttribute, removeValue, setAttribute, setMaxInactiveInterval
 

Method Detail

isValid

boolean isValid()
Checks whether the session is valid.

Returns:
true for a valid session.

getUserPrincipal

Principal getUserPrincipal()
Gets the authenticated principal that is associated with this session.

Returns:
the authenticated principal or null if not registered.

registerUserPrincipal

HttpSession registerUserPrincipal(Principal principal)
Registers the authenticated principal that is associated with this session or a joined one.

Parameters:
principal - the authenticated principal.
Returns:
the session to which the pricipal was registered.

access

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



Copyright © 2004 The Norther Organization. All rights reserved.