private Realm getRealm(final String realmName) { loadRealms(); final Realm realm = getRealmsManager().getFromLoadedRealms(realmName); if ( realm == null ) { throw new IllegalArgumentException( "No such realm: " + realmName ); } return realm; }
Realm oldRealm = mgr.getFromLoadedRealms(name); if (!oldRealm.getClass().equals(realm.getClass())) {
Realm oldRealm = mgr.getFromLoadedRealms(name); if (!oldRealm.getClass().equals(realm.getClass())) {
/** * Replace a Realm instance. Can be used by a Realm subclass to * replace a previously initialized instance of itself. Future * getInstance requests will then obtain the new instance. * * <P>Minimal error checking is done. The realm being replaced must * already exist (instantiate() was previously called), the new * instance must be fully initialized properly and it must of course * be of the same class as the previous instance. * * @param realm The new realm instance. * @param name The (previously instantiated) name for this realm. * */ protected static synchronized void updateInstance(String configName, Realm realm, String name) { RealmsManager mgr = getRealmsManager(); if (mgr == null) { throw new RuntimeException("Unable to locate RealmsManager Service"); } Realm oldRealm = mgr.getFromLoadedRealms(configName, name); if (!oldRealm.getClass().equals(realm.getClass())) { // would never happen unless bug in realm subclass throw new Error("Incompatible class " + realm.getClass() + " in replacement realm " + name); } realm.setName(oldRealm.getName()); mgr.putIntoLoadedRealms(configName, name, realm); _logger.log(Level.INFO, SecurityLoggerInfo.realmUpdated, new Object[]{realm.getName()}); }
/** * Replace a Realm instance. Can be used by a Realm subclass to * replace a previously initialized instance of itself. Future * getInstance requests will then obtain the new instance. * * <P>Minimal error checking is done. The realm being replaced must * already exist (instantiate() was previously called), the new * instance must be fully initialized properly and it must of course * be of the same class as the previous instance. * * @param realm The new realm instance. * @param name The (previously instantiated) name for this realm. * */ protected static synchronized void updateInstance(String configName, Realm realm, String name) { RealmsManager mgr = getRealmsManager(); if (mgr == null) { throw new RuntimeException("Unable to locate RealmsManager Service"); } Realm oldRealm = mgr.getFromLoadedRealms(configName, name); if (!oldRealm.getClass().equals(realm.getClass())) { // would never happen unless bug in realm subclass throw new Error("Incompatible class " + realm.getClass() + " in replacement realm " + name); } realm.setName(oldRealm.getName()); mgr.putIntoLoadedRealms(configName, name, realm); _logger.log(Level.INFO, "realm.updated.successfully", new Object[]{realm.getName()}); }
Realm oldRealm = mgr.getFromLoadedRealms(name); if (!oldRealm.getClass().equals(realm.getClass())) {
final FileRealm fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); CreateFileUser.handleAdminGroup(authRealmName, groups); String[] groups1 = groups.toArray(new String[groups.size()]);
final FileRealm fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); CreateFileUser.handleAdminGroup(authRealmName, groups); String[] groups1 = groups.toArray(new String[groups.size()]);
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName);
try { realmsManager.createRealms(config); fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(), fileAuthRealm.getName()); if (fr == null) { throw new NoSuchRealmException(fileAuthRealm.getName());
fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName);
try { realmsManager.createRealms(config); fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(), fileAuthRealm.getName()); if (fr == null) { throw new NoSuchRealmException(fileAuthRealm.getName());
try { realmsManager.createRealms(config); fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName);
try { realmsManager.createRealms(config); final FileRealm fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); fr.removeUser(userName);
try { realmsManager.createRealms(config); fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName);
try { realmsManager.createRealms(config); final FileRealm fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); fr.removeUser(userName); fr.persist();
try { realmsManager.createRealms(config); fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName);
try { realmsManager.createRealms(config); fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); if (fr == null) { throw new NoSuchRealmException(authRealmName);