public class MapPolicyStore extends Object implements PolicyStore
| Constructor and Description |
|---|
MapPolicyStore(KeycloakSession session,
MapStorage<MapPolicyEntity,Policy> policyStore,
AuthorizationProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
Policy |
create(AbstractPolicyRepresentation representation,
ResourceServer resourceServer)
Creates a new
Policy instance. |
void |
delete(String id)
Deletes a policy from the underlying persistence mechanism.
|
Policy |
findById(String id,
String resourceServerId)
Returns a
Policy with the given id |
Policy |
findByName(String name,
String resourceServerId)
Returns a
Policy with the given name |
void |
findByResource(String resourceId,
String resourceServerId,
Consumer<Policy> consumer) |
List<Policy> |
findByResourceServer(Map<Policy.FilterOption,String[]> attributes,
String resourceServerId,
int firstResult,
int maxResult)
|
List<Policy> |
findByResourceServer(String id)
|
void |
findByResourceType(String type,
String resourceServerId,
Consumer<Policy> policyConsumer) |
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. |
void |
findByScopeIds(List<String> scopeIds,
String resourceId,
String resourceServerId,
Consumer<Policy> consumer)
Effectively the same method as
PolicyStore.findByScopeIds(List, String, String), however in the end
the consumer is fed with the result. |
List<Policy> |
findByType(String type,
String resourceServerId)
Returns a list of
Policy with the given type. |
List<Policy> |
findDependentPolicies(String id,
String resourceServerId)
Returns a list of
Policy that depends on another policy with the given id. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindByResource, findByResourceType, findByScopeIdspublic MapPolicyStore(KeycloakSession session, MapStorage<MapPolicyEntity,Policy> policyStore, AuthorizationProvider provider)
public Policy create(AbstractPolicyRepresentation representation, 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 PolicyStorerepresentation - the policy representationresourceServer - the resource server to which this policy belongsPolicypublic void delete(String id)
PolicyStoredelete in interface PolicyStoreid - the id of the policy to deletepublic Policy findById(String id, String resourceServerId)
PolicyStorePolicy with the given idfindById in interface PolicyStoreid - the identifier of the policyresourceServerId - the resource server idpublic 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 id)
PolicyStorefindByResourceServer in interface PolicyStoreid - the identifier of a resource serverpublic List<Policy> findByResourceServer(Map<Policy.FilterOption,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
PolicyStorefindByResourceServer in interface PolicyStoreattributes - a map holding the attributes that will be used as a filter; possible filter options are given by Policy.FilterOptionresourceServerId - the identifier of a resource serverpublic void findByResource(String resourceId, String resourceServerId, Consumer<Policy> consumer)
findByResource in interface PolicyStorepublic void findByResourceType(String type, String resourceServerId, Consumer<Policy> policyConsumer)
findByResourceType in interface PolicyStorepublic 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 void findByScopeIds(List<String> scopeIds, String resourceId, String resourceServerId, Consumer<Policy> consumer)
PolicyStorePolicyStore.findByScopeIds(List, String, String), however in the end
the consumer is fed with the result.findByScopeIds in interface PolicyStorepublic List<Policy> findByType(String type, String resourceServerId)
PolicyStorePolicy with the given type.findByType in interface PolicyStoretype - the type of the policyresourceServerId - the resource server idpublic List<Policy> findDependentPolicies(String id, String resourceServerId)
PolicyStorePolicy that depends on another policy with the given id.findDependentPolicies in interface PolicyStoreid - the id of the policy to query its dependentsresourceServerId - the resource server idCopyright © 2021 JBoss by Red Hat. All rights reserved.