/** * 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"); }
/** * 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"); }
/** * Returns the names of accessible realms. * @return set of realm names */ public static synchronized Enumeration getRealmNames() { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.getRealmNames(); } throw new RuntimeException("Unable to locate RealmsManager Service"); }
/** * 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 name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.isValidRealm(name); } throw new RuntimeException("Unable to locate RealmsManager Service"); }
/** * Returns the names of accessible realms. * @return set of realm names */ public static synchronized Enumeration getRealmNames() { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.getRealmNames(); } throw new RuntimeException("Unable to locate RealmsManager Service"); }
/** * 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 name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.isValidRealm(name); } throw new RuntimeException("Unable to locate RealmsManager Service"); }
/** * Returns the name of the default realm. * * @return Default realm name. * */ public static synchronized String getDefaultRealm() { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.getDefaultRealmName(); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * Returns the name of the default realm. * * @return Default realm name. * */ public static synchronized String getDefaultRealm() { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr.getDefaultRealmName(); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * This is a private method for getting realm instance. * If realm does not exist, then it will not return null rather than * throw exception. * @param name identifies the realm * @return the requested realm */ private static synchronized Realm _getInstance(String name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr._getInstance(name); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * This is a private method for getting realm instance. * If realm does not exist, then it will not return null rather than * throw exception. * @param name identifies the realm * @return the requested realm */ private static synchronized Realm _getInstance(String configName, String name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr._getInstance(configName, name); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * Sets the name of the default realm. * * @param realmName Name of realm to set as default. * */ public static synchronized void setDefaultRealm(String realmName) { //defaultRealmName = realmName; RealmsManager mgr = getRealmsManager(); if (mgr != null) { mgr.setDefaultRealmName(realmName); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * 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."); }
/** * Sets the name of the default realm. * * @param realmName Name of realm to set as default. * */ public static synchronized void setDefaultRealm(String realmName) { //defaultRealmName = realmName; RealmsManager mgr = getRealmsManager(); if (mgr != null) { mgr.setDefaultRealmName(realmName); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * This is a private method for getting realm instance. * If realm does not exist, then it will not return null rather than * throw exception. * @param name identifies the realm * @return the requested realm */ private static synchronized Realm _getInstance(String configName, String name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr._getInstance(configName, name); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * This is a private method for getting realm instance. * If realm does not exist, then it will not return null rather than * throw exception. * @param name identifies the realm * @return the requested realm */ private static synchronized Realm _getInstance(String name) { RealmsManager mgr = getRealmsManager(); if (mgr != null) { return mgr._getInstance(name); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } }
/** * 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); }
/** * Remove realm with given name from cache. * @param realmName * @exception NoSuchRealmException */ public static synchronized void unloadInstance(String realmName) throws NoSuchRealmException { //make sure instance exist getInstance(realmName); RealmsManager mgr = getRealmsManager(); if (mgr != null) { mgr.removeFromLoadedRealms(realmName); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } _logger.log(Level.INFO, "Realm " + realmName + " successfully deleted."); }
/** * Remove realm with given name from cache. * @param realmName * @exception NoSuchRealmException */ public static synchronized void unloadInstance(String realmName) throws NoSuchRealmException { //make sure instance exist getInstance(realmName); RealmsManager mgr = getRealmsManager(); if (mgr != null) { mgr.removeFromLoadedRealms(realmName); } else { throw new RuntimeException("Unable to locate RealmsManager Service"); } _logger.log(Level.INFO, SecurityLoggerInfo.realmDeleted, realmName); }
/** * Instantiate a Realm with the given name and properties using the * Class name given. This method is used by iAS and not RI. * * @param name Name of the new realm. * @param className Java Class name of the realm to create. * @param props Properties containing values of the Property element * from server.xml * @returns Reference to the new Realm. The Realm class keeps an internal * list of all instantiated realms. * @throws BadRealmException If the requested realm cannot be instantiated. * */ public static synchronized Realm instantiate(String name, String className, Properties props) throws BadRealmException { //Register the realm provider registerRealmStatsProvier(); Realm realmClass = _getInstance(name); if(realmClass == null) { realmClass = doInstantiate(name, className, props); RealmsManager mgr = getRealmsManager(); mgr.putIntoLoadedRealms(name, realmClass); } return realmClass; }
/** * Instantiate a Realm with the given name and properties using the * Class name given. This method is used by iAS and not RI. * * @param name Name of the new realm. * @param className Java Class name of the realm to create. * @param props Properties containing values of the Property element * from server.xml * @param configName the config to which this realm belongs * @returns Reference to the new Realm. The Realm class keeps an internal * list of all instantiated realms. * @throws BadRealmException If the requested realm cannot be instantiated. * */ public static synchronized Realm instantiate(String name, String className, Properties props, String configName) throws BadRealmException { //Register the realm provider registerRealmStatsProvier(); Realm realmClass = _getInstance(configName, name); if(realmClass == null) { realmClass = doInstantiate(name, className, props); RealmsManager mgr = getRealmsManager(); mgr.putIntoLoadedRealms(configName, name, realmClass); } return realmClass; }