public class MongoPolicyStore extends Object implements PolicyStore
Constructor and Description |
---|
MongoPolicyStore(MongoStoreInvocationContext invocationContext,
AuthorizationProvider authorizationProvider) |
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 . |
public MongoPolicyStore(MongoStoreInvocationContext invocationContext, AuthorizationProvider authorizationProvider)
public Policy create(String name, String type, ResourceServer resourceServer)
PolicyStore
Policy
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 PolicyStore
name
- the name of the policytype
- the type of the policyresourceServer
- the resource server to which this policy belongsPolicy
public void delete(String id)
PolicyStore
delete
in interface PolicyStore
id
- the id of the policy to deletepublic Policy findById(String id)
PolicyStore
Policy
with the given id
findById
in interface PolicyStore
id
- the identifier of the policypublic Policy findByName(String name, String resourceServerId)
PolicyStore
Policy
with the given name
findByName
in interface PolicyStore
name
- the name of the policyresourceServerId
- the resource server idpublic List<Policy> findByResourceServer(String resourceServerId)
PolicyStore
findByResourceServer
in interface PolicyStore
resourceServerId
- the identifier of a resource serverpublic List<Policy> findByResource(String resourceId)
PolicyStore
Policy
associated with a org.keycloak.authorization.core.model.Resource
with the given resourceId
.findByResource
in interface PolicyStore
resourceId
- the identifier of a resourcepublic List<Policy> findByResourceType(String resourceType, String resourceServerId)
PolicyStore
Policy
associated with a org.keycloak.authorization.core.model.Resource
with the given type
.findByResourceType
in interface PolicyStore
resourceType
- the type of a resourceresourceServerId
- the resource server idpublic List<Policy> findByScopeIds(List<String> scopeIds, String resourceServerId)
PolicyStore
Policy
associated with a org.keycloak.authorization.core.model.Scope
with the given scopeIds
.findByScopeIds
in interface PolicyStore
scopeIds
- the id of the scopesresourceServerId
- the resource server idpublic List<Policy> findByType(String type)
PolicyStore
Policy
with the given type
.findByType
in interface PolicyStore
type
- the type of the policypublic List<Policy> findDependentPolicies(String policyId)
PolicyStore
Policy
that depends on another policy with the given id
.findDependentPolicies
in interface PolicyStore
policyId
- the id of the policy to query its dependentsCopyright © 2016 JBoss by Red Hat. All rights reserved.