public class ContextualIdentityManager extends AbstractIdentityContext 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,
EventBridge eventBridge,
IdGenerator idGenerator,
StoreSelector storeSelector,
RelationshipManager relationshipManager) |
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. |
<T extends IdentityType> |
lookupIdentityById(Class<T> identityType,
String id)
Retrieves an
IdentityType with the given identifier. |
void |
remove(IdentityType identityType)
Removes the given
IdentityType instance from the configured identity store. |
<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 . |
getEventBridge, getIdGenerator, getParameter, getPartition, getPermissionHandlerPolicy, isParameterSet, setParameter
public ContextualIdentityManager(Partition partition, EventBridge eventBridge, IdGenerator idGenerator, StoreSelector storeSelector, RelationshipManager relationshipManager)
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 identityType) 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
Copyright © 2014. All rights reserved.