Synergy Home Page

au.edu.swin.synergy.plugin.userdb
Class BSecurityManager

java.lang.Object
  |
  +--au.edu.swin.synergy.plugin.userdb.BSecurityManager

public class BSecurityManager
extends Object

This handles all security relating to passwords, privileges and owners. It also does the changing of passwords as this is a particular specialised functionality.

Author:
Tristan Austin

Constructor Summary
BSecurityManager(BPlugin dispatcher, Hashtable userDatabase, Hashtable groupDatabase)
          Creates a new security manager with the given users and groups to manage.
 
Method Summary
 void doAuthentication(BAuthUserCE e)
          This will determine whether the given credentials are valid by comparing them with the credentials in the user database.
protected  void doPasswordChange(BChangePasswordCE passwordEvent)
          This will take the change password event, find the user that is intended to be updated, compare the original password with the existing one and update the password if all is well.
protected  String doPasswordEncrypt(String plainPassword)
          This will take the given plain password and return the encrypted version of it
protected  boolean isAdministrator(BCommandEvent event)
          This will determine whether the user currently authenticated against this server has administrative privileges or not.
 boolean isLocal(BCommandEvent event)
          This will determine whether the given event originated locally or originated from a source other than the local machine.
 boolean isLoggedIn(BUser user)
          Indicates whether the given user is currently logged in
protected  boolean isOwner(BUser targetUser, int connectionID)
          This will determine whether the user currently authenticated against this server attempting to update the provided user object is infact the owner of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSecurityManager

public BSecurityManager(BPlugin dispatcher,
                        Hashtable userDatabase,
                        Hashtable groupDatabase)
Creates a new security manager with the given users and groups to manage.
Parameters:
userDatabase - The users of the system
groupDatabase - The groups in the system
Method Detail

doPasswordChange

protected void doPasswordChange(BChangePasswordCE passwordEvent)
This will take the change password event, find the user that is intended to be updated, compare the original password with the existing one and update the password if all is well. If not, it will indicate such in the completion object and set the reason why in the event itself.
Parameters:
passwordEvent - The event requesting the change Please complete the missing tags for doPasswordChange
Returns:
 
Pre Condition:
 
Post Condition:
 

doPasswordEncrypt

protected String doPasswordEncrypt(String plainPassword)
This will take the given plain password and return the encrypted version of it
Parameters:
plainPassword - The password to encrypt
Returns:
The encrypted version of the password Please complete the missing tags for doPasswordEncrypt
Pre Condition:
 
Post Condition:
 

doAuthentication

public void doAuthentication(BAuthUserCE e)
This will determine whether the given credentials are valid by comparing them with the credentials in the user database.
Parameters:
e - The authenticate user event

isAdministrator

protected boolean isAdministrator(BCommandEvent event)
This will determine whether the user currently authenticated against this server has administrative privileges or not.
Parameters:
targetUser - The user object being updated
Returns:
True if they are, false otherwise

isLocal

public boolean isLocal(BCommandEvent event)
This will determine whether the given event originated locally or originated from a source other than the local machine.
Parameters:
event - The event to check

isOwner

protected boolean isOwner(BUser targetUser,
                          int connectionID)
This will determine whether the user currently authenticated against this server attempting to update the provided user object is infact the owner of the object.
Parameters:
targetUser - The user object being updated
Returns:
True if they are, false otherwise

isLoggedIn

public boolean isLoggedIn(BUser user)
Indicates whether the given user is currently logged in
Parameters:
user - The user to check
Returns:
True if they are logged in, false otherwise

Synergy Home Page