All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.realm.SharedPasswordRealm
java.lang.Object
|
+----sun.server.realm.Realm
|
+----sun.server.realm.SharedPasswordRealm
- public final class SharedPasswordRealm
- extends Realm
This class provides a simple implementation of a realm. All of
the contents of the realm are stored in files in a single directory,
and the the realm's authentication is done using only the shared
password scheme.
-
changePassword(String, String)
- Changes the user's password.
-
createUser(String, String)
- Creates the named user, with the given (plaintext) password.
-
deleteUser(String)
- Deletes the named user.
-
getDefaultAclOwner()
- Returns the principal which will by default own all ACLs
in this realm.
-
getUser(String)
- Returns the information recorded about a particular named
user.
-
getUserNames()
- Returns names of all the users in this particular realm.
-
init(Properties)
- Initializes the instance of the shared password realm
from configuration parameters.
init
public synchronized void init(Properties props) throws BadRealmException, NoSuchRealmException
- Initializes the instance of the shared password realm
from configuration parameters.
- Parameters:
- props - initialization parameters used by this realm.
- Throws: BadRealmException
- if the configuration parameters
identify a corrupt realm
- Throws: NoSuchRealmException
- if the configuration parameters
specify a realm which doesn't exist
- Overrides:
- init in class Realm
getUserNames
public Enumeration getUserNames()
- Returns names of all the users in this particular realm.
- Returns:
- enumeration of user names
- Overrides:
- getUserNames in class Realm
getUser
public User getUser(String name) throws NoSuchUserException
- Returns the information recorded about a particular named
user.
- Parameters:
- name - name of the user whose information is desired
- Returns:
- object describing that user
- Throws: NoSuchUserException
- if the user is not recognized
- Overrides:
- getUser in class Realm
createUser
public void createUser(String userName,
String password) throws InUseException, BadRealmException
- Creates the named user, with the given (plaintext) password.
- Parameters:
- userName - name of the user
- password - that user's password/passphrase
- Throws: InUseException
- if that user name already exists
- Throws: BadRealmException
- if the realm data structures are bad
changePassword
public void changePassword(String userName,
String password) throws NoSuchUserException, BadRealmException
- Changes the user's password. The caller should first perform
authorization tests, such as verifying knowledge of the original
password.
- Parameters:
- userName - name of the user
- password - that user's new password/passphrase
- Throws: NoSuchUserException
- if that user name does not exist
- Throws: BadRealmException
- if the realm data structures are bad
deleteUser
public void deleteUser(String userName) throws NoSuchUserException, BadRealmException, InUseException
- Deletes the named user.
- Parameters:
- userName - name of the user
- Throws: NoSuchUserException
- if that user name does not exist
- Throws: BadRealmException
- if the realm data structures are bad
- Throws: InUseException
- if the user is part of the realm security
policy
- Overrides:
- deleteUser in class Realm
getDefaultAclOwner
public Principal getDefaultAclOwner() throws BadRealmException
- Returns the principal which will by default own all ACLs
in this realm.
- Returns:
- the "admin" principal
- Throws: BadRealmException
- if there is no such principal
- Overrides:
- getDefaultAclOwner in class Realm
All Packages Class Hierarchy This Package Previous Next Index