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