public class JPAPolicyStore extends Object implements PolicyStore
| Constructor and Description |
|---|
JPAPolicyStore(javax.persistence.EntityManager entityManager) |
| Modifier and Type | Method and Description |
|---|---|
Policy |
create(String name,
String type,
ResourceServer resourceServer)
Creates a new
Policy instance. |
void |
delete(String id)
Deletes a policy from the underlying persistence mechanism.
|
Policy |
findById(String id)
Returns a
Policy with the given id |
Policy |
findByName(String name,
String resourceServerId)
Returns a
Policy with the given name |
List<Policy> |
findByResource(String resourceId)
Returns a list of
Policy associated with a org.keycloak.authorization.core.model.Resource with the given resourceId. |
List<Policy> |
findByResourceServer(String resourceServerId)
|
List<Policy> |
findByResourceType(String resourceType,
String resourceServerId)
Returns a list of
Policy associated with a org.keycloak.authorization.core.model.Resource with the given type. |
List<Policy> |
findByScopeIds(List<String> scopeIds,
String resourceServerId)
Returns a list of
Policy associated with a org.keycloak.authorization.core.model.Scope with the given scopeIds. |
List<Policy> |
findByType(String type)
Returns a list of
Policy with the given type. |
List<Policy> |
findDependentPolicies(String policyId)
Returns a list of
Policy that depends on another policy with the given id. |
javax.persistence.EntityManager |
getEntityManager() |
public JPAPolicyStore(javax.persistence.EntityManager entityManager)
public Policy create(String name, String type, ResourceServer resourceServer)
PolicyStorePolicy instance. The new instance is not necessarily persisted though, which may require
a call to the {#save} method to actually make it persistent.create in interface PolicyStorename - the name of the policytype - the type of the policyresourceServer - the resource server to which this policy belongsPolicypublic javax.persistence.EntityManager getEntityManager()
public void delete(String id)
PolicyStoredelete in interface PolicyStoreid - the id of the policy to deletepublic Policy findById(String id)
PolicyStorePolicy with the given idfindById in interface PolicyStoreid - the identifier of the policypublic Policy findByName(String name, String resourceServerId)
PolicyStorePolicy with the given namefindByName in interface PolicyStorename - the name of the policyresourceServerId - the resource server idpublic List<Policy> findByResourceServer(String resourceServerId)
PolicyStorefindByResourceServer in interface PolicyStoreresourceServerId - the identifier of a resource serverpublic List<Policy> findByResource(String resourceId)
PolicyStorePolicy associated with a org.keycloak.authorization.core.model.Resource with the given resourceId.findByResource in interface PolicyStoreresourceId - the identifier of a resourcepublic List<Policy> findByResourceType(String resourceType, String resourceServerId)
PolicyStorePolicy associated with a org.keycloak.authorization.core.model.Resource with the given type.findByResourceType in interface PolicyStoreresourceType - the type of a resourceresourceServerId - the resource server idpublic List<Policy> findByScopeIds(List<String> scopeIds, String resourceServerId)
PolicyStorePolicy associated with a org.keycloak.authorization.core.model.Scope with the given scopeIds.findByScopeIds in interface PolicyStorescopeIds - the id of the scopesresourceServerId - the resource server idpublic List<Policy> findByType(String type)
PolicyStorePolicy with the given type.findByType in interface PolicyStoretype - the type of the policypublic List<Policy> findDependentPolicies(String policyId)
PolicyStorePolicy that depends on another policy with the given id.findDependentPolicies in interface PolicyStorepolicyId - the id of the policy to query its dependentsCopyright © 2016 JBoss by Red Hat. All rights reserved.