public abstract class AbstractPasswordFilePrincipalDatabase<U extends org.apache.qpid.server.security.auth.database.PasswordPrincipal> extends Object implements PrincipalDatabase
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_ENCODING |
Constructor and Description |
---|
AbstractPasswordFilePrincipalDatabase() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
compareCharArray(char[] a,
char[] b) |
boolean |
createPrincipal(Principal principal,
char[] password)
Create a new principal in the database
|
protected abstract U |
createUserFromFileData(String[] result) |
protected abstract U |
createUserFromPassword(Principal principal,
char[] passwd) |
boolean |
deletePrincipal(Principal principal)
Delete a principal
|
protected abstract org.slf4j.Logger |
getLogger() |
Principal |
getUser(String username)
Get the principal from the database with the given username
|
List<Principal> |
getUsers() |
protected char[] |
lookupPassword(String name)
Looks up the password for a specified user in the password file.
|
void |
open(File passwordFile) |
void |
reload()
Reload the database to its ensure contents are up to date
|
protected void |
savePasswordFile() |
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.
|
boolean |
updatePassword(Principal principal,
char[] password)
Changes the password for the specified user
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSaslServer, getMechanisms, verifyPassword
protected static final String DEFAULT_ENCODING
public AbstractPasswordFilePrincipalDatabase()
public final void open(File passwordFile) throws IOException
open
in interface PrincipalDatabase
IOException
public final 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 onAccountNotFoundException
- If the Principal cannot be found in this Databaseprotected final char[] lookupPassword(String name)
name
- The principal name to lookupprotected boolean compareCharArray(char[] a, char[] b)
public boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
updatePassword
in interface PrincipalDatabase
principal
- to change the password forpassword
- plaintext password to set the password tooAccountNotFoundException
- If the given principal doesn't exist in the Databaseprotected abstract org.slf4j.Logger getLogger()
protected void savePasswordFile() throws IOException
IOException
protected abstract U createUserFromPassword(Principal principal, char[] passwd)
public void reload() throws IOException
PrincipalDatabase
reload
in interface PrincipalDatabase
IOException
- If there was an error reloading the databasepublic List<Principal> getUsers()
getUsers
in interface PrincipalDatabase
public Principal getUser(String username)
PrincipalDatabase
getUser
in interface PrincipalDatabase
username
- of the principal to lookuppublic boolean deletePrincipal(Principal principal) throws AccountNotFoundException
PrincipalDatabase
deletePrincipal
in interface PrincipalDatabase
principal
- The principal to deleteAccountNotFoundException
- 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 principalCopyright © 2006–2016 The Apache Software Foundation. All rights reserved.