com.atlassian.jira.plugin.user
Class PasswordPolicyManagerImpl

java.lang.Object
  extended by com.atlassian.jira.plugin.user.PasswordPolicyManagerImpl
All Implemented Interfaces:
PasswordPolicyManager

public class PasswordPolicyManagerImpl
extends Object
implements PasswordPolicyManager

Since:
v6.1

Constructor Summary
PasswordPolicyManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.plugin.event.PluginEventManager pluginEventManager)
           
 
Method Summary
 Collection<WebErrorMessage> checkPolicy(ApplicationUser user, String oldPassword, String newPassword)
          Checks the password policies against a proposed password change for an existing user.
 Collection<WebErrorMessage> checkPolicy(String username, String displayName, String emailAddress, String newPassword)
          Checks the password policies for a proposed new user.
 List<String> getPolicyDescription(boolean hasOldPassword)
          Returns a list of rules that passwords must follow to satisfy all password policies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordPolicyManagerImpl

public PasswordPolicyManagerImpl(com.atlassian.plugin.PluginAccessor pluginAccessor,
                                 com.atlassian.plugin.event.PluginEventManager pluginEventManager)
Method Detail

checkPolicy

@Nonnull
public Collection<WebErrorMessage> checkPolicy(@Nonnull
                                                       ApplicationUser user,
                                                       @Nullable
                                                       String oldPassword,
                                                       @Nonnull
                                                       String newPassword)
Description copied from interface: PasswordPolicyManager
Checks the password policies against a proposed password change for an existing user.

Specified by:
checkPolicy in interface PasswordPolicyManager
Parameters:
user - the user whose password would be changed; must not be null
oldPassword - the user's current password, if known; may be null, in which case any checks that would be made against it will be skipped
newPassword - the proposed new password
Returns:
list containing all plugin provided WebErrorMessage; never null

checkPolicy

@Nonnull
public Collection<WebErrorMessage> checkPolicy(@Nonnull
                                                       String username,
                                                       @Nullable
                                                       String displayName,
                                                       @Nullable
                                                       String emailAddress,
                                                       @Nonnull
                                                       String newPassword)
Description copied from interface: PasswordPolicyManager
Checks the password policies for a proposed new user.

Specified by:
checkPolicy in interface PasswordPolicyManager
Parameters:
username - the username that the new user would have; must not be null
displayName - the display name that the new user would have; may be null
emailAddress - the email address that the new user would have; may be null
newPassword - the proposed new password; must not be null
Returns:
list containing all plugin provided WebErrorMessage; never null

getPolicyDescription

@Nonnull
public List<String> getPolicyDescription(boolean hasOldPassword)
Description copied from interface: PasswordPolicyManager
Returns a list of rules that passwords must follow to satisfy all password policies.

Specified by:
getPolicyDescription in interface PasswordPolicyManager
Parameters:
hasOldPassword - whether or not the request concerns the rules when the old password is provided. This is true for the case where an existing user is changing his/her own password, but not when an administrator is changing another user's password or a new account is getting created. The rule list should probably be different for these cases. For example, it does not make sense to tell an administrator that the new password can not be similar to the old password when the administrator does not even know what the old password was. Nor does it make sense to say this to a new user, for whom the whole idea is completely irrelevant.
Returns:
a list of rules that passwords must follow to satisfy all policies.


Copyright © 2002-2014 Atlassian. All Rights Reserved.