|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.auth.user.AbstractUserDatabase
com.ecyrd.jspwiki.auth.UserManager.DummyUserDatabase
public class UserManager.DummyUserDatabase
This is a database that gets used if nothing else is available. It does nothing of note - it just mostly thorws NoSuchPrincipalExceptions if someone tries to log in.
Field Summary |
---|
Fields inherited from class com.ecyrd.jspwiki.auth.user.AbstractUserDatabase |
---|
log, PROP_SHARED_WITH_CONTAINER, SHA_PREFIX |
Constructor Summary | |
---|---|
UserManager.DummyUserDatabase()
|
Method Summary | |
---|---|
void |
commit()
Persists the current state of the user database to back-end storage. |
void |
deleteByLoginName(String loginName)
Looks up and deletes the first UserProfile in the user database
that matches a profile having a given login name. |
UserProfile |
findByEmail(String index)
Looks up and returns the first UserProfile in the user database
that matches a profile having a given e-mail address. |
UserProfile |
findByFullName(String index)
Looks up and returns the first UserProfile in the user database
that matches a profile having a given full name. |
UserProfile |
findByLoginName(String index)
Looks up and returns the first UserProfile in the user database
that matches a profile having a given login name. |
UserProfile |
findByWikiName(String index)
Looks up and returns the first UserProfile in the user database
that matches a profile having a given wiki name. |
Principal[] |
getWikiNames()
Returns all WikiNames that are stored in the UserDatabase as an array of Principal objects. |
void |
initialize(WikiEngine engine,
Properties props)
Initializes the user database based on values from a Properties object. |
boolean |
isSharedWithContainer()
Returns true if this user database shares user/password data with the
web container; false otherwise. |
void |
save(UserProfile profile)
Saves a UserProfile to the user database, overwriting the
existing profile if it exists. |
Methods inherited from class com.ecyrd.jspwiki.auth.user.AbstractUserDatabase |
---|
find, getHash, getPrincipals, newProfile, validatePassword |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserManager.DummyUserDatabase()
Method Detail |
---|
public void commit() throws WikiSecurityException
UserDatabase
synchronized
.
commit
in interface UserDatabase
commit
in class AbstractUserDatabase
WikiSecurityException
UserDatabase.commit()
public void deleteByLoginName(String loginName) throws NoSuchPrincipalException, WikiSecurityException
UserDatabase
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
. The method does not commit the
results of the delete; it only alters the database in memory.
loginName
- the login name of the user profile that shall be deleted
NoSuchPrincipalException
WikiSecurityException
public UserProfile findByEmail(String index) throws NoSuchPrincipalException
UserDatabase
UserProfile
in the user database
that matches a profile having a given e-mail address. If the user
database does not contain a user with a matching attribute, throws a
NoSuchPrincipalException
.
findByEmail
in interface UserDatabase
findByEmail
in class AbstractUserDatabase
index
- the e-mail address of the desired user profile
NoSuchPrincipalException
UserDatabase.findByEmail(java.lang.String)
public UserProfile findByFullName(String index) throws NoSuchPrincipalException
UserDatabase
UserProfile
in the user database
that matches a profile having a given full name. If the user database
does not contain a user with a matching attribute, throws a
NoSuchPrincipalException
.
findByFullName
in interface UserDatabase
findByFullName
in class AbstractUserDatabase
index
- the fill name of the desired user profile
NoSuchPrincipalException
UserDatabase.findByFullName(java.lang.String)
public UserProfile findByLoginName(String index) throws NoSuchPrincipalException
UserDatabase
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
.
findByLoginName
in interface UserDatabase
findByLoginName
in class AbstractUserDatabase
index
- the login name of the desired user profile
NoSuchPrincipalException
UserDatabase.findByLoginName(java.lang.String)
public UserProfile findByWikiName(String index) throws NoSuchPrincipalException
UserDatabase
UserProfile
in the user database
that matches a profile having a given wiki name. If the user database
does not contain a user with a matching attribute, throws a
NoSuchPrincipalException
.
findByWikiName
in interface UserDatabase
findByWikiName
in class AbstractUserDatabase
index
- the wiki name of the desired user profile
NoSuchPrincipalException
UserDatabase.findByWikiName(java.lang.String)
public Principal[] getWikiNames() throws WikiSecurityException
UserDatabase
WikiSecurityException
public void initialize(WikiEngine engine, Properties props) throws NoRequiredPropertyException
UserDatabase
initialize
in interface UserDatabase
initialize
in class AbstractUserDatabase
NoRequiredPropertyException
UserDatabase.initialize(com.ecyrd.jspwiki.WikiEngine, java.util.Properties)
public boolean isSharedWithContainer()
UserDatabase
true
if this user database shares user/password data with the
web container; false otherwise.
- Returns:
- the result
public void save(UserProfile profile) throws WikiSecurityException
UserDatabase
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>
Calling classes should generally call
AuthenticationManager.refreshCredentials(WikiSession)
after
calling this method to ensure that Principals are reloaded into the
current WikiSession's Subject.
save
in interface UserDatabase
save
in class AbstractUserDatabase
profile
- the user profile to save
WikiSecurityException
- if the profile cannot be savedUserDatabase.save(com.ecyrd.jspwiki.auth.user.UserProfile)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |