if(!isBelogsTo(groupList, AdminConstants.DOMAIN_ADMIN_GROUP_NAME) &&
isLastAdminUser(userName))
{
String msg = localStrings.getString("authRealmMBean.removeLastAdminUser",
AdminConstants.DOMAIN_ADMIN_GROUP_NAME);
throw new MBeanConfigException(msg);
}
FileRealm realm = getRealmKeyFile();
try
{
realm.updateUser(userName, userName, password, groupList);
saveInstanceRealmKeyFile(realm);
logDetailsIfAdminRealm();
}
catch(BadRealmException bre)
{
//String msg = localStrings.getString( "admin.server.core.mbean.config.bad_realm", mInstanceName);
throw new MBeanConfigException(bre.getMessage());
}
catch(NoSuchUserException nse)
{
//String msg = localStrings.getString( "admin.server.core.mbean.config.no_such_user", mInstanceName, userName);
throw new MBeanConfigException(nse.getMessage());
}
catch(IASSecurityException ise)
{
//String msg = localStrings.getString( "admin.server.core.mbean.config.security_exception", mInstanceName, userName, bre.getMessage());
throw new MBeanConfigException(ise.getMessage());
}
EmitUserMgmtEvent(UserMgmtEvent.ACTION_USERUPDATE, userName, groupList);
}