public class ContextualIdentityManager extends AbstractAttributedTypeManager<IdentityType> implements IdentityManager
Default implementation of the IdentityManager interface.
This lightweight class is intended to be created any time a batch of partition-specific identity management operations are to be performed. In a web environment, it is recommended that instances are scoped to the web request lifecycle.
This class is not thread-safe.
IDENTITY_MANAGER_CTX_PARAMETER| Constructor and Description |
|---|
ContextualIdentityManager(Partition partition,
DefaultPartitionManager partitionManager) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkIfExists(IdentityType identityType) |
protected void |
checkUniqueness(IdentityType identityType) |
protected IdentityContext |
createIdentityContext(Partition partition,
EventBridge eventBridge,
IdGenerator idGenerator) |
<T extends IdentityType> |
createIdentityQuery(Class<T> identityType)
Creates an
IdentityQuery that can be used to query for IdentityType instances. |
protected void |
doAdd(IdentityType attributedType) |
protected void |
doRemove(IdentityType attributedType) |
protected void |
doUpdate(IdentityType attributedType) |
protected void |
fireAttributedTypeAddedEvent(IdentityType attributedType) |
protected void |
fireAttributedTypeRemovedEvent(IdentityType attributedType) |
protected void |
fireAttributedTypeUpdatedEvent(IdentityType attributedType) |
IdentityQueryBuilder |
getQueryBuilder()
Returns a
IdentityQueryBuilder, responsible for building queries. |
<C extends IdentityType> |
lookupById(Class<C> attributedType,
String id)
Retrieves an
AttributedType with the given identifier. |
<T extends IdentityType> |
lookupIdentityById(Class<T> identityType,
String id)
Retrieves an
IdentityType with the given identifier. |
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 |
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. |
add, addAttributes, fireEvent, getConfiguration, getEventBridge, getIdentityContext, getIdGenerator, getStoreSelector, remove, removeAllAttributes, removeAttributes, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, remove, updatepublic ContextualIdentityManager(Partition partition, DefaultPartitionManager partitionManager)
protected void doAdd(IdentityType attributedType)
doAdd in class AbstractAttributedTypeManager<IdentityType>protected void fireAttributedTypeAddedEvent(IdentityType attributedType)
fireAttributedTypeAddedEvent in class AbstractAttributedTypeManager<IdentityType>protected void doUpdate(IdentityType attributedType)
doUpdate in class AbstractAttributedTypeManager<IdentityType>protected void fireAttributedTypeUpdatedEvent(IdentityType attributedType)
fireAttributedTypeUpdatedEvent in class AbstractAttributedTypeManager<IdentityType>protected void fireAttributedTypeRemovedEvent(IdentityType attributedType)
fireAttributedTypeRemovedEvent in class AbstractAttributedTypeManager<IdentityType>protected void doRemove(IdentityType attributedType)
doRemove in class AbstractAttributedTypeManager<IdentityType>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 IdentityManagerIdentityType is found with the given identifier this method returns null.public <C extends IdentityType> C lookupById(Class<C> attributedType, String id) throws IdentityManagementException
AttributedTypeManager
Retrieves an AttributedType with the given identifier.
The first argument tells which AttributedType type should be returned. If you provide the AttributedType base
interface any AttributedType instance that matches the given identifier will be returned.
lookupById in interface AttributedTypeManager<IdentityType>AttributedType is found with the given identifier this method returns null.IdentityManagementExceptionpublic <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 IdentityManagerpublic void validateCredentials(Credentials credentials)
IdentityManager
Validates the given Credentials.
To check the validation status you should use the Credentials.getStatus method.
validateCredentials in interface IdentityManagerpublic void updateCredential(Account account, Object credential)
IdentityManager
Updates a credential for the given Account.
updateCredential in interface IdentityManagercredential - 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 IdentityManagercredential - 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)
IdentityManagerretrieveCurrentCredential in interface IdentityManagerpublic <T extends CredentialStorage> List<T> retrieveCredentials(Account account, Class<T> storageClass)
IdentityManagerretrieveCredentials in interface IdentityManagerpublic void removeCredential(Account account, Class<? extends CredentialStorage> storageClass)
IdentityManagerRemoves all credentials stored by a certain CredentialStorage associated
with the given Account.
removeCredential in interface IdentityManageraccount - The account which credentials should be removed.storageClass - The credential storage type specifying which credential types should be removed.public IdentityQueryBuilder getQueryBuilder()
IdentityManagerReturns a IdentityQueryBuilder, responsible for building queries.
getQueryBuilder in interface IdentityManagerprotected IdentityContext createIdentityContext(Partition partition, EventBridge eventBridge, IdGenerator idGenerator)
createIdentityContext in class AbstractAttributedTypeManager<IdentityType>protected void checkIfExists(IdentityType identityType) throws IdentityManagementException
checkIfExists in class AbstractAttributedTypeManager<IdentityType>IdentityManagementExceptionprotected void checkUniqueness(IdentityType identityType)
checkUniqueness in class AbstractAttributedTypeManager<IdentityType>Copyright © 2015. All rights reserved.