The interface PasswordRules provides functionality to
determine and get password rules.
Please also refer to the Javadoc of org.eclipse.stardust.engine.api.runtime.PasswordRules for detailed information on the according methods.
To determine the period a password is valid, use the method
void setExpirationTime(int days)
The method
int getExpirationTime()
returns the number of days a password is valid.
The following password strength rules can be set and get by using the according methods:
void setMinimalPasswordLength(int length) / int getMinimalPasswordLength()
void setLetters(int length) / int getLetters()
void setDigits(int length) / int getDigits()
void setPunctuation(int length) / int getPunctuation()
void setMixedCase(int length) / int getMixedCase()
void setDifferentCharacters(int length) / int getDifferentCharacters()
The method
void setPasswordTracking(int number)
sets the number of old passwords to store. If the value is greater than 0, the password tracking is enabled and a number of previous passwords is stored. The new password should not have the same value as one of the stored previous passwords.
To check if password tracking is enabled, use the method
int getPasswordTracking()
It return the number of passwords to track.
You can set a flag for using unique passwords, so that new passwords should be compared with previous passwords, via the following method:
void setUniquePassword(boolean uniquePassword);
To check, if this flag is set, use:
boolean isUniquePassword();
Via the method
void setNotificationMails(int days)
you can determine that a notification mail should be send
out before the password expires. The parameter is the number of days
the notification mail should be sent before the password
expires. In case no notification mail should be sent, set the
parameter to 0.
Use the method
int getNotificationMails();
to check if notification mails should be send. The return value is the number of days the mail should go out before the password expires. If the value is 0, no notification should be sent.
To force a password change, use the method
void setForcePasswordChange(boolean forcePasswordChange);
You can check if the force password change flag is set via:
boolean isForcePasswordChange();
To determine if all password rules should be validated, use the method:
void setStrongPassword(boolean strongPassword);
To check if the strong password is set, use:
boolean isStrongPassword();
To set the number of days a user ID will be disabled after the password expired, use the method:
void setDisableUserTime(int days)
The method
int getDisableUserTime()
returns the number of days a user ID will be disabled after the password expired.