protected class StoreFactoryCacheSession.ResourceCache extends Object implements ResourceStore
Modifier | Constructor and Description |
---|---|
protected |
ResourceCache() |
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 . |
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<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. |
List<Resource> |
findByScope(List<String> ids,
String resourceServerId)
Finds all
Resource associated with a given scope. |
void |
findByScope(List<String> ids,
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create
public Resource create(String id, String name, ResourceServer resourceServer, String owner)
ResourceStore
Creates a Resource
instance backed by this persistent storage implementation.
create
in interface ResourceStore
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.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)
ResourceStore
Resource
instance, with the given id
from the persistent storage.delete
in interface ResourceStore
id
- the identifier of an existing resource instancepublic Resource findById(String id, String resourceServerId)
ResourceStore
Resource
instance based on its identifier.findById
in interface ResourceStore
id
- the identifier of an existing resource instancepublic Resource findByName(String name, String resourceServerId)
ResourceStore
Resource
by its name where the owner is the resource server itself.findByName
in interface ResourceStore
name
- the name of the resourceresourceServerId
- the identifier of the resource serverpublic Resource findByName(String name, String ownerId, String resourceServerId)
ResourceStore
Resource
by its name where the owner is the given ownerId
.findByName
in interface ResourceStore
name
- the name of the resourceownerId
- the owner idresourceServerId
- the identifier of the resource serverpublic List<Resource> findByOwner(String ownerId, String resourceServerId)
ResourceStore
Resource
instances with the given ownerId
.findByOwner
in interface ResourceStore
ownerId
- the identifier of the ownerpublic void findByOwner(String ownerId, String resourceServerId, Consumer<Resource> consumer)
findByOwner
in interface ResourceStore
public List<Resource> findByOwner(String ownerId, String resourceServerId, int first, int max)
findByOwner
in interface ResourceStore
public List<Resource> findByUri(String uri, String resourceServerId)
ResourceStore
Resource
instances with the given uri.findByUri
in interface ResourceStore
uri
- the identifier of the uripublic List<Resource> findByResourceServer(String resourceServerId)
ResourceStore
Resource
instances associated with a given resource server.findByResourceServer
in interface ResourceStore
resourceServerId
- the identifier of the resource serverpublic List<Resource> findByResourceServer(Map<Resource.FilterOption,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
ResourceStore
Resource
instances associated with a given resource server.findByResourceServer
in interface ResourceStore
attributes
- a map holding the attributes that will be used as a filter; possible filter options are given by Resource.FilterOption
resourceServerId
- the identifier of the resource serverpublic List<Resource> findByScope(List<String> ids, String resourceServerId)
ResourceStore
Resource
associated with a given scope.findByScope
in interface ResourceStore
ids
- one or more scope identifierspublic void findByScope(List<String> ids, String resourceServerId, Consumer<Resource> consumer)
findByScope
in interface ResourceStore
public List<Resource> findByType(String type, String resourceServerId)
ResourceStore
Resource
with the given type.findByType
in interface ResourceStore
type
- the type of the resourcepublic void findByType(String type, String resourceServerId, Consumer<Resource> consumer)
ResourceStore
Resource
with the given type.findByType
in interface ResourceStore
type
- the type of the resourceresourceServerId
- the resource server idconsumer
- the result consumerpublic List<Resource> findByType(String type, String owner, String resourceServerId)
ResourceStore
Resource
with the given type.findByType
in interface ResourceStore
type
- the type of the resourceowner
- the resource owner or null for any resource with a given typepublic void findByType(String type, String owner, String resourceServerId, Consumer<Resource> consumer)
ResourceStore
Resource
with the given type.findByType
in interface ResourceStore
type
- the type of the resourceowner
- the resource owner or null for any resource with a given typeresourceServerId
- the resource server idconsumer
- the result consumerpublic List<Resource> findByTypeInstance(String type, String resourceServerId)
findByTypeInstance
in interface ResourceStore
public void findByTypeInstance(String type, String resourceServerId, Consumer<Resource> consumer)
findByTypeInstance
in interface ResourceStore
Copyright © 2021 JBoss by Red Hat. All rights reserved.