public interface PrincipalDatabase
Modifier and Type | Method and Description |
---|---|
boolean |
createPrincipal(Principal principal,
char[] password)
Create a new principal in the database
|
SaslServer |
createSaslServer(String mechanism,
String localFQDN,
Principal externalPrincipal) |
boolean |
deletePrincipal(Principal principal)
Delete a principal
|
List<String> |
getMechanisms()
Get the list of mechanisms supported for use with the PrincipalDatabase
|
Principal |
getUser(String username)
Get the principal from the database with the given username
|
List<Principal> |
getUsers() |
void |
open(File passwordFile) |
void |
reload()
Reload the database to its ensure contents are up to date
|
void |
setPassword(Principal principal,
PasswordCallback callback)
Set the password for a given principal in the specified callback.
|
boolean |
updatePassword(Principal principal,
char[] password)
Update(Change) the password for the given principal
|
boolean |
verifyPassword(String principal,
char[] password)
Used to verify that the presented Password is correct.
|
void open(File passwordFile) throws IOException
IOException
void setPassword(Principal principal, PasswordCallback callback) throws IOException, AccountNotFoundException
principal
- the principalcallback
- the password callback that wants to receive the passwordAccountNotFoundException
- if the account for specified principal could not be foundIOException
- if there was an error looking up the principalboolean verifyPassword(String principal, char[] password) throws AccountNotFoundException
principal
- The principal to authenticatepassword
- The password to checkAccountNotFoundException
- if the principal cannot be foundboolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
principal
- Who's password is to be changedpassword
- The new password to useAccountNotFoundException
- If the given principal doesn't exist in the Databaseboolean createPrincipal(Principal principal, char[] password)
principal
- The principal to createpassword
- The password to set for the principalboolean deletePrincipal(Principal principal) throws AccountNotFoundException
principal
- The principal to deleteAccountNotFoundException
- If the given principal doesn't exist in the DatabasePrincipal getUser(String username)
username
- of the principal to lookupvoid reload() throws IOException
IOException
- If there was an error reloading the databaseList<String> getMechanisms()
SaslServer createSaslServer(String mechanism, String localFQDN, Principal externalPrincipal) throws SaslException
SaslException
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.