public class MapResourceStore extends Object implements ResourceStore
| Constructor and Description |
|---|
MapResourceStore(KeycloakSession session,
MapStorage<MapResourceEntity,Resource> resourceStore,
AuthorizationProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
create(String id,
String name,
ResourceServer resourceServer,
String owner)
Creates a
Resource instance backed by this persistent storage implementation. |
void |
delete(String id)
Removes a
Resource instance, with the given id from the persistent storage. |
Resource |
findById(String id,
String resourceServerId)
Returns a
Resource instance based on its identifier. |
Resource |
findByName(String name,
String resourceServerId)
Find a
Resource by its name where the owner is the resource server itself. |
Resource |
findByName(String name,
String ownerId,
String resourceServerId)
Find a
Resource by its name where the owner is the given ownerId. |
void |
findByOwner(String ownerId,
String resourceServerId,
Consumer<Resource> consumer) |
List<Resource> |
findByOwner(String ownerId,
String resourceServerId,
int first,
int max) |
List<Resource> |
findByResourceServer(Map<Resource.FilterOption,String[]> attributes,
String resourceServerId,
int firstResult,
int maxResult)
Finds all
Resource instances associated with a given resource server. |
List<Resource> |
findByResourceServer(String resourceServerId)
Finds all
Resource instances associated with a given resource server. |
void |
findByScope(List<String> scopes,
String resourceServerId,
Consumer<Resource> consumer) |
void |
findByType(String type,
String resourceServerId,
Consumer<Resource> consumer)
Finds all
Resource with the given type. |
void |
findByType(String type,
String owner,
String resourceServerId,
Consumer<Resource> consumer)
Finds all
Resource with the given type. |
void |
findByTypeInstance(String type,
String resourceServerId,
Consumer<Resource> consumer) |
List<Resource> |
findByUri(String uri,
String resourceServerId)
Finds all
Resource instances with the given uri. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, findByOwner, findByScope, findByType, findByType, findByTypeInstancepublic MapResourceStore(KeycloakSession session, MapStorage<MapResourceEntity,Resource> resourceStore, AuthorizationProvider provider)
public Resource create(String id, String name, ResourceServer resourceServer, String owner)
ResourceStoreCreates a Resource instance backed by this persistent storage implementation.
create in interface ResourceStoreid - 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.resourceServer - the resource server to where the given resource belongs toowner - the owner of this resource or null if the resource server is the ownerpublic void delete(String id)
ResourceStoreResource instance, with the given id from the persistent storage.delete in interface ResourceStoreid - the identifier of an existing resource instancepublic Resource findById(String id, String resourceServerId)
ResourceStoreResource instance based on its identifier.findById in interface ResourceStoreid - the identifier of an existing resource instancepublic void findByOwner(String ownerId, String resourceServerId, Consumer<Resource> consumer)
findByOwner in interface ResourceStorepublic List<Resource> findByOwner(String ownerId, String resourceServerId, int first, int max)
findByOwner in interface ResourceStorepublic List<Resource> findByUri(String uri, String resourceServerId)
ResourceStoreResource instances with the given uri.findByUri in interface ResourceStoreuri - the identifier of the uripublic List<Resource> findByResourceServer(String resourceServerId)
ResourceStoreResource instances associated with a given resource server.findByResourceServer in interface ResourceStoreresourceServerId - the identifier of the resource serverpublic List<Resource> findByResourceServer(Map<Resource.FilterOption,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
ResourceStoreResource instances associated with a given resource server.findByResourceServer in interface ResourceStoreattributes - a map holding the attributes that will be used as a filter; possible filter options are given by Resource.FilterOptionresourceServerId - the identifier of the resource serverpublic void findByScope(List<String> scopes, String resourceServerId, Consumer<Resource> consumer)
findByScope in interface ResourceStorepublic Resource findByName(String name, String resourceServerId)
ResourceStoreResource by its name where the owner is the resource server itself.findByName in interface ResourceStorename - the name of the resourceresourceServerId - the identifier of the resource serverpublic Resource findByName(String name, String ownerId, String resourceServerId)
ResourceStoreResource by its name where the owner is the given ownerId.findByName in interface ResourceStorename - the name of the resourceownerId - the owner idresourceServerId - the identifier of the resource serverpublic void findByType(String type, String resourceServerId, Consumer<Resource> consumer)
ResourceStoreResource with the given type.findByType in interface ResourceStoretype - the type of the resourceresourceServerId - the resource server idconsumer - the result consumerpublic void findByType(String type, String owner, String resourceServerId, Consumer<Resource> consumer)
ResourceStoreResource with the given type.findByType in interface ResourceStoretype - the type of the resourceowner - the resource owner or null for any resource with a given typeresourceServerId - the resource server idconsumer - the result consumerpublic void findByTypeInstance(String type, String resourceServerId, Consumer<Resource> consumer)
findByTypeInstance in interface ResourceStoreCopyright © 2021 JBoss by Red Hat. All rights reserved.