Class AbstractGlassFishRealmState
java.lang.Object
com.sun.enterprise.security.auth.realm.AbstractGlassFishRealmState
- All Implemented Interfaces:
Comparable<Realm>
- Direct Known Subclasses:
Realm
Abstract class that stores the common state for all Realms.
This basically includes the realm name, a number of properties, and specifically a number of (extra) groups which are always assigned to an authenticated caller.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
The default the constructor creates a realm which will later be initialized, either from properties or by deserializing. -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
addAssignGroups
(String[] groups) Add assign groups to given array of groups.int
Compares a realm to another.abstract String
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is supported by this realm.protected String
Returns name of JAAS context used by this realm.getMappedGroupNames
(String group) final String
getName()
Returns the name of this realm.protected Properties
Return properties of the realm.getProperty
(String name) Get a realm property.protected void
init
(Properties properties) Initialize a realm with some properties.void
Refreshes the realm data so that new users/groups are visible.protected final void
Assigns the name of this realm, and stores it in the cache of realms.void
setProperty
(String name, String value) Set a realm property.toString()
Returns the name of this realm.
-
Field Details
-
JAAS_CONTEXT_PARAM
- See Also:
-
PARAM_GROUP_MAPPING
- See Also:
-
groupMapper
-
-
Constructor Details
-
AbstractGlassFishRealmState
protected AbstractGlassFishRealmState()The default the constructor creates a realm which will later be initialized, either from properties or by deserializing.
-
-
Method Details
-
init
Initialize a realm with some properties. This can be used when instantiating realms from their descriptions. This method may only be called a single time.- Parameters:
properties
- initialization parameters used by this realm.- Throws:
BadRealmException
- if the configuration parameters identify a corrupt realmNoSuchRealmException
- if the configuration parameters specify a realm which doesn't exist
-
addAssignGroups
Add assign groups to given array of groups. To be used by getGroupNames.- Parameters:
groups
-- Returns:
-
getMappedGroupNames
-
refresh
Refreshes the realm data so that new users/groups are visible.- Parameters:
configName
-- Throws:
BadRealmException
- if realm data structures are bad
-
getName
Returns the name of this realm.- Returns:
- realm name.
-
setName
Assigns the name of this realm, and stores it in the cache of realms. Used when initializing a newly created in-memory realm object; if the realm already has a name, there is no effect.- Parameters:
name
- name to be assigned to this realm.
-
getDefaultDigestAlgorithm
-
getProperty
Get a realm property.- Parameters:
name
- property name.- Returns:
-
setProperty
Set a realm property.- Parameters:
name
- property name.value
- property value.
-
getProperties
Return properties of the realm.- Returns:
-
getAuthType
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is supported by this realm.- Returns:
- description of the kind of authentication that is directly supported by this realm.
-
getJAASContext
Returns name of JAAS context used by this realm.The JAAS context is defined in server.xml auth-realm element associated with this realm.
- Returns:
- String containing JAAS context name.
-
toString
Returns the name of this realm. -
compareTo
Compares a realm to another.The comparison first considers the authentication type, so that realms supporting the same kind of user authentication are grouped together. Then it compares realm realm names. Realms compare "before" other kinds of objects (i.e. there's only a partial order defined, in the case that those other objects compare themselves "before" a realm object).
- Specified by:
compareTo
in interfaceComparable<Realm>
-