@CredentialHandlers(value={PasswordCredentialHandler.class,X509CertificateCredentialHandler.class,DigestCredentialHandler.class,TOTPCredentialHandler.class,TokenCredentialHandler.class}) public class JPAIdentityStore extends AbstractAttributeStore<JPAIdentityStoreConfiguration> implements CredentialStore<JPAIdentityStoreConfiguration>, PartitionStore<JPAIdentityStoreConfiguration>, AttributeStore<JPAIdentityStoreConfiguration>, PermissionStore
| Modifier and Type | Class and Description |
|---|---|
protected class |
JPAIdentityStore.PermissionOperationSet |
| Modifier and Type | Field and Description |
|---|---|
static String |
INVOCATION_CTX_ENTITY_MANAGER |
| Constructor and Description |
|---|
JPAIdentityStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(IdentityContext identityContext,
Partition partition,
String configurationName) |
void |
addAttributedType(IdentityContext context,
AttributedType attributedType) |
void |
doSetAttribute(IdentityContext context,
AttributedType attributedType,
Attribute<? extends Serializable> attribute) |
<V extends IdentityType> |
fetchQueryResults(IdentityContext context,
IdentityQuery<V> identityQuery) |
<V extends Relationship> |
fetchQueryResults(IdentityContext context,
RelationshipQuery<V> query) |
<P extends Partition> |
get(IdentityContext identityContext,
Class<P> partitionClass) |
<P extends Partition> |
get(IdentityContext identityContext,
Class<P> partitionClass,
String name) |
protected Collection<Attribute<? extends Serializable>> |
getAttributes(IdentityContext identityContext,
AttributedType attributedType) |
String |
getConfigurationName(IdentityContext identityContext,
Partition partition) |
List<EntityMapper> |
getEntityMappers() |
List<EntityMapper> |
getMapperFor(Class<? extends AttributedType> attributedType)
Returns all
EntityMapper instances used to map the given AttributedType. |
EntityMapper |
getMapperForEntity(Class<?> entityClass) |
Object |
getOwnerEntity(AttributedType attributedType,
Property ownerProperty,
javax.persistence.EntityManager entityManager) |
<P extends Partition> |
getPartitions(IdentityContext identityContext,
Class<P> partitionClass,
String name) |
Object |
getRootEntity(AttributedType attributedType,
javax.persistence.EntityManager entityManager) |
EntityMapper |
getRootMapperForEntity(Class<?> entityClass) |
boolean |
grantPermission(IdentityContext context,
IdentityType assignee,
Object resource,
String operation)
Grants the specified permission
|
boolean |
isMappedType(Class mappedClass) |
List<Permission> |
listPermissions(IdentityContext ctx,
Class<?> resourceClass,
Serializable identifier)
Returns a List containing all the permissions for a resource that has not yet been loaded,
using the specified resource class and resource identifier value.
|
List<Permission> |
listPermissions(IdentityContext ctx,
Class<?> resourceClass,
Serializable identifier,
String operation)
Returns a List containing all the permissions for a resource that has not yet been loaded,
using the specified resource class and resource identifier value, with the specified operation.
|
List<Permission> |
listPermissions(IdentityContext ctx,
IdentityPermission query) |
List<Permission> |
listPermissions(IdentityContext ctx,
IdentityType identityType)
Returns a list of all
Permission for the given IdentityType. |
List<Permission> |
listPermissions(IdentityContext ctx,
Object resource)
Returns a List value containing all permissions for the specified resource.
|
List<Permission> |
listPermissions(IdentityContext ctx,
Object resource,
String operation)
Returns a List value containing all permissions for the specified resource, having the specified operation
|
List<Permission> |
listPermissions(IdentityContext ctx,
Set<Object> resources,
String operation)
Returns a List value containing all permissions for all of the specified resource,
having the specified operation
|
<P extends Partition> |
lookupById(IdentityContext context,
Class<P> partitionClass,
String id) |
void |
remove(IdentityContext identityContext,
Partition partition) |
void |
removeAttribute(IdentityContext context,
AttributedType attributedType,
String attributeName)
Removes the specified Attribute value, for the specified IdentityType
|
void |
removeAttributedType(IdentityContext context,
AttributedType attributedType) |
void |
removeCredential(IdentityContext context,
Account account,
Class<? extends CredentialStorage> storageClass)
Removes all credentials stored by a certain
CredentialStorage associated
with the given Account. |
protected void |
removeCredentials(IdentityContext context,
Account account) |
protected void |
removeFromRelationships(IdentityContext context,
IdentityType identityType) |
<T extends CredentialStorage> |
retrieveCredentials(IdentityContext context,
Account account,
Class<T> storageClass)
Returns a list of all credential state of the specified
T, for the specified Account. |
<T extends CredentialStorage> |
retrieveCurrentCredential(IdentityContext context,
Account account,
Class<T> storageClass)
Returns the currently active credential state of the specified
T, for the specified Account. |
void |
revokeAllPermissions(IdentityContext ctx,
Object resource)
Revokes all permissions for the specified resource
|
boolean |
revokePermission(IdentityContext context,
IdentityType assignee,
Object resource,
String operation)
Revokes the specified permission
|
void |
setup(JPAIdentityStoreConfiguration config)
Sets the configuration and context in which the IdentityStore will execute its operations
|
void |
storeCredential(IdentityContext context,
Account account,
CredentialStorage storage)
Stores the specified credential state.
|
void |
update(IdentityContext identityContext,
Partition partition) |
void |
updateAttributedType(IdentityContext context,
AttributedType attributedType) |
getAttribute, loadAttributes, setAttributeadd, countQueryResults, countQueryResults, getConfig, remove, update, updateCredential, validateCredentialsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttribute, loadAttributes, setAttributeadd, countQueryResults, countQueryResults, getConfig, remove, update, updateCredential, validateCredentialspublic static final String INVOCATION_CTX_ENTITY_MANAGER
public void setup(JPAIdentityStoreConfiguration config)
IdentityStoresetup in interface IdentityStore<JPAIdentityStoreConfiguration>setup in class AbstractIdentityStore<JPAIdentityStoreConfiguration>public void addAttributedType(IdentityContext context, AttributedType attributedType)
addAttributedType in class AbstractIdentityStore<JPAIdentityStoreConfiguration>public void updateAttributedType(IdentityContext context, AttributedType attributedType)
updateAttributedType in class AbstractIdentityStore<JPAIdentityStoreConfiguration>public void removeAttributedType(IdentityContext context, AttributedType attributedType)
removeAttributedType in class AbstractIdentityStore<JPAIdentityStoreConfiguration>protected void removeFromRelationships(IdentityContext context, IdentityType identityType)
removeFromRelationships in class AbstractIdentityStore<JPAIdentityStoreConfiguration>protected void removeCredentials(IdentityContext context, Account account)
removeCredentials in class AbstractIdentityStore<JPAIdentityStoreConfiguration>public void add(IdentityContext identityContext, Partition partition, String configurationName)
add in interface PartitionStore<JPAIdentityStoreConfiguration>public String getConfigurationName(IdentityContext identityContext, Partition partition)
getConfigurationName in interface PartitionStore<JPAIdentityStoreConfiguration>public <P extends Partition> P get(IdentityContext identityContext, Class<P> partitionClass, String name)
get in interface PartitionStore<JPAIdentityStoreConfiguration>public <P extends Partition> List<P> get(IdentityContext identityContext, Class<P> partitionClass)
get in interface PartitionStore<JPAIdentityStoreConfiguration>public <P extends Partition> List<P> getPartitions(IdentityContext identityContext, Class<P> partitionClass, String name)
public <P extends Partition> P lookupById(IdentityContext context, Class<P> partitionClass, String id)
lookupById in interface PartitionStore<JPAIdentityStoreConfiguration>public void update(IdentityContext identityContext, Partition partition)
update in interface PartitionStore<JPAIdentityStoreConfiguration>public void remove(IdentityContext identityContext, Partition partition)
remove in interface PartitionStore<JPAIdentityStoreConfiguration>protected Collection<Attribute<? extends Serializable>> getAttributes(IdentityContext identityContext, AttributedType attributedType)
getAttributes in class AbstractAttributeStore<JPAIdentityStoreConfiguration>public void removeAttribute(IdentityContext context, AttributedType attributedType, String attributeName)
AttributeStoreremoveAttribute in interface AttributeStore<JPAIdentityStoreConfiguration>public <V extends IdentityType> List<V> fetchQueryResults(IdentityContext context, IdentityQuery<V> identityQuery)
fetchQueryResults in interface IdentityStore<JPAIdentityStoreConfiguration>public <V extends Relationship> List<V> fetchQueryResults(IdentityContext context, RelationshipQuery<V> query)
fetchQueryResults in interface IdentityStore<JPAIdentityStoreConfiguration>public void doSetAttribute(IdentityContext context, AttributedType attributedType, Attribute<? extends Serializable> attribute)
doSetAttribute in class AbstractAttributeStore<JPAIdentityStoreConfiguration>public void storeCredential(IdentityContext context, Account account, CredentialStorage storage)
CredentialStorestoreCredential in interface CredentialStore<JPAIdentityStoreConfiguration>context - The contextual invocation context.account - The account which credentials should be removed.storage - The credential storage instance to be stored.public <T extends CredentialStorage> T retrieveCurrentCredential(IdentityContext context, Account account, Class<T> storageClass)
CredentialStoreT, for the specified Account.retrieveCurrentCredential in interface CredentialStore<JPAIdentityStoreConfiguration>context - The contextual invocation context.account - The account which credentials should be removed.storageClass - The credential storage type specifying which credential types should be removed.public <T extends CredentialStorage> List<T> retrieveCredentials(IdentityContext context, Account account, Class<T> storageClass)
CredentialStoreT, for the specified Account.retrieveCredentials in interface CredentialStore<JPAIdentityStoreConfiguration>context - The contextual invocation context.account - The account which credentials should be removed.storageClass - The credential storage type specifying which credential types should be removed.public void removeCredential(IdentityContext context, Account account, Class<? extends CredentialStorage> storageClass)
CredentialStoreRemoves all credentials stored by a certain CredentialStorage associated
with the given Account.
removeCredential in interface CredentialStore<JPAIdentityStoreConfiguration>context - The contextual invocation context.account - The account which credentials should be removed.storageClass - The credential storage type specifying which credential types should be removed.public Object getOwnerEntity(AttributedType attributedType, Property ownerProperty, javax.persistence.EntityManager entityManager)
public List<EntityMapper> getMapperFor(Class<? extends AttributedType> attributedType)
Returns all EntityMapper instances used to map the given AttributedType. Only mappers for
IdentityManaged annotated entity classes are considered, what means that this method can only be
used
when
trying to persist or populate @{link AttributedType} instances.
attributedType - public EntityMapper getRootMapperForEntity(Class<?> entityClass)
public EntityMapper getMapperForEntity(Class<?> entityClass)
public List<EntityMapper> getEntityMappers()
public boolean isMappedType(Class mappedClass)
public Object getRootEntity(AttributedType attributedType, javax.persistence.EntityManager entityManager)
public List<Permission> listPermissions(IdentityContext ctx, Object resource)
PermissionStorelistPermissions in interface PermissionStorepublic List<Permission> listPermissions(IdentityContext ctx, IdentityType identityType)
PermissionStoreReturns a list of all Permission for the given IdentityType.
listPermissions in interface PermissionStorepublic List<Permission> listPermissions(IdentityContext ctx, Object resource, String operation)
PermissionStorelistPermissions in interface PermissionStorepublic List<Permission> listPermissions(IdentityContext ctx, Set<Object> resources, String operation)
PermissionStorelistPermissions in interface PermissionStorepublic List<Permission> listPermissions(IdentityContext ctx, Class<?> resourceClass, Serializable identifier)
PermissionStorelistPermissions in interface PermissionStorepublic List<Permission> listPermissions(IdentityContext ctx, Class<?> resourceClass, Serializable identifier, String operation)
PermissionStorelistPermissions in interface PermissionStorepublic List<Permission> listPermissions(IdentityContext ctx, IdentityPermission query)
public boolean grantPermission(IdentityContext context, IdentityType assignee, Object resource, String operation)
PermissionStoregrantPermission in interface PermissionStorepublic boolean revokePermission(IdentityContext context, IdentityType assignee, Object resource, String operation)
PermissionStorerevokePermission in interface PermissionStorepublic void revokeAllPermissions(IdentityContext ctx, Object resource)
PermissionStorerevokeAllPermissions in interface PermissionStoreCopyright © 2021. All rights reserved.