Class StoreFactoryCacheSession.ResourceCache
- java.lang.Object
- 
- org.keycloak.models.cache.infinispan.authorization.StoreFactoryCacheSession.ResourceCache
 
- 
- All Implemented Interfaces:
- ResourceStore
 - Enclosing class:
- StoreFactoryCacheSession
 
 protected class StoreFactoryCacheSession.ResourceCache extends Object implements ResourceStore 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedResourceCache()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Resourcecreate(ResourceServer resourceServer, String id, String name, String owner)Creates aResourceinstance backed by this persistent storage implementation.voiddelete(RealmModel realm, String id)Removes aResourceinstance, with the givenidfrom the persistent storage.List<Resource>find(RealmModel realm, ResourceServer resourceServer, Map<Resource.FilterOption,String[]> attributes, Integer firstResult, Integer maxResults)Finds allResourceinstances associated with a given resource server.ResourcefindById(RealmModel realm, ResourceServer resourceServer, String id)Returns aResourceinstance based on its identifier.ResourcefindByName(ResourceServer resourceServer, String name, String ownerId)Find aResourceby its name where the owner is the givenownerId.List<Resource>findByOwner(RealmModel realm, ResourceServer resourceServer, String ownerId)Finds allResourceinstances with the givenownerId.voidfindByOwner(RealmModel realm, ResourceServer resourceServer, String ownerId, Consumer<Resource> consumer)List<Resource>findByResourceServer(ResourceServer resourceServer)Finds allResourceinstances associated with a given resource server.List<Resource>findByScopes(ResourceServer resourceServer, Set<Scope> scopes)Finds allResourceassociated with a given scope.voidfindByScopes(ResourceServer resourceServer, Set<Scope> scopes, Consumer<Resource> consumer)List<Resource>findByType(ResourceServer resourceServer, String type)Finds allResourcefromResourceServerwith the given type.voidfindByType(ResourceServer resourceServer, String type, String owner, Consumer<Resource> consumer)Finds allResourcewith the given type.voidfindByType(ResourceServer resourceServer, String type, Consumer<Resource> consumer)Finds allResourcefromResourceServerwith the given type.voidfindByTypeInstance(ResourceServer resourceServer, String type, Consumer<Resource> consumer)Finds allResourceby type where client represented by theresourceServeris not the owner- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.authorization.store.ResourceStorecreate, findByName
 
- 
 
- 
- 
- 
Method Detail- 
createpublic Resource create(ResourceServer resourceServer, String id, String name, String owner) Description copied from interface:ResourceStoreCreates a Resourceinstance backed by this persistent storage implementation.- Specified by:
- createin interface- ResourceStore
- Parameters:
- resourceServer- the resource server to where the given resource belongs to. Cannot be- null.
- id- the id of this resource. It must be unique. Will be randomly generated if null.
- name- the name of this resource. It must be unique.
- owner- the owner of this resource or null if the resource server is the owner
- Returns:
- an instance backed by the underlying storage implementation
 
 - 
deletepublic void delete(RealmModel realm, String id) Description copied from interface:ResourceStoreRemoves aResourceinstance, with the givenidfrom the persistent storage.- Specified by:
- deletein interface- ResourceStore
- Parameters:
- realm- the realm. Cannot be- null.
- id- the identifier of an existing resource instance
 
 - 
findByIdpublic Resource findById(RealmModel realm, ResourceServer resourceServer, String id) Description copied from interface:ResourceStoreReturns aResourceinstance based on its identifier.- Specified by:
- findByIdin interface- ResourceStore
- Parameters:
- realm- the realm. Cannot be- null.
- resourceServer- the resource server. Ignored if- null
- id- the identifier of an existing resource instance
- Returns:
- the resource instance with the given identifier or null if no instance was found
 
 - 
findByNamepublic Resource findByName(ResourceServer resourceServer, String name, String ownerId) Description copied from interface:ResourceStoreFind aResourceby its name where the owner is the givenownerId.- Specified by:
- findByNamein interface- ResourceStore
- Parameters:
- resourceServer- the identifier of the resource server. Cannot be- null.
- name- the name of the resource
- ownerId- the owner id
- Returns:
- a resource with the given name
 
 - 
findByOwnerpublic List<Resource> findByOwner(RealmModel realm, ResourceServer resourceServer, String ownerId) Description copied from interface:ResourceStoreFinds allResourceinstances with the givenownerId.- Specified by:
- findByOwnerin interface- ResourceStore
- Parameters:
- realm- the realm. Cannot be- null.
- resourceServer- resource server. Ignored if- null
- ownerId- the identifier of the owner
- Returns:
- a list with all resource instances owned by the given owner
 
 - 
findByOwnerpublic void findByOwner(RealmModel realm, ResourceServer resourceServer, String ownerId, Consumer<Resource> consumer) - Specified by:
- findByOwnerin interface- ResourceStore
 
 - 
findByResourceServerpublic List<Resource> findByResourceServer(ResourceServer resourceServer) Description copied from interface:ResourceStoreFinds allResourceinstances associated with a given resource server.- Specified by:
- findByResourceServerin interface- ResourceStore
- Parameters:
- resourceServer- the identifier of the resource server. Cannot be- null.
- Returns:
- a list with all resources associated with the given resource server
 
 - 
findpublic List<Resource> find(RealmModel realm, ResourceServer resourceServer, Map<Resource.FilterOption,String[]> attributes, Integer firstResult, Integer maxResults) Description copied from interface:ResourceStoreFinds allResourceinstances associated with a given resource server.- Specified by:
- findin interface- ResourceStore
- Parameters:
- realm- the realm. Cannot be- null.
- resourceServer- the identifier of the resource server. Ignored if- null.
- attributes- a map holding the attributes that will be used as a filter; possible filter options are given by- Resource.FilterOption
- 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 with all resources associated with the given resource server
 
 - 
findByScopespublic List<Resource> findByScopes(ResourceServer resourceServer, Set<Scope> scopes) Description copied from interface:ResourceStoreFinds allResourceassociated with a given scope.- Specified by:
- findByScopesin interface- ResourceStore
- Parameters:
- resourceServer- the resource server. Cannot be- null.
- scopes- one or more scope identifiers
- Returns:
- a list of resources associated with the given scope(s)
 
 - 
findByScopespublic void findByScopes(ResourceServer resourceServer, Set<Scope> scopes, Consumer<Resource> consumer) - Specified by:
- findByScopesin interface- ResourceStore
 
 - 
findByTypepublic List<Resource> findByType(ResourceServer resourceServer, String type) Description copied from interface:ResourceStoreFinds allResourcefromResourceServerwith the given type.- Specified by:
- findByTypein interface- ResourceStore
- Parameters:
- resourceServer- the resource server. Cannot be- null.
- type- the type of the resource
- Returns:
- a list of resources with the given type
 
 - 
findByTypepublic void findByType(ResourceServer resourceServer, String type, Consumer<Resource> consumer) Description copied from interface:ResourceStoreFinds allResourcefromResourceServerwith the given type.- Specified by:
- findByTypein interface- ResourceStore
- Parameters:
- resourceServer- the resource server id. Cannot be- null.
- type- the type of the resource
- consumer- the result consumer
 
 - 
findByTypepublic void findByType(ResourceServer resourceServer, String type, String owner, Consumer<Resource> consumer) Description copied from interface:ResourceStoreFinds allResourcewith the given type.- Specified by:
- findByTypein interface- ResourceStore
- Parameters:
- resourceServer- the resource server id. Cannot be- null
- type- the type of the resource
- owner- the resource owner or null for any resource with a given type
- consumer- the result consumer
 
 - 
findByTypeInstancepublic void findByTypeInstance(ResourceServer resourceServer, String type, Consumer<Resource> consumer) Description copied from interface:ResourceStoreFinds allResourceby type where client represented by theresourceServeris not the owner- Specified by:
- findByTypeInstancein interface- ResourceStore
- Parameters:
- resourceServer- the resourceServer. Cannot be- null.
- type- searched type
- consumer- a consumer that will be fed with the resulting resources
 
 
- 
 
-