org.keel.services.password.jpassgen
Class DefaultPasswordGenerator
java.lang.Object
org.keel.services.password.jpassgen.DefaultPasswordGenerator
- All Implemented Interfaces:
- Configurable, LogEnabled, PasswordGenerator
- public class DefaultPasswordGenerator
- extends java.lang.Object
- implements PasswordGenerator, Configurable, LogEnabled
- Author:
- Jeff Richley
| Method Summary |
void |
configure(Configuration myConf)
Pass the Configuration to the Configurable class. |
void |
enableLogging(Logger l)
Provide component with a logger. |
java.lang.String |
getRandomPassword()
Produce a random password according to default settings or configuration |
java.lang.String |
getRandomPassword(int length, boolean lower, boolean upper, boolean digits, boolean special)
Produce a random password according to certain parameters that constrain the result |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
length
private int length
-
doLower
private boolean doLower
-
doUpper
private boolean doUpper
-
doDigits
private boolean doDigits
-
doSpecial
private boolean doSpecial
-
logger
private Logger logger
-
The logger for info/debug messages
DefaultPasswordGenerator
public DefaultPasswordGenerator()
getRandomPassword
public java.lang.String getRandomPassword()
- Description copied from interface:
PasswordGenerator
-
Produce a random password according to default settings or configuration
-
- Specified by:
getRandomPassword in interface PasswordGenerator
-
- Returns:
- The new random password
getRandomPassword
public java.lang.String getRandomPassword(int length,
boolean lower,
boolean upper,
boolean digits,
boolean special)
- Description copied from interface:
PasswordGenerator
-
Produce a random password according to certain parameters that constrain the result
-
- Specified by:
getRandomPassword in interface PasswordGenerator
-
- Parameters:
length - Length of the password to be generated
lower - Use all lower case?
upper - Use all upper case?
digits - Use digits?
special - Use special characters (e.g. punctuation)?
- Returns:
- The generated password
configure
public void configure(Configuration myConf)
throws ConfigurationException
- Description copied from interface:
Configurable
-
Pass the
Configuration to the Configurable class.
-
- Specified by:
configure in interface Configurable
-
- Parameters:
myConf - the class configurations. Must not be null.
- Throws:
ConfigurationException - if an error occurs
enableLogging
public void enableLogging(Logger l)
- Description copied from interface:
LogEnabled
-
Provide component with a logger.
-
- Specified by:
enableLogging in interface LogEnabled
-
- Parameters:
l - the logger. Must not be null.
Please see keelframework.org for information about new Keel releases.