public interface ResourceStore
ResourceStore
is responsible to manage the persistence of Resource
instances.Modifier and Type | Method and Description |
---|---|
Resource |
create(String name,
ResourceServer resourceServer,
String owner)
Creates a
Resource instance backed by this persistent storage implementation. |
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 . |
List<Resource> |
findByOwner(String ownerId,
String resourceServerId)
Finds all
Resource instances with 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<String,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. |
List<Resource> |
findByScope(List<String> id,
String resourceServerId)
Finds all
Resource associated with a given scope. |
void |
findByScope(List<String> scopes,
String resourceServerId,
Consumer<Resource> consumer) |
List<Resource> |
findByType(String type,
String resourceServerId)
Finds all
Resource with the given type. |
void |
findByType(String type,
String resourceServerId,
Consumer<Resource> consumer)
Finds all
Resource with the given type. |
List<Resource> |
findByType(String type,
String owner,
String resourceServerId)
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. |
List<Resource> |
findByTypeInstance(String type,
String resourceServerId) |
void |
findByTypeInstance(String type,
String resourceServerId,
Consumer<Resource> consumer) |
List<Resource> |
findByUri(String uri,
String resourceServerId)
Finds all
Resource instances with the given uri. |
Resource create(String name, ResourceServer resourceServer, String owner)
Creates a Resource
instance backed by this persistent storage implementation.
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 ownerResource create(String id, String name, ResourceServer resourceServer, String owner)
Creates a Resource
instance backed by this persistent storage implementation.
id
- the id of this resource. It must be unique.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 ownervoid delete(String id)
Resource
instance, with the given id
from the persistent storage.id
- the identifier of an existing resource instanceResource findById(String id, String resourceServerId)
Resource
instance based on its identifier.id
- the identifier of an existing resource instanceList<Resource> findByOwner(String ownerId, String resourceServerId)
Resource
instances with the given ownerId
.ownerId
- the identifier of the ownerList<Resource> findByUri(String uri, String resourceServerId)
Resource
instances with the given uri.uri
- the identifier of the uriList<Resource> findByResourceServer(String resourceServerId)
Resource
instances associated with a given resource server.resourceServerId
- the identifier of the resource serverList<Resource> findByResourceServer(Map<String,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
Resource
instances associated with a given resource server.attributes
- a map holding the attributes that will be used as a filterresourceServerId
- the identifier of the resource serverList<Resource> findByScope(List<String> id, String resourceServerId)
Resource
associated with a given scope.id
- one or more scope identifiersvoid findByScope(List<String> scopes, String resourceServerId, Consumer<Resource> consumer)
Resource findByName(String name, String resourceServerId)
Resource
by its name where the owner is the resource server itself.name
- the name of the resourceresourceServerId
- the identifier of the resource serverResource findByName(String name, String ownerId, String resourceServerId)
Resource
by its name where the owner is the given ownerId
.name
- the name of the resourceownerId
- the owner idresourceServerId
- the identifier of the resource serverList<Resource> findByType(String type, String resourceServerId)
Resource
with the given type.type
- the type of the resourceList<Resource> findByType(String type, String owner, String resourceServerId)
Resource
with the given type.type
- the type of the resourceowner
- the resource owner or null for any resource with a given typevoid findByType(String type, String resourceServerId, Consumer<Resource> consumer)
Resource
with the given type.type
- the type of the resourceresourceServerId
- the resource server idconsumer
- the result consumervoid findByType(String type, String owner, String resourceServerId, Consumer<Resource> consumer)
Resource
with the given type.type
- the type of the resourceowner
- the resource owner or null for any resource with a given typeresourceServerId
- the resource server idconsumer
- the result consumerCopyright © 2020 JBoss by Red Hat. All rights reserved.