| com.ecyrd.jspwiki.auth.user.UserDatabase
All known Subclasses: com.ecyrd.jspwiki.auth.user.AbstractUserDatabase,
UserDatabase | public interface UserDatabase (Code) | | Defines an interface for loading, persisting and storing users.
author: Janne Jalkanen author: Andrew Jaquith since: 2.3 |
deleteByLoginName | public void deleteByLoginName(String loginName) throws NoSuchPrincipalException, WikiSecurityException(Code) | | Looks up and deletes the first
UserProfile in the user database
that matches a profile having a given login name. If the user database
does not contain a user with a matching attribute, throws a
NoSuchPrincipalException . This method is intended to be atomic;
results cannot be partially committed. If the commit fails, it should
roll back its state appropriately. Implementing classes that persist
to the file system may wish to make this method synchronized .
Parameters: loginName - the login name of the user profile that shall be deleted |
find | public UserProfile find(String index) throws NoSuchPrincipalException(Code) | | Looks up and returns the first
UserProfile in the user database
that whose login name, full name, or wiki name matches the supplied
string. This method provides a "forgiving" search algorithm for resolving
Principal names when the exact profile attribute that supplied the name
is unknown.
Parameters: index - the login name, full name, or wiki name |
getWikiNames | public Principal[] getWikiNames() throws WikiSecurityException(Code) | | Returns all WikiNames that are stored in the UserDatabase
as an array of Principal objects. If the database does not
contain any profiles, this method will return a zero-length
array.
the WikiNames |
isSharedWithContainer | public boolean isSharedWithContainer()(Code) | | Returns true if this user database shares user/password data with the
web container; false otherwise.
the result |
newProfile | public UserProfile newProfile()(Code) | | Factory method that instantiates a new user profile.
The
UserProfile.isNew method of profiles created using
this method should return true .
|
rename | public void rename(String loginName, String newName) throws NoSuchPrincipalException, DuplicateUserException, WikiSecurityException(Code) | | Renames a
UserProfile in the user database by changing
the profile's login name. Because the login name is the profile's unique
identifier, implementations should verify that the identifier is
"safe" to change before actually changing it. Specifically: the profile
with the supplied login name must already exist, and the proposed new
name must not be in use by another profile.
This method is intended to be atomic; results cannot be partially committed.
If the commit fails, it should roll back its state appropriately.
Implementing classes that persist to the file system may wish to make
this method synchronized .
Parameters: loginName - the existing login name for the profile Parameters: newName - the proposed new login name throws: NoSuchPrincipalException - if the user profile identified byloginName does not exist throws: DuplicateUserException - if another user profile with theproposed new login name already exists throws: WikiSecurityException - if the profile cannot be renamed forany reason, such as an I/O error, database connection failureor lack of support for renames. |
save | public void save(UserProfile profile) throws WikiSecurityException(Code) | |
Saves a
UserProfile to the user database, overwriting the
existing profile if it exists. The user name under which the profile
should be saved is returned by the supplied profile's
UserProfile.getLoginName method.
The database implementation is responsible for detecting potential
duplicate user profiles; specifically, the login name, wiki name, and
full name must be unique. The implementation is not required to check for
validity of passwords or e-mail addresses. Special case: if the profile
already exists and the password is null, it should retain its previous
value, rather than being set to null.
Implementations are required to time-stamp the creation
or modification fields of the UserProfile./p>
This method is intended to be atomic; results cannot be partially committed.
If the commit fails, it should roll back its state appropriately.
Implementing classes that persist to the file system may wish to make
this method synchronized .
Parameters: profile - the user profile to save throws: WikiSecurityException - if the profile cannot be saved |
validatePassword | public boolean validatePassword(String loginName, String password)(Code) | | Determines whether a supplied user password is valid, given a login name
and password. It is up to the implementing class to determine how the
comparison should be made. For example, the password might be hashed
before comparing it to the value persisted in the back-end data store.
Parameters: loginName - the login name Parameters: password - the password true if the password is valid, false otherwise |
|
|