net.datacrow.core.security
Class SecurityCentre

java.lang.Object
  extended by net.datacrow.core.security.SecurityCentre

public class SecurityCentre
extends java.lang.Object

The security center is the access point for all security related information. Note that the users logged on to the web application are not represented by this class.

Author:
Robert Jan van der Waals

Method Summary
 void changePassword(User user, java.lang.String password)
          Changes the password for the specified user.
static SecurityCentre getInstance()
          Retrieves the sole instance of this class
 java.util.Collection<DcModule> getManagedModules()
           
 SecuredUser getUser()
          Retrieves the currently logged on user.
 void initialize()
           
 boolean isLoggedIn(SecuredUser su)
           
 SecuredUser login(java.lang.String username, java.lang.String password, boolean web)
           
 void logoff(User user)
           
 boolean unsecureLogin()
          Try to log in with the default user credentials (sa, empty password).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SecurityCentre getInstance()
Retrieves the sole instance of this class


getUser

public SecuredUser getUser()
Retrieves the currently logged on user.


changePassword

public void changePassword(User user,
                           java.lang.String password)
Changes the password for the specified user.

Parameters:
user -
password - The new password

unsecureLogin

public boolean unsecureLogin()
Try to log in with the default user credentials (sa, empty password).


isLoggedIn

public boolean isLoggedIn(SecuredUser su)

logoff

public void logoff(User user)

login

public SecuredUser login(java.lang.String username,
                         java.lang.String password,
                         boolean web)
                  throws SecurityException
Throws:
SecurityException

getManagedModules

public java.util.Collection<DcModule> getManagedModules()

initialize

public void initialize()