public abstract class AbstractCredentialHandler<S extends CredentialStore<?>,V extends AbstractBaseCredentials,U> extends Object implements CredentialHandler<S,V,U>
Base class for CredentialHandler
implementations.
Constructor and Description |
---|
AbstractCredentialHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract CredentialStorage |
createCredentialStorage(IdentityContext context,
Account account,
U password,
S store,
Date effectiveDate,
Date expiryDate) |
protected Account |
getAccount(IdentityContext context,
String userName)
Custom
CredentialHandler implementations may override this method to perform the lookup of Account instances based on the userName . |
protected abstract Account |
getAccount(IdentityContext context,
V credentials) |
protected Account |
getAccountById(IdentityContext context,
String identifier)
Custom
CredentialHandler implementations may override this method to perform the lookup of Account instances based on the identifier . |
protected abstract CredentialStorage |
getCredentialStorage(IdentityContext context,
Account account,
V credentials,
S store) |
protected Property |
getDefaultLoginNameProperty(Class<? extends Account> accountType) |
protected IdentityManager |
getIdentityManager(IdentityContext context) |
protected boolean |
isDebugEnabled() |
void |
setup(S store) |
void |
update(IdentityContext context,
Account account,
U password,
S store,
Date effectiveDate,
Date expiryDate)
Updates the credential for a certain
Account . |
void |
validate(IdentityContext context,
V credentials,
S store)
Validates a credential.
|
protected abstract boolean |
validateCredential(IdentityContext context,
CredentialStorage credentialStorage,
V credentials,
S store) |
public void setup(S store)
setup
in interface CredentialHandler<S extends CredentialStore<?>,V extends AbstractBaseCredentials,U>
protected Account getAccount(IdentityContext context, String userName)
Custom CredentialHandler
implementations may override this method to perform the lookup of Account
instances based on the userName
.
context
- userName
- The login name of the account that will be used to retrieve the instance.protected Account getAccountById(IdentityContext context, String identifier)
Custom CredentialHandler
implementations may override this method to perform the lookup of Account
instances based on the identifier
.
context
- identifier
- The identifier of the account that will be used to retrieve the instance.public void validate(IdentityContext context, V credentials, S store)
CredentialHandler
Validates a credential.
validate
in interface CredentialHandler<S extends CredentialStore<?>,V extends AbstractBaseCredentials,U>
context
- The contextual invocation context.credentials
- The credential to be validated.store
- The underlying identity store.public void update(IdentityContext context, Account account, U password, S store, Date effectiveDate, Date expiryDate)
CredentialHandler
Updates the credential for a certain Account
.
update
in interface CredentialHandler<S extends CredentialStore<?>,V extends AbstractBaseCredentials,U>
context
- The contextual invocation context.account
- The account which credentials should be removed.password
- The credential to be updated.store
- The underlying identity store.effectiveDate
- The date specifying from when this credential is valid.expiryDate
- The date specifying when the credential expires.protected abstract CredentialStorage createCredentialStorage(IdentityContext context, Account account, U password, S store, Date effectiveDate, Date expiryDate)
protected abstract boolean validateCredential(IdentityContext context, CredentialStorage credentialStorage, V credentials, S store)
protected abstract Account getAccount(IdentityContext context, V credentials)
protected abstract CredentialStorage getCredentialStorage(IdentityContext context, Account account, V credentials, S store)
protected IdentityManager getIdentityManager(IdentityContext context)
protected boolean isDebugEnabled()
Copyright © 2018 JBoss by Red Hat. All rights reserved.