Class MapPermissionTicketStore
- java.lang.Object
- 
- org.keycloak.models.map.authorization.MapPermissionTicketStore
 
- 
- All Implemented Interfaces:
- PermissionTicketStore
 
 public class MapPermissionTicketStore extends Object implements PermissionTicketStore 
- 
- 
Constructor SummaryConstructors Constructor Description MapPermissionTicketStore(MapStorage<MapPermissionTicketEntity,PermissionTicket> permissionTicketStore, AuthorizationProvider provider)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount(ResourceServer resourceServer, Map<PermissionTicket.FilterOption,String> attributes)Returns count ofPermissionTicket, filtered by the given attributes.PermissionTicketcreate(ResourceServer resourceServer, Resource resource, Scope scope, String requester)Creates a newPermissionTicketinstance.voiddelete(RealmModel realm, String id)Deletes a permission from the underlying persistence mechanism.List<PermissionTicket>find(RealmModel realm, ResourceServer resourceServer, Map<PermissionTicket.FilterOption,String> attributes, Integer firstResult, Integer maxResult)Returns a list ofPermissionTicket, filtered by the given attributes.PermissionTicketfindById(RealmModel realm, ResourceServer resourceServer, String id)Returns aPermissionTicketwith the givenidList<PermissionTicket>findByResource(ResourceServer resourceServer, Resource resource)Returns a list ofPermissionTicketassociated with theresource.List<PermissionTicket>findByScope(ResourceServer resourceServer, Scope scope)Returns a list ofPermissionTicketassociated with thescope.List<PermissionTicket>findGranted(ResourceServer resourceServer, String userId)Returns a list ofPermissionTicketgranted to the givenuserId.List<PermissionTicket>findGranted(ResourceServer resourceServer, String resourceName, String userId)List<Resource>findGrantedOwnerResources(RealmModel realm, String owner, Integer firstResult, Integer maxResults)Returns a list ofResourcegranted by the owner to other usersList<Resource>findGrantedResources(RealmModel realm, String requester, String name, Integer first, Integer max)Returns a list ofResourcegranted to the givenrequestervoidpreRemove(RealmModel realm)voidpreRemove(RealmModel realm, ResourceServer resourceServer)
 
- 
- 
- 
Constructor Detail- 
MapPermissionTicketStorepublic MapPermissionTicketStore(MapStorage<MapPermissionTicketEntity,PermissionTicket> permissionTicketStore, AuthorizationProvider provider) 
 
- 
 - 
Method Detail- 
countpublic long count(ResourceServer resourceServer, Map<PermissionTicket.FilterOption,String> attributes) Description copied from interface:PermissionTicketStoreReturns count ofPermissionTicket, filtered by the given attributes.- Specified by:
- countin interface- PermissionTicketStore
- Parameters:
- resourceServer- the resource server. Cannot be- null.
- attributes- permission tickets that do not match the attributes are not included with the count; possible filter options are given by- PermissionTicket.FilterOption
- Returns:
- an integer indicating the amount of permission tickets
 
 - 
createpublic PermissionTicket create(ResourceServer resourceServer, Resource resource, Scope scope, String requester) Description copied from interface:PermissionTicketStoreCreates a newPermissionTicketinstance.- Specified by:
- createin interface- PermissionTicketStore
- Parameters:
- resourceServer- the resource server to which this permission ticket belongs. Cannot be- null.
- resource- resource. Cannot be- null.
- scope- scope. Cannot be- null
- requester- requester of the permission
- Returns:
- a new instance of PermissionTicket
 
 - 
deletepublic void delete(RealmModel realm, String id) Description copied from interface:PermissionTicketStoreDeletes a permission from the underlying persistence mechanism.- Specified by:
- deletein interface- PermissionTicketStore
- Parameters:
- realm- realm. Cannot be- null.
- id- the id of the policy to delete
 
 - 
findByIdpublic PermissionTicket findById(RealmModel realm, ResourceServer resourceServer, String id) Description copied from interface:PermissionTicketStoreReturns aPermissionTicketwith the givenid- Specified by:
- findByIdin interface- PermissionTicketStore
- Parameters:
- realm- the realm. Cannot be- null.
- resourceServer- the resource server. Ignored if- null.
- id- the identifier of the permission
- Returns:
- a permission with the given identifier.
 
 - 
findByResourcepublic List<PermissionTicket> findByResource(ResourceServer resourceServer, Resource resource) Description copied from interface:PermissionTicketStoreReturns a list ofPermissionTicketassociated with theresource.- Specified by:
- findByResourcein interface- PermissionTicketStore
- Parameters:
- resourceServer- the resource server. Cannot be- null.
- resource- the resource. Cannot be- null
- Returns:
- a list of permissions associated with the given resource
 
 - 
findByScopepublic List<PermissionTicket> findByScope(ResourceServer resourceServer, Scope scope) Description copied from interface:PermissionTicketStoreReturns a list ofPermissionTicketassociated with thescope.- Specified by:
- findByScopein interface- PermissionTicketStore
- Parameters:
- resourceServer- the resource server. Cannot be- null.
- scope- the scope. Cannot be- null.
- Returns:
- a list of permissions associated with the given scopes
 
 - 
findpublic List<PermissionTicket> find(RealmModel realm, ResourceServer resourceServer, Map<PermissionTicket.FilterOption,String> attributes, Integer firstResult, Integer maxResult) Description copied from interface:PermissionTicketStoreReturns a list ofPermissionTicket, filtered by the given attributes.- Specified by:
- findin interface- PermissionTicketStore
- Parameters:
- realm- the realm. Cannot be- null.
- resourceServer- a resource server that resulting tickets should belong to. Ignored if- null.
- attributes- a map of keys and values to filter on; possible filter options are given by- PermissionTicket.FilterOption
- firstResult- first result to return. Ignored if negative or- null.
- maxResult- maximum number of results to return. Ignored if negative or- null.
- Returns:
- a list of filtered and paginated permissions
 
 - 
findGrantedpublic List<PermissionTicket> findGranted(ResourceServer resourceServer, String userId) Description copied from interface:PermissionTicketStoreReturns a list ofPermissionTicketgranted to the givenuserId.- Specified by:
- findGrantedin interface- PermissionTicketStore
- Parameters:
- resourceServer- the resource server. Cannot be- null
- userId- the user id
- Returns:
- a list of permissions granted for a particular user
 
 - 
findGrantedpublic List<PermissionTicket> findGranted(ResourceServer resourceServer, String resourceName, String userId) Description copied from interface:PermissionTicketStore- Specified by:
- findGrantedin interface- PermissionTicketStore
- Parameters:
- resourceServer- the resource server. Cannot be- null.
- resourceName- the name of a resource
- userId- the user id
- Returns:
- a list of permissions granted for a particular user TODO: investigate a way how to replace resourceName with Resource class
 
 - 
findGrantedResourcespublic List<Resource> findGrantedResources(RealmModel realm, String requester, String name, Integer first, Integer max) Description copied from interface:PermissionTicketStoreReturns a list ofResourcegranted to the givenrequester- Specified by:
- findGrantedResourcesin interface- PermissionTicketStore
- Parameters:
- realm- realm that is searched. Cannot be- null
- requester- the requester
- name- the keyword to query resources by name or null if any resource
- first- first result to return. Ignored if negative or- null.
- max- maximum number of results to return. Ignored if negative or- null.
- Returns:
- a list of Resourcegranted to the givenrequester
 
 - 
findGrantedOwnerResourcespublic List<Resource> findGrantedOwnerResources(RealmModel realm, String owner, Integer firstResult, Integer maxResults) Description copied from interface:PermissionTicketStoreReturns a list ofResourcegranted by the owner to other users- Specified by:
- findGrantedOwnerResourcesin interface- PermissionTicketStore
- owner- the owner
- firstResult- first result to return. Ignored if negative or- null.
- maxResults- maximum number of results to return. Ignored if negative or- null.
- Returns:
- a list of Resourcegranted by the owner
 
 - 
preRemovepublic void preRemove(RealmModel realm) 
 - 
preRemovepublic void preRemove(RealmModel realm, ResourceServer resourceServer) 
 
- 
 
-