com.bits.mainserver
Class Security

java.lang.Object
  extended by com.bits.mainserver.Security
All Implemented Interfaces:
ISecurityServer

public class Security
extends java.lang.Object
implements ISecurityServer

provides the login and validation of user thru security policies

Author:
sophirha

Constructor Summary
Security()
           
 
Method Summary
 UserInfo login(java.lang.String userID, java.lang.String password)
          performs login attempt and gets the details for the user if successful
 boolean validatePassword(UserInfo ui, java.lang.String oldPassword, java.lang.String newPassword, java.lang.String newPassword2)
          checks password for change:old should match current password, the 2 new password should be equal, the new should be different than the old, and the new password should contain at least 2 letters and at least 2 digits, also the new password length should be at least 6 characters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Security

public Security()
Method Detail

login

public UserInfo login(java.lang.String userID,
                      java.lang.String password)
performs login attempt and gets the details for the user if successful

Specified by:
login in interface ISecurityServer
Parameters:
username - for login
the - password
Returns:
the object from the db with all details, null if login failed

validatePassword

public boolean validatePassword(UserInfo ui,
                                java.lang.String oldPassword,
                                java.lang.String newPassword,
                                java.lang.String newPassword2)
                         throws java.lang.Exception
checks password for change:old should match current password, the 2 new password should be equal, the new should be different than the old, and the new password should contain at least 2 letters and at least 2 digits, also the new password length should be at least 6 characters

Specified by:
validatePassword in interface ISecurityServer
Parameters:
user - to validate
current - password
new - password first type
new - password second type
Returns:
true if all checks are passed, false otherwise
Throws:
java.lang.Exception