@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, setAttribute
add, countQueryResults, countQueryResults, getConfig, remove, update, updateCredential, validateCredentials
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttribute, loadAttributes, setAttribute
add, countQueryResults, countQueryResults, getConfig, remove, update, updateCredential, validateCredentials
public static final String INVOCATION_CTX_ENTITY_MANAGER
public void setup(JPAIdentityStoreConfiguration config)
IdentityStore
setup
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)
AttributeStore
removeAttribute
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)
CredentialStore
storeCredential
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)
CredentialStore
T
, 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)
CredentialStore
T
, 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)
CredentialStore
Removes 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)
PermissionStore
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(IdentityContext ctx, IdentityType identityType)
PermissionStore
Returns a list of all Permission
for the given IdentityType
.
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(IdentityContext ctx, Object resource, String operation)
PermissionStore
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(IdentityContext ctx, Set<Object> resources, String operation)
PermissionStore
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(IdentityContext ctx, Class<?> resourceClass, Serializable identifier)
PermissionStore
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(IdentityContext ctx, Class<?> resourceClass, Serializable identifier, String operation)
PermissionStore
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(IdentityContext ctx, IdentityPermission query)
public boolean grantPermission(IdentityContext context, IdentityType assignee, Object resource, String operation)
PermissionStore
grantPermission
in interface PermissionStore
public boolean revokePermission(IdentityContext context, IdentityType assignee, Object resource, String operation)
PermissionStore
revokePermission
in interface PermissionStore
public void revokeAllPermissions(IdentityContext ctx, Object resource)
PermissionStore
revokeAllPermissions
in interface PermissionStore
Copyright © 2017. All rights reserved.