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 build(File)
Builds a new instance of a shared password realm, with default policies established.
 o changePassword(String, String)
Changes the user's password.
 o createUser(String, String)
Creates the named user, with the given (plaintext) password.
 o delete()
Deletes this realm.
 o deleteUser(String)
Deletes the named user.
 o getAuthSchemes()
Returns the only authentication scheme supported by this realm, one based on shared passwords known to both the server and client.
 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 isAuthSupported(String)
Returns true iff the requested scheme is authSharedPassword.

Methods

 o build
  public static SharedPasswordRealm build(File directory) throws BadRealmException
Builds a new instance of a shared password realm, with default policies established.

Parameters:
directory - which will hold the realm's files
Returns:
the newly created realm object
Throws: BadRealmException
for construction errors
 o getAuthSchemes
  public String[] getAuthSchemes()
Returns the only authentication scheme supported by this realm, one based on shared passwords known to both the server and client.

Returns:
single element vector with one scheme
Overrides:
getAuthSchemes in class Realm
 o isAuthSupported
  public boolean isAuthSupported(String scheme)
Returns true iff the requested scheme is authSharedPassword.

Parameters:
scheme - name of an authentication scheme
Returns:
true iff it is supported
Overrides:
isAuthSupported 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
 o delete
  public void delete()
Deletes this realm. It is the caller's responsibility to ensure that no resources rely on this realm.


All Packages  Class Hierarchy  This Package  Previous  Next  Index