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
Deprecated.
Moved to parent class, which actually implements the behaviour
|
protected static StringManager |
sm |
_logger, RI_DEFAULTgroupMapper, 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)
Adds new user to file realm.
|
Enumeration<String> |
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<String> |
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)
Update data for an existing user.
|
getDefaultInstance, getDefaultRealm, getInstance, getInstance, getRealmNames, getRealmStatsProvier, instantiate, instantiate, isValidRealm, isValidRealm, setDefaultRealm, unloadInstance, unloadInstance, updateInstance, updateInstanceaddAssignGroups, compareTo, getDefaultDigestAlgorithm, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, init, refresh, setName, setProperty, toStringgetAuthType, getGroupNamesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompareTo@Deprecated public static final String JAAS_CONTEXT_PARAM
protected static final StringManager sm
public Enumeration<String> 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 AbstractRealmBadRealmException - 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 AbstractRealmname - name of the user whose information is desiredNoSuchUserException - if the user doesn't existBadRealmException - if realm data structures are badpublic Enumeration<String> 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 AbstractRealmBadRealmException - 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 AbstractRealmBadRealmException - if realm data structures are badpublic void addUser(String name, char[] password, String[] groupList) throws BadRealmException, IASSecurityException
addUser in class AbstractRealmname - User name.password - Cleartext password for the user.groupList - List of groups to which user belongs.BadRealmException - If there are problems adding user.IASSecurityExceptionpublic void addUser(String name, String password, String[] groupList) throws BadRealmException, IASSecurityException
public void removeUser(String name) throws NoSuchUserException, BadRealmException
removeUser in class AbstractRealmname - User name.NoSuchUserException - If user does not exist.BadRealmExceptionpublic 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 AbstractRealmname - 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.groups - 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 AbstractRealmpublic void persist()
throws BadRealmException
persist in class AbstractRealmBadRealmExceptionCopyright © 2019. All rights reserved.