|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase
public class PlainPasswordFilePrincipalDatabase
Represents a user database where the account information is stored in a simple flat file. The file is expected to be in the form: username:password username1:password1 ... usernamen:passwordn where a carriage return separates each username/password pair. Passwords are assumed to be in plain text.
Field Summary | |
---|---|
static String |
DEFAULT_ENCODING
|
Constructor Summary | |
---|---|
PlainPasswordFilePrincipalDatabase()
|
Method Summary | |
---|---|
boolean |
createPrincipal(Principal principal,
char[] password)
Create a new principal in the database |
boolean |
deletePrincipal(Principal principal)
Delete a principal |
Map<String,AuthenticationProviderInitialiser> |
getMechanisms()
|
Principal |
getUser(String username)
Get the principal from the database with the given username |
List<Principal> |
getUsers()
|
void |
reload()
Reload the database to its ensure contents are up to date |
void |
setPassword(Principal principal,
PasswordCallback callback)
SASL Callback Mechanism - sets the Password in the PasswordCallback based on the value in the PasswordFile If you want to change the password for a user, use updatePassword instead. |
void |
setPasswordFile(String passwordFile)
|
boolean |
updatePassword(Principal principal,
char[] password)
Changes the password for the specified user |
boolean |
verifyPassword(String principal,
char[] password)
Used to verify that the presented Password is correct. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_ENCODING
Constructor Detail |
---|
public PlainPasswordFilePrincipalDatabase()
Method Detail |
---|
public void setPasswordFile(String passwordFile) throws IOException
IOException
public void setPassword(Principal principal, PasswordCallback callback) throws AccountNotFoundException
setPassword
in interface PrincipalDatabase
principal
- The Principal to set the password forcallback
- The PasswordCallback to call setPassword on
AccountNotFoundException
- If the Principal cannot be found in this Databasepublic boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException
verifyPassword
in interface PrincipalDatabase
principal
- The principal to authenticatepassword
- The plaintext password to check
AccountNotFoundException
- if the principal cannot be foundpublic boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
updatePassword
in interface PrincipalDatabase
principal
- to change the password forpassword
- plaintext password to set the password too
AccountNotFoundException
- If the given principal doesn't exist in the Databasepublic boolean createPrincipal(Principal principal, char[] password)
PrincipalDatabase
createPrincipal
in interface PrincipalDatabase
principal
- The principal to createpassword
- The password to set for the principal
public boolean deletePrincipal(Principal principal) throws AccountNotFoundException
PrincipalDatabase
deletePrincipal
in interface PrincipalDatabase
principal
- The principal to delete
AccountNotFoundException
- If the given principal doesn't exist in the Databasepublic Map<String,AuthenticationProviderInitialiser> getMechanisms()
getMechanisms
in interface PrincipalDatabase
public List<Principal> getUsers()
getUsers
in interface PrincipalDatabase
public Principal getUser(String username)
PrincipalDatabase
getUser
in interface PrincipalDatabase
username
- of the principal to lookup
public void reload() throws IOException
PrincipalDatabase
reload
in interface PrincipalDatabase
IOException
- If there was an error reloading the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |