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, waitcreateSaslServer, getMechanisms, verifyPasswordprotected static final String DEFAULT_ENCODING
public AbstractPasswordFilePrincipalDatabase()
public final void open(File passwordFile) throws IOException
open in interface PrincipalDatabaseIOExceptionpublic final void setPassword(Principal principal, PasswordCallback callback) throws AccountNotFoundException
setPassword in interface PrincipalDatabaseprincipal - 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 PrincipalDatabaseprincipal - 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
IOExceptionprotected abstract U createUserFromPassword(Principal principal, char[] passwd)
public void reload()
throws IOException
PrincipalDatabasereload in interface PrincipalDatabaseIOException - If there was an error reloading the databasepublic List<Principal> getUsers()
getUsers in interface PrincipalDatabasepublic Principal getUser(String username)
PrincipalDatabasegetUser in interface PrincipalDatabaseusername - of the principal to lookuppublic boolean deletePrincipal(Principal principal) throws AccountNotFoundException
PrincipalDatabasedeletePrincipal in interface PrincipalDatabaseprincipal - The principal to deleteAccountNotFoundException - If the given principal doesn't exist in the Databasepublic boolean createPrincipal(Principal principal, char[] password)
PrincipalDatabasecreatePrincipal in interface PrincipalDatabaseprincipal - The principal to createpassword - The password to set for the principalCopyright © 2006–2016 The Apache Software Foundation. All rights reserved.