Realm _getInstance(String name) { Realm retval = null; retval = (Realm) loadedRealms.get (name); // Some tools as well as numerous other locations assume that // getInstance("default") always works; keep them from breaking // until code can be properly cleaned up. 4628429 // Also note that for example the appcontainer will actually create // a Subject always containing realm='default' so this notion // needs to be fixed/handled. if ( (retval == null) && (Realm.RI_DEFAULT.equals(name)) ) { retval = (Realm) loadedRealms.get (getDefaultRealmName()); } return retval; }
private boolean realmsAlreadyLoaded(String cfgName) { Enumeration<String> en = getRealmNames(cfgName); return (en != null && en.hasMoreElements()) ? true : false; }
public void setDefaultRealmName(final String realmName) { getRealmsManager().setDefaultRealmName(realmName); }
Realm _getInstance(String configName, String name) { Realm retval = null; retval = configGetRealmInstance(configName, name); // Some tools as well as numerous other locations assume that // getInstance("default") always works; keep them from breaking // until code can be properly cleaned up. 4628429 // Also note that for example the appcontainer will actually create // a Subject always containing realm='default' so this notion // needs to be fixed/handled. if ( (retval == null) && (Realm.RI_DEFAULT.equals(name)) ) { retval = configGetRealmInstance(configName,getDefaultRealmName()); } return retval; }
public Object run(SecurityService param) throws PropertyVetoException, TransactionFailure { try { realmsManager.createRealms(config); final FileRealm fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); CreateFileUser.handleAdminGroup(authRealmName, groups); String[] groups1 = groups.toArray(new String[groups.size()]);
Realm oldRealm = mgr.getFromLoadedRealms(name); if (!oldRealm.getClass().equals(realm.getClass())) { mgr.putIntoLoadedRealms(name, realm); _logger.log(Level.INFO, "realm.updated.successfully",new Object[]{realm.getName()});
/** * Remove realm with given name from cache. * @param realmName * @exception NoSuchRealmException */ public static synchronized void unloadInstance(String configName, String realmName) throws NoSuchRealmException { //make sure instance exist //getInstance(configName, realmName); RealmsManager mgr = getRealmsManager(); if (mgr != null) { mgr.removeFromLoadedRealms(configName, realmName); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } _logger.log(Level.INFO, "Realm " + realmName + " successfully deleted."); }
void putIntoLoadedRealms(String realmName, Realm realm) { putIntoLoadedRealms(config.getName(), realmName, realm); probeProvider.realmAddedEvent(realmName); }
Realm _getInstance(String name) { return _getInstance(config.getName(), name); }
/** * Checks if the given realm name is loaded/valid. * @param String name of the realm to check. * @return true if realm present, false otherwise. */ public static boolean isValidRealm(String configName, String name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.isValidRealm(configName, name); } throw new RuntimeException("Unable to locate RealmsManager Service"); }
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; }
/** * Checks if the given realm name is loaded/valid. * @param name of the realm to check. * @return true if realm present, false otherwise. */ public boolean isValidRealm(String configName, String name){ if(name == null){ return false; } else { return configContainsRealm(name, configName); } }
public Realm getFromLoadedRealms(String configName, String realmName) { return configGetRealmInstance(configName,realmName); }
public Object run(SecurityService param) throws PropertyVetoException, TransactionFailure { try { realmsManager.createRealms(config); final FileRealm fr = (FileRealm) realmsManager.getFromLoadedRealms(config.getName(),authRealmName); CreateFileUser.handleAdminGroup(authRealmName, groups); String[] groups1 = groups.toArray(new String[groups.size()]);
/** * 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()}); }
/** * Remove realm with given name from cache. * @param realmName * @exception NoSuchRealmException */ public static synchronized void unloadInstance(String configName, String realmName) throws NoSuchRealmException { //make sure instance exist //getInstance(configName, realmName); RealmsManager mgr = getRealmsManager(); if (mgr != null) { mgr.removeFromLoadedRealms(configName, realmName); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } _logger.log(Level.INFO, SecurityLoggerInfo.realmDeleted, realmName); }
Realm _getInstance(String configName, String name) { Realm retval = null; retval = configGetRealmInstance(configName, name); // Some tools as well as numerous other locations assume that // getInstance("default") always works; keep them from breaking // until code can be properly cleaned up. 4628429 // Also note that for example the appcontainer will actually create // a Subject always containing realm='default' so this notion // needs to be fixed/handled. if ( (retval == null) && (Realm.RI_DEFAULT.equals(name)) ) { retval = configGetRealmInstance(configName,getDefaultRealmName()); } return retval; }
void putIntoLoadedRealms(String realmName, Realm realm) { putIntoLoadedRealms(config.getName(), realmName, realm); probeProvider.realmAddedEvent(realmName); }
Realm _getInstance(String name) { return _getInstance(config.getName(), name); }
/** * Checks if the given realm name is loaded/valid. * @param String name of the realm to check. * @return true if realm present, false otherwise. */ public static boolean isValidRealm(String configName, String name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.isValidRealm(configName, name); } throw new RuntimeException("Unable to locate RealmsManager Service"); }