org.norther.tammi.spray.session
Interface AuthenticatedSession

All Superinterfaces:
HttpSession
All Known Subinterfaces:
SerializableSession
All Known Implementing Classes:
DefaultSession

public interface AuthenticatedSession
extends HttpSession

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

Version:
$Id: AuthenticatedSession.java,v 1.6 2009/09/28 15:08:29 cvsimp Exp $
Author:
Ilkka Priha

Nested Class Summary
static interface AuthenticatedSession.RemoteClient
          An interface to remote clients.
 
Method Summary
 void access()
          Updates the accessed time information for this session.
 Enumeration<String> getAttributeNames()
           
 AuthenticatedSession.RemoteClient getRemoteClient()
          Gets the remote client that is associated with this session.
 Principal getUserPrincipal()
          Gets the authenticated principal that is associated with this session.
 boolean isValid()
          Checks whether the session is valid.
 void registerRemoteClient(AuthenticatedSession.RemoteClient client)
          Registers the remote client that is associated with this session.
 HttpSession registerUserPrincipal(Principal principal, AuthenticatedSession.RemoteClient... client)
          Registers the authenticated principal that is associated with this session or a joined one.
 
Methods inherited from interface javax.servlet.http.HttpSession
getAttribute, getCreationTime, getId, getLastAccessedTime, getMaxInactiveInterval, getServletContext, getSessionContext, getValue, getValueNames, invalidate, isNew, putValue, removeAttribute, removeValue, setAttribute, setMaxInactiveInterval
 

Method Detail

getAttributeNames

Enumeration<String> getAttributeNames()
Specified by:
getAttributeNames in interface HttpSession

isValid

boolean isValid()
Checks whether the session is valid.

Returns:
true for a valid session.

getRemoteClient

AuthenticatedSession.RemoteClient getRemoteClient()
Gets the remote client that is associated with this session.

Returns:
the remote client or null if not registered.

registerRemoteClient

void registerRemoteClient(AuthenticatedSession.RemoteClient client)
Registers the remote client that is associated with this session.

Parameters:
client - the remote client.

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,
                                  AuthenticatedSession.RemoteClient... client)
Registers the authenticated principal that is associated with this session or a joined one.

Parameters:
principal - the authenticated principal.
client - remote client of the 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.