palio.modules
Class UserSecurity

java.lang.Object
  extended by palio.modules.core.Module
      extended by palio.modules.UserSecurity
All Implemented Interfaces:
palio.modules.core.CurrentModuleDataKeys

public class UserSecurity
extends palio.modules.core.Module

Version:
1.0.0
Author:
Tomasz Jarocki

Field Summary
static java.lang.String DEFAULT_CONFIGURATION_OBJECT_CODE
           
static palio.modules.usersecurity.UserSecurityPasswordRule DEFAULT_MODULE_PASSWORD_RULE
           
 
Fields inherited from interface palio.modules.core.CurrentModuleDataKeys
DESIGNER_ACTIONS_BUFFER, HTML_FORM_BUILDER, HTML_MAP_BUILDER, HTML_MENU_BUILDER, HTML_TOOLTIPS_BUFFER, ITEXT_DOCUMENT, MAIL_MESSAGE, XLS_DOCUMENT, XML_DOCUMENT
 
Constructor Summary
UserSecurity(palio.Instance instance, java.util.Properties parameters)
           
 
Method Summary
 java.lang.String generatePasswordForRole(java.lang.Long roleId)
          Generates password that will satisfy constraints for given role.
 java.lang.String generatePasswordForRoles(java.util.Set<java.lang.Long> roleIds)
          Generates password that will satisfy constraints for all given roles.
 java.lang.String generatePasswordForUser(java.lang.Long userId)
          Generates password that will satisfy constraints for all user roles.
 java.lang.String generatePasswordForUser(java.lang.Long userId, java.lang.String connectorName)
          Generates password that will satisfy constraints for all user roles.
 java.lang.String generatePasswordForUser(palio.pelements.PUser user)
          Generates password that will satisfy constraints for all user roles.
 java.lang.String getConfigurationObjectCode()
          When data source is not xmlObject will throw UserSecurityException.
 java.lang.String getVersion()
          Returns the module version
 void reloadConfig()
          Reloads configuration from defined in instance source.
 java.lang.Boolean testRolePassword(java.lang.String password, java.lang.Long roleId)
          Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.
 java.lang.Boolean testRolesPassword(java.lang.String password, java.util.Set<java.lang.Long> roleIds)
          Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.
 java.lang.Boolean testUserPassword(java.lang.String password, java.lang.Long userId)
          Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.
 java.lang.Boolean testUserPassword(java.lang.String password, java.lang.Long userId, java.lang.String connectorName)
          Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.
 java.lang.Boolean testUserPassword(java.lang.String password, palio.pelements.PUser user)
          Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.
 java.lang.Boolean testUserPasswordAge(java.lang.Long userId)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(java.lang.Long userId, java.util.Date currentDate)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(java.lang.Long userId, java.util.Date currentDate, java.lang.String connectorName)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(java.lang.Long userId, java.lang.String connectorName)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(palio.pelements.PUser user)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(palio.pelements.PUser user, java.util.Date currentDate)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(java.lang.String userName)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(java.lang.String userName, java.util.Date currentDate)
          Tests password age, checks if password is older than days from max value in age constraint.
 java.lang.Boolean testUserPasswordAge(java.lang.String userName, java.util.Date currentDate, java.lang.String connectorName)
          Tests password age, checks if password is older than days from max value in age constraint.
 
Methods inherited from class palio.modules.core.Module
getConfigParam, getDescription, getModuleTranslation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MODULE_PASSWORD_RULE

public static palio.modules.usersecurity.UserSecurityPasswordRule DEFAULT_MODULE_PASSWORD_RULE

DEFAULT_CONFIGURATION_OBJECT_CODE

public static final java.lang.String DEFAULT_CONFIGURATION_OBJECT_CODE
See Also:
Constant Field Values
Constructor Detail

UserSecurity

public UserSecurity(palio.Instance instance,
                    java.util.Properties parameters)
Method Detail

getVersion

public java.lang.String getVersion()
Description copied from class: palio.modules.core.Module
Returns the module version

Specified by:
getVersion in class palio.modules.core.Module

reloadConfig

public void reloadConfig()
Reloads configuration from defined in instance source.


getConfigurationObjectCode

public java.lang.String getConfigurationObjectCode()
                                            throws palio.modules.usersecurity.UserSecurityException
When data source is not xmlObject will throw UserSecurityException.

Returns:
Object code where xml with configuration is.
Throws:
palio.modules.usersecurity.UserSecurityException

testRolesPassword

public java.lang.Boolean testRolesPassword(java.lang.String password,
                                           java.util.Set<java.lang.Long> roleIds)
                                    throws palio.modules.usersecurity.UserSecurityException
Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.

Parameters:
password - tested password
roleIds - roles for which rules will be tested
Returns:
true if password passed tests
Throws:
palio.modules.usersecurity.UserSecurityException

testRolePassword

public java.lang.Boolean testRolePassword(java.lang.String password,
                                          java.lang.Long roleId)
                                   throws palio.modules.usersecurity.UserSecurityException
Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.

Parameters:
password - tested password
roleId - roles for which rules will be tested
Returns:
true if password passed tests
Throws:
palio.modules.usersecurity.UserSecurityException

testUserPassword

public java.lang.Boolean testUserPassword(java.lang.String password,
                                          palio.pelements.PUser user)
                                   throws palio.modules.usersecurity.UserSecurityException
Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.

Parameters:
password - tested password
user - jPalio user from which rules will be got and tested
Returns:
true if password passed tests
Throws:
palio.modules.usersecurity.UserSecurityException

testUserPassword

public java.lang.Boolean testUserPassword(java.lang.String password,
                                          java.lang.Long userId)
                                   throws palio.modules.usersecurity.UserSecurityException,
                                          palio.PalioException
Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.

Parameters:
password - tested password
userId - jPalio user id from which rules will be got and tested
Returns:
true if password passed tests
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPassword

public java.lang.Boolean testUserPassword(java.lang.String password,
                                          java.lang.Long userId,
                                          java.lang.String connectorName)
                                   throws palio.modules.usersecurity.UserSecurityException,
                                          palio.PalioException
Tests all matching rules, note that if one role is defined in multiple rules, it can cause conflict rules.

Parameters:
password - tested password
userId - jPalio user id from which rules will be got and tested
Returns:
true if password passed tests
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(palio.pelements.PUser user,
                                             java.util.Date currentDate)
                                      throws palio.modules.usersecurity.UserSecurityException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
user - jPalio user
currentDate - date for which password will be tested
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(palio.pelements.PUser user)
                                      throws palio.modules.usersecurity.UserSecurityException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
user - jPalio user
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.Long userId,
                                             java.util.Date currentDate)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userId - jPalio user id
currentDate - date for which password will be tested
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.Long userId,
                                             java.util.Date currentDate,
                                             java.lang.String connectorName)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userId - jPalio user id
currentDate - date for which password will be tested
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.Long userId)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userId - jPalio user id
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.Long userId,
                                             java.lang.String connectorName)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userId - jPalio user id
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.String userName,
                                             java.util.Date currentDate)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userName - jPalio user login
currentDate - date for which password will be tested
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.String userName,
                                             java.util.Date currentDate,
                                             java.lang.String connectorName)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userName - jPalio user login
currentDate - date for which password will be tested
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

testUserPasswordAge

public java.lang.Boolean testUserPasswordAge(java.lang.String userName)
                                      throws palio.PalioException
Tests password age, checks if password is older than days from max value in age constraint.

Parameters:
userName - jPalio user login
Returns:
true if password is up to date
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

generatePasswordForRoles

public java.lang.String generatePasswordForRoles(java.util.Set<java.lang.Long> roleIds)
                                          throws palio.modules.usersecurity.UserSecurityException
Generates password that will satisfy constraints for all given roles. Note that constraints for roles cannot be conflicted (ex. letters max 5 and lowercase min 6)

Parameters:
roleIds - roles for which rules for which constraints password must pass
Returns:
generated password
Throws:
palio.modules.usersecurity.UserSecurityException

generatePasswordForRole

public java.lang.String generatePasswordForRole(java.lang.Long roleId)
                                         throws palio.modules.usersecurity.UserSecurityException
Generates password that will satisfy constraints for given role. Note that constraints for roles cannot be conflicted (ex. letters max 5 and lowercase min 6)

Parameters:
roleId - role for which rule for which constraints password must pass
Returns:
generated password
Throws:
palio.modules.usersecurity.UserSecurityException

generatePasswordForUser

public java.lang.String generatePasswordForUser(palio.pelements.PUser user)
                                         throws palio.PalioException
Generates password that will satisfy constraints for all user roles. Note that constraints for roles cannot be conflicted (ex. letters max 5 and lowercase min 6)

Parameters:
user - user for which password is generated
Returns:
generated password
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

generatePasswordForUser

public java.lang.String generatePasswordForUser(java.lang.Long userId)
                                         throws palio.PalioException
Generates password that will satisfy constraints for all user roles. Note that constraints for roles cannot be conflicted (ex. letters max 5 and lowercase min 6)

Parameters:
userId - user id for which password is generated
Returns:
generated password
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException

generatePasswordForUser

public java.lang.String generatePasswordForUser(java.lang.Long userId,
                                                java.lang.String connectorName)
                                         throws palio.PalioException
Generates password that will satisfy constraints for all user roles. Note that constraints for roles cannot be conflicted (ex. letters max 5 and lowercase min 6)

Parameters:
userId - user id for which password is generated
Returns:
generated password
Throws:
palio.modules.usersecurity.UserSecurityException
palio.PalioException