public abstract class BaseRealm extends Realm
This class provides default implementation for most of the abstract methods in com.sun.enterprise.security.auth.realm.Realm. Since most of these abstract methods are not supported by Realms there is no need for the subclasses to implement them. The default implementations provided here generally throw an exception if invoked.
| Modifier and Type | Field and Description |
|---|---|
static String |
JAAS_CONTEXT_PARAM |
protected static StringManager |
sm |
_logger, groupMapper, PARAM_GROUP_MAPPING| Constructor and Description |
|---|
BaseRealm() |
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(String name,
char[] password,
String[] groupList)
Adds new user to file realm.
|
void |
addUser(String name,
String password,
String[] groupList)
Deprecated.
|
AuthenticationHandler |
getAuthenticationHandler()
Returns an AuthenticationHandler object which can be used to
authenticate within this realm.
|
Enumeration |
getGroupNames()
Returns names of all the groups in this particular realm.
|
User |
getUser(String name)
Returns the information recorded about a particular named user.
|
Enumeration |
getUserNames()
Returns names of all the users in this particular realm.
|
void |
persist()
Persist the realm data to permanent storage
|
void |
refresh()
Refreshes the realm data so that new users/groups are visible.
|
void |
removeUser(String name)
Remove user from file realm.
|
boolean |
supportsUserManagement() |
void |
updateUser(String name,
String newName,
char[] password,
String[] groups)
Update data for an existing user.
|
void |
updateUser(String name,
String newName,
String password,
String[] groups)
Deprecated.
|
addAssignGroups, compareTo, getAuthType, getDefaultDigestAlgorithm, getDefaultInstance, getDefaultRealm, getGroupNames, getInstance, getInstance, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, getRealmNames, getRealmStatsProvier, init, instantiate, instantiate, instantiate, isValidRealm, isValidRealm, refresh, setDefaultRealm, setName, setProperty, toString, unloadInstance, unloadInstance, updateInstance, updateInstancepublic static final String JAAS_CONTEXT_PARAM
protected static final StringManager sm
public AuthenticationHandler getAuthenticationHandler()
This method return null always, since AuthenticationHandlers are generally not supported by iAS realms. Subclass can override if necessary.
getAuthenticationHandler in class Realmpublic Enumeration getUserNames() throws BadRealmException
This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.
getUserNames in class RealmBadRealmException - if realm data structures are badpublic User getUser(String name) throws NoSuchUserException, BadRealmException
This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.
getUser in class Realmname - name of the user whose information is desiredNoSuchUserException - if the user doesn't existBadRealmException - if realm data structures are badpublic Enumeration getGroupNames() throws BadRealmException
This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.
getGroupNames in class RealmBadRealmException - if realm data structures are badpublic void refresh()
throws BadRealmException
This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.
refresh in class RealmBadRealmException - if realm data structures are badpublic void addUser(String name, char[] password, String[] groupList) throws BadRealmException, IASSecurityException
addUser in class Realmname - User name.password - Cleartext password for the user.groupList - List of groups to which user belongs.BadRealmException - If there are problems adding user.IASSecurityException@Deprecated public void addUser(String name, String password, String[] groupList) throws BadRealmException, IASSecurityException
public void removeUser(String name) throws NoSuchUserException, BadRealmException
removeUser in class Realmname - User name.NoSuchUserException - If user does not exist.BadRealmException@Deprecated public void updateUser(String name, String newName, String password, String[] groups) throws NoSuchUserException, BadRealmException, IASSecurityException
public void updateUser(String name, String newName, char[] password, String[] groups) throws NoSuchUserException, BadRealmException, IASSecurityException
updateUser in class Realmname - Current name of the user to update.newName - New name to give this user. It can be the same as
the original name. Otherwise it must be a new user name which
does not already exist as a user.password - Cleartext password for the user. If non-null the user
password is changed to this value. If null, the original password
is retained.groupList - List of groups to which user belongs.BadRealmException - If there are problems adding user.NoSuchUserException - If user does not exist.IASSecurityExceptionpublic boolean supportsUserManagement()
supportsUserManagement in class Realmpublic void persist()
throws BadRealmException
persist in class RealmBadRealmExceptionCopyright © 2017. All rights reserved.