Class Realm
java.lang.Object
com.sun.enterprise.security.auth.realm.AbstractGlassFishRealmState
com.sun.enterprise.security.auth.realm.Realm
- All Implemented Interfaces:
GlassFishUserManagement
,GlassFishUserStore
,Comparable<Realm>
- Direct Known Subclasses:
CertificateRealm
,FileRealm
,LDAPRealm
,SolarisRealm
@Contract
public abstract class Realm
extends AbstractGlassFishRealmState
implements GlassFishUserStore, GlassFishUserManagement
javadoc
- Author:
- Harish Prabandham, Harpreet Singh, Jyri Virkki, Shing Wai Chan
- See Also:
-
Field Summary
Fields inherited from class com.sun.enterprise.security.auth.realm.AbstractGlassFishRealmState
groupMapper, JAAS_CONTEXT_PARAM, PARAM_GROUP_MAPPING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Realm
Convenience method which returns the Realm object representing the current default realm.static String
Returns the name of the default realm.static Realm
getInstance
(String name) Returns the realm identified by the name which is passed as a parameter.static Realm
getInstance
(String configName, String name) Returns the realm identified by the name which is passed as a parameter.static Enumeration
<String> Returns the names of accessible realms.static void
static Realm
instantiate
(String name, String className, Properties props) Instantiate a Realm with the given name and properties using the Class name given.static Realm
instantiate
(String name, String className, Properties props, String configName) Instantiate a Realm with the given name and properties using the Class name given.static boolean
isValidRealm
(String name) Checks if the given realm name is loaded/valid.static boolean
isValidRealm
(String configName, String name) Checks if the given realm name is loaded/valid.static void
setDefaultRealm
(String realmName) Sets the name of the default realm.static void
unloadInstance
(String realmName) Remove realm with given name from cache.static void
unloadInstance
(String configName, String realmName) Remove realm with given name from cache.protected static void
updateInstance
(Realm realm, String name) Replace a Realm instance.protected static void
updateInstance
(String configName, Realm realm, String name) Replace a Realm instance.Methods inherited from class com.sun.enterprise.security.auth.realm.AbstractGlassFishRealmState
addAssignGroups, compareTo, getAuthType, getDefaultDigestAlgorithm, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, init, refresh, setName, setProperty, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sun.enterprise.security.auth.realm.GlassFishUserManagement
addUser, addUser, persist, removeUser, supportsUserManagement, updateUser, updateUser
Methods inherited from interface com.sun.enterprise.security.auth.realm.GlassFishUserStore
getGroupNames, getGroupNames, getUser, getUserNames, refresh
-
Field Details
-
_logger
-
-
Constructor Details
-
Realm
public Realm()
-
-
Method Details
-
instantiate
public static Realm instantiate(String name, String className, Properties props) throws BadRealmException Instantiate a Realm with the given name and properties using the Class name given. This method is used by iAS and not RI.- Parameters:
name
- Name of the new realm.className
- Java Class name of the realm to create.props
- Properties containing values of the Property element from server.xml- Throws:
BadRealmException
- If the requested realm cannot be instantiated.
-
instantiate
public static Realm instantiate(String name, String className, Properties props, String configName) throws BadRealmException Instantiate a Realm with the given name and properties using the Class name given. This method is used by iAS and not RI.- Parameters:
name
- Name of the new realm.className
- Java Class name of the realm to create.props
- Properties containing values of the Property element from server.xmlconfigName
- the config to which this realm belongs- Throws:
BadRealmException
- If the requested realm cannot be instantiated.
-
getDefaultInstance
Convenience method which returns the Realm object representing the current default realm. Equivalent to getInstance(getDefaultRealm()).- Returns:
- Realm representing default realm.
- Throws:
NoSuchRealmException
- if default realm does not exist
-
getInstance
Returns the realm identified by the name which is passed as a parameter. This function knows about all the realms which exist; it is not possible to store (or create) one which is not accessible through this routine.- Parameters:
name
- identifies the realm- Returns:
- the requested realm
- Throws:
NoSuchRealmException
- if the realm is invalidBadRealmException
- if realm data structures are bad
-
getInstance
Returns the realm identified by the name which is passed as a parameter. This function knows about all the realms which exist; it is not possible to store (or create) one which is not accessible through this routine.- Parameters:
name
- identifies the realm- Returns:
- the requested realm
- Throws:
NoSuchRealmException
- if the realm is invalidBadRealmException
- if realm data structures are bad
-
getDefaultRealm
Returns the name of the default realm.- Returns:
- Default realm name.
-
setDefaultRealm
Sets the name of the default realm.- Parameters:
realmName
- Name of realm to set as default.
-
isValidRealm
Checks if the given realm name is loaded/valid.- Parameters:
String
- name of the realm to check.- Returns:
- true if realm present, false otherwise.
-
isValidRealm
Checks if the given realm name is loaded/valid.- Parameters:
String
- name of the realm to check.- Returns:
- true if realm present, false otherwise.
-
getRealmNames
Returns the names of accessible realms.- Returns:
- set of realm names
-
unloadInstance
Remove realm with given name from cache.- Parameters:
realmName
-- Throws:
NoSuchRealmException
-
unloadInstance
Remove realm with given name from cache.- Parameters:
realmName
-- Throws:
NoSuchRealmException
-
updateInstance
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.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.
- Parameters:
realm
- The new realm instance.name
- The (previously instantiated) name for this realm.
-
updateInstance
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.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.
- Parameters:
realm
- The new realm instance.name
- The (previously instantiated) name for this realm.
-
getRealmStatsProvier
public static void getRealmStatsProvier()
-