public interface PolicyStore
PolicyStore
is responsible to manage the persistence of Policy
instances.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 |
List<Policy> |
findByResource(String resourceId,
String resourceServerId)
Returns a list of
Policy associated with a org.keycloak.authorization.core.model.Resource with the given resourceId . |
void |
findByResource(String resourceId,
String resourceServerId,
Consumer<Policy> consumer) |
List<Policy> |
findByResourceServer(Map<String,String[]> attributes,
String resourceServerId,
int firstResult,
int maxResult)
|
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 . |
void |
findByResourceType(String type,
String id,
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 . |
List<Policy> |
findByScopeIds(List<String> scopeIds,
String resourceId,
String resourceServerId)
Returns a list of
Policy associated with a org.keycloak.authorization.core.model.Scope with the given resourceId and scopeIds . |
void |
findByScopeIds(List<String> scopeIds,
String resourceId,
String resourceServerId,
Consumer<Policy> consumer) |
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 . |
Policy create(AbstractPolicyRepresentation representation, ResourceServer resourceServer)
Policy
instance. The new instance is not necessarily persisted though, which may require
a call to the {#save} method to actually make it persistent.representation
- the policy representationresourceServer
- the resource server to which this policy belongsPolicy
void delete(String id)
id
- the id of the policy to deletePolicy findById(String id, String resourceServerId)
Policy
with the given id
id
- the identifier of the policyresourceServerId
- the resource server idPolicy findByName(String name, String resourceServerId)
Policy
with the given name
name
- the name of the policyresourceServerId
- the resource server idList<Policy> findByResourceServer(String resourceServerId)
resourceServerId
- the identifier of a resource serverList<Policy> findByResourceServer(Map<String,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
attributes
- a map holding the attributes that will be used as a filterresourceServerId
- the identifier of a resource serverList<Policy> findByResource(String resourceId, String resourceServerId)
Policy
associated with a org.keycloak.authorization.core.model.Resource
with the given resourceId
.resourceId
- the identifier of a resourceresourceServerId
- the resource server idvoid findByResource(String resourceId, String resourceServerId, Consumer<Policy> consumer)
List<Policy> findByResourceType(String resourceType, String resourceServerId)
Policy
associated with a org.keycloak.authorization.core.model.Resource
with the given type
.resourceType
- the type of a resourceresourceServerId
- the resource server idList<Policy> findByScopeIds(List<String> scopeIds, String resourceServerId)
Policy
associated with a org.keycloak.authorization.core.model.Scope
with the given scopeIds
.scopeIds
- the id of the scopesresourceServerId
- the resource server idList<Policy> findByScopeIds(List<String> scopeIds, String resourceId, String resourceServerId)
Policy
associated with a org.keycloak.authorization.core.model.Scope
with the given resourceId
and scopeIds
.scopeIds
- the id of the scopesresourceId
- the id of the resourceresourceServerId
- the resource server idvoid findByScopeIds(List<String> scopeIds, String resourceId, String resourceServerId, Consumer<Policy> consumer)
List<Policy> findByType(String type, String resourceServerId)
Policy
with the given type
.type
- the type of the policyresourceServerId
- the resource server idList<Policy> findDependentPolicies(String id, String resourceServerId)
Policy
that depends on another policy with the given id
.id
- the id of the policy to query its dependentsresourceServerId
- the resource server idCopyright © 2020 JBoss by Red Hat. All rights reserved.