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.


Method Index

 o changePassword(String, String)
Changes the user's password.
 o createUser(String, String)
Creates the named user, with the given (plaintext) password.
 o deleteUser(String)
Deletes the named user.
 o getDefaultAclOwner()
Returns the principal which will by default own all ACLs in this realm.
 o getUser(String)
Returns the information recorded about a particular named user.
 o getUserNames()
Returns names of all the users in this particular realm.
 o init(Properties)
Initializes the instance of the shared password realm from configuration parameters.

Methods

 o 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
 o getUserNames
 public Enumeration getUserNames()
Returns names of all the users in this particular realm.

Returns:
enumeration of user names
Overrides:
getUserNames in class Realm
 o 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
 o 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
 o 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
 o 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
 o 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