Class AbstractRealm
- java.lang.Object
-
- com.sun.enterprise.security.auth.realm.AbstractRealm
-
- Direct Known Subclasses:
AbstractStatefulRealm
public abstract class AbstractRealm extends Object
This class contains all abstract methods of a Payara Realm.- Author:
- Arjan Tijms
- See Also:
Realm
-
-
Constructor Summary
Constructors Constructor Description AbstractRealm()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
addUser(String name, char[] password, String[] groupList)
Adds new user to file realm.abstract String
getAuthType()
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is supported by this realm.abstract Enumeration<String>
getGroupNames()
Returns names of all the groups in this particular realm.abstract Enumeration<String>
getGroupNames(String username)
Returns the name of all the groups that this user belongs toabstract User
getUser(String name)
Returns the information recorded about a particular named user.abstract Enumeration<String>
getUserNames()
Returns names of all the users in this particular realm.abstract void
persist()
Persist the realm data to permanent storageabstract void
refresh()
Refreshes the realm data so that new users/groups are visible.abstract void
removeUser(String name)
Remove user from file realm.abstract boolean
supportsUserManagement()
abstract void
updateUser(String name, String newName, char[] password, String[] groups)
Update data for an existing user.
-
-
-
Method Detail
-
getAuthType
public abstract String 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.
-
getUserNames
public abstract Enumeration<String> getUserNames() throws BadRealmException
Returns names of all the users in this particular realm.- Returns:
- enumeration of user names (strings)
- Throws:
BadRealmException
- if realm data structures are bad
-
getUser
public abstract User getUser(String name) throws NoSuchUserException, BadRealmException
Returns the information recorded about a particular named user.- Parameters:
name
- name of the user whose information is desired- Returns:
- the user object
- Throws:
NoSuchUserException
- if the user doesn't existBadRealmException
- if realm data structures are bad
-
getGroupNames
public abstract Enumeration<String> getGroupNames() throws BadRealmException
Returns names of all the groups in this particular realm.- Returns:
- enumeration of group names (strings)
- Throws:
BadRealmException
- if realm data structures are bad
-
getGroupNames
public abstract Enumeration<String> getGroupNames(String username) throws InvalidOperationException, NoSuchUserException
Returns the name of all the groups that this user belongs to- Parameters:
username
- name of the user in this realm whose group listing is needed.- Returns:
- enumeration of group names (strings)
- Throws:
InvalidOperationException
- thrown if the realm does not support this operationNoSuchUserException
-
supportsUserManagement
public abstract boolean supportsUserManagement()
- Returns:
- true if the realm implementation support User Management (add, update, remove user)
-
addUser
public abstract void addUser(String name, char[] password, String[] groupList) throws BadRealmException, IASSecurityException
Adds new user to file realm. User cannot exist already.- Parameters:
name
- User name.password
- Cleartext password for the user.groupList
- List of groups to which user belongs.- Throws:
BadRealmException
- If there are problems adding user.IASSecurityException
-
updateUser
public abstract void updateUser(String name, String newName, char[] password, String[] groups) throws NoSuchUserException, BadRealmException, IASSecurityException
Update data for an existing user. User must exist.- Parameters:
name
- 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
- Array of groups to which user belongs.- Throws:
BadRealmException
- If there are problems adding user.NoSuchUserException
- If user does not exist.IASSecurityException
-
removeUser
public abstract void removeUser(String name) throws NoSuchUserException, BadRealmException
Remove user from file realm. User must exist.- Parameters:
name
- User name.- Throws:
NoSuchUserException
- If user does not exist.BadRealmException
-
persist
public abstract void persist() throws BadRealmException
Persist the realm data to permanent storage- Throws:
BadRealmException
-
refresh
public abstract void refresh() throws BadRealmException
Refreshes the realm data so that new users/groups are visible.- Throws:
BadRealmException
- if realm data structures are bad
-
-