Methods Summary |
---|
public void | addPasswordAlias(java.lang.String aliasName, java.lang.String password)Add a non-existing password alias
try {
PasswordAdapter p = getPasswordAdapter();
if (p.aliasExists(aliasName)) {
throw new ConfigException(_strMgr.getString("passwordAliasExists", aliasName));
}
p.setPasswordForAlias(aliasName, password.getBytes());
} catch (Exception ex) {
throw getExceptionHandler().handleConfigException(
ex, "addPasswordAliasException", aliasName);
}
|
protected static ExceptionHandler | getExceptionHandler()
//The exception handler is used to parse and log exceptions
if (_handler == null) {
_handler = new ExceptionHandler(getLogger());
}
return _handler;
|
private static java.util.logging.Logger | getLogger()
if (_logger == null) {
_logger = Logger.getLogger(AdminConstants.kLoggerName);
}
return _logger;
|
private com.sun.enterprise.security.store.PasswordAdapter | getPasswordAdapter()
//The masterPassword in the IdentityManager is available only through
//a running DAS, server instance, or node agent.
String masterPassword = IdentityManager.getMasterPassword();
return new PasswordAdapter(masterPassword.toCharArray());
|
public java.lang.String[] | getPasswordAliases()Get all the password aliases
try {
ArrayList result = new ArrayList();
Enumeration en = getPasswordAdapter().getAliases();
while (en.hasMoreElements()) {
result.add((String)en.nextElement());
}
return (String[])result.toArray(new String[result.size()]);
} catch (Exception ex) {
throw getExceptionHandler().handleConfigException(
ex, "listPasswordAliasException", "");
}
|
public void | removePasswordAlias(java.lang.String aliasName)Remove an existing password alias
try {
PasswordAdapter p = getPasswordAdapter();
if (!p.aliasExists(aliasName)) {
throw new ConfigException(_strMgr.getString("passwordAliasDoesNotExist", aliasName));
}
p.removeAlias(aliasName);
} catch (Exception ex) {
throw getExceptionHandler().handleConfigException(
ex, "removePasswordAliasException", aliasName);
}
|
public void | updatePasswordAlias(java.lang.String aliasName, java.lang.String password)Update the password for an existing alias
try {
PasswordAdapter p = getPasswordAdapter();
if (!p.aliasExists(aliasName)) {
throw new ConfigException(_strMgr.getString("passwordAliasDoesNotExist", aliasName));
}
p.setPasswordForAlias(aliasName, password.getBytes());
} catch (Exception ex) {
throw getExceptionHandler().handleConfigException(
ex, "updatePasswordAliasException", aliasName);
}
|