@Typed(value=SecuredIdentityManager.class) public class SecuredIdentityManager extends Object implements IdentityManager
IDENTITY_MANAGER_CTX_PARAMETER
Constructor and Description |
---|
SecuredIdentityManager(IdentityManager decorated) |
Modifier and Type | Method and Description |
---|---|
void |
add(IdentityType identityType)
Adds the given
IdentityType instance to the configured identity store. |
<T extends IdentityType> |
createIdentityQuery(Class<T> identityType)
Creates an
IdentityQuery that can be used to query for IdentityType instances. |
IdentityQueryBuilder |
getQueryBuilder()
Returns a
IdentityQueryBuilder , responsible for building queries. |
<T extends IdentityType> |
lookupIdentityById(Class<T> identityType,
String id)
Retrieves an
IdentityType with the given identifier. |
void |
remove(IdentityType value)
Removes the given
IdentityType instance from the configured identity store. |
void |
removeCredential(Account account,
Class<? extends CredentialStorage> storageClass)
Removes all credentials stored by a certain
CredentialStorage associated
with the given Account . |
<T extends CredentialStorage> |
retrieveCredentials(Account account,
Class<T> storageClass)
Returns a list of all stored credential values for the specified account and credential storage class
|
<T extends CredentialStorage> |
retrieveCurrentCredential(Account account,
Class<T> storageClass)
Returns the current stored credential value for the specific account and credential storage class
|
void |
update(IdentityType identityType)
Updates the given
IdentityType instance. |
void |
updateCredential(Account account,
Object credential)
Updates a credential for the given
Account . |
void |
updateCredential(Account account,
Object credential,
Date effectiveDate,
Date expiryDate)
Updates a credential for the given
Account . |
void |
validateCredentials(Credentials credentials)
Validates the given
Credentials . |
public SecuredIdentityManager(IdentityManager decorated)
public void add(IdentityType identityType) throws IdentityManagementException
IdentityManager
Adds the given IdentityType
instance to the configured identity store.
add
in interface IdentityManager
IdentityManagementException
- If cannot store the provided IdentityType
instance.public void update(IdentityType identityType) throws IdentityManagementException
IdentityManager
Updates the given IdentityType
instance. The instance must have an identifier, otherwise a exception will be
thrown.
update
in interface IdentityManager
IdentityManagementException
- If cannot update the provided IdentityType
instance.public void remove(IdentityType value) throws IdentityManagementException
IdentityManager
Removes the given IdentityType
instance from the configured identity store. The instance must have an identifier,
otherwise a exception will be thrown.
remove
in interface IdentityManager
IdentityManagementException
- If cannot remove the provided IdentityType
instance.public <T extends IdentityType> T lookupIdentityById(Class<T> identityType, String id)
IdentityManager
Retrieves an IdentityType
with the given identifier.
The first argument tells which IdentityType
type should be returned. If you provide the IdentityType
base
interface any IdentityType
instance that matches the given identifier will be returned.
lookupIdentityById
in interface IdentityManager
IdentityType
is found with the given identifier this method returns null.public <T extends IdentityType> IdentityQuery<T> createIdentityQuery(Class<T> identityType)
IdentityManager
Creates an IdentityQuery
that can be used to query for IdentityType
instances.
The first argument tells which IdentityType
type should be returned. If you provide the IdentityType
base
interface any IdentityType
instance that matches the provided query parameters will be returned.
createIdentityQuery
in interface IdentityManager
public void validateCredentials(Credentials credentials)
IdentityManager
Validates the given Credentials
.
To check the validation status you should use the Credentials.getStatus
method.
validateCredentials
in interface IdentityManager
public void updateCredential(Account account, Object credential)
IdentityManager
Updates a credential for the given Account
.
updateCredential
in interface IdentityManager
credential
- The credential
must be a object supported by any CredentialHandler
.
Examples of credentials are the Password
and Digest
types.public void updateCredential(Account account, Object credential, Date effectiveDate, Date expiryDate)
IdentityManager
Updates a credential for the given Account
.
This methods also allows to specify the expiration and effective date for the credential.
updateCredential
in interface IdentityManager
credential
- The credential
must be a object supported by any CredentialHandler
.
Examples of credentials are the Password
and Digest
types.public <T extends CredentialStorage> T retrieveCurrentCredential(Account account, Class<T> storageClass)
IdentityManager
retrieveCurrentCredential
in interface IdentityManager
public <T extends CredentialStorage> List<T> retrieveCredentials(Account account, Class<T> storageClass)
IdentityManager
retrieveCredentials
in interface IdentityManager
public void removeCredential(Account account, Class<? extends CredentialStorage> storageClass)
IdentityManager
Removes all credentials stored by a certain CredentialStorage
associated
with the given Account
.
removeCredential
in interface IdentityManager
account
- The account which credentials should be removed.storageClass
- The credential storage type specifying which credential types should be removed.public IdentityQueryBuilder getQueryBuilder()
IdentityManager
Returns a IdentityQueryBuilder
, responsible for building queries.
getQueryBuilder
in interface IdentityManager
Copyright © 2018 JBoss by Red Hat. All rights reserved.