pt.digitalis.dif.controller.security.managers.impl
Class SessionManagerImpl

java.lang.Object
  extended by pt.digitalis.dif.controller.security.managers.impl.SessionManagerImpl
All Implemented Interfaces:
ISessionManager

public class SessionManagerImpl
extends Object
implements ISessionManager

DIF's default implementation of a session manager. REFACTOR: Should extract a superclass from this as a base implementation for this and other sessionManager impl's

Author:
Pedro Viegas pviegas@digitalis.pt
, Rodrigo Gonçalves rgoncalves@digitalis.pt
Created on:
Dec 11, 2007

Constructor Summary
SessionManagerImpl()
          Default constructor
 
Method Summary
 IDIFSession createSession(String sessionID)
          Creates a new session.
 Map<String,IPrivateDIFSession> getLoggedSessions()
           
 IDIFSession getSession(String sessionID)
          Gets a managed session
 boolean isSessionPresent(String sessionID)
          Checks if a given session is registered on the framework.
 IDIFSession logIn(String sessionID, String userID, String password)
          Performs the log in of a user with a given id on the framework.
 IDIFSession logOut(String sessionID)
          Performs the log out of a user with a given id on the framework.
 void removeSession(String sessionID)
          Removes a session
 String toString()
           
 boolean update(IDIFSession session)
          Updates an existent session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionManagerImpl

public SessionManagerImpl()
Default constructor

Method Detail

createSession

public IDIFSession createSession(String sessionID)
Description copied from interface: ISessionManager
Creates a new session. If existent returns the matching identifier existing session

Specified by:
createSession in interface ISessionManager
Parameters:
sessionID - the session id to create
Returns:
the created session
See Also:
ISessionManager.createSession(java.lang.String)

getLoggedSessions

public Map<String,IPrivateDIFSession> getLoggedSessions()
Returns:
the loggedSessions

getSession

public IDIFSession getSession(String sessionID)
Description copied from interface: ISessionManager
Gets a managed session

Specified by:
getSession in interface ISessionManager
Returns:
the session object or null if non-existent
See Also:
ISessionManager.getSession(java.lang.String)

isSessionPresent

public boolean isSessionPresent(String sessionID)
Description copied from interface: ISessionManager
Checks if a given session is registered on the framework.

Specified by:
isSessionPresent in interface ISessionManager
Parameters:
sessionID - the session id
Returns:
T if a session with this ID is present and active.
See Also:
ISessionManager.isSessionPresent(java.lang.String)

logIn

public IDIFSession logIn(String sessionID,
                         String userID,
                         String password)
                  throws AuthenticationManagerException
Description copied from interface: ISessionManager
Performs the log in of a user with a given id on the framework.

Specified by:
logIn in interface ISessionManager
Parameters:
sessionID - the session identifier
userID - the id of the user to log in
password - the password for the user
Returns:
the updated session object
Throws:
AuthenticationManagerException - if the authentication manager can't be accessed to validate the user's credentials
See Also:
ISessionManager.logIn(java.lang.String, java.lang.String, java.lang.String)

logOut

public IDIFSession logOut(String sessionID)
Description copied from interface: ISessionManager
Performs the log out of a user with a given id on the framework.

Specified by:
logOut in interface ISessionManager
Parameters:
sessionID - the session id to log out
Returns:
the updated session object
See Also:
ISessionManager.logOut(java.lang.String)

removeSession

public void removeSession(String sessionID)
Removes a session

Parameters:
sessionID -

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

update

public boolean update(IDIFSession session)
Description copied from interface: ISessionManager
Updates an existent session

Specified by:
update in interface ISessionManager
Parameters:
session - the session to update
Returns:
T if the session existed and was updated
See Also:
ISessionManager.update(pt.digitalis.dif.controller.interfaces.IDIFSession)


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.