public class JPAResourceStore extends Object implements ResourceStore
Constructor and Description |
---|
JPAResourceStore(javax.persistence.EntityManager entityManager) |
Modifier and Type | Method and Description |
---|---|
Resource |
create(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)
Returns a
Resource instance based on its identifier. |
Resource |
findByName(String name,
String resourceServerId)
Find a
Resource by its name. |
List<Resource> |
findByOwner(String ownerId)
Finds all
Resource instances with the given ownerId . |
List |
findByResourceServer(String resourceServerId)
Finds all
Resource instances associated with a given resource server. |
List<Resource> |
findByScope(String... id)
Finds all
Resource associated with a given scope. |
List<Resource> |
findByType(String type)
Finds all
Resource with the given type. |
public JPAResourceStore(javax.persistence.EntityManager entityManager)
public Resource create(String name, ResourceServer resourceServer, String owner)
ResourceStore
Creates a Resource
instance backed by this persistent storage implementation.
create
in interface ResourceStore
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)
ResourceStore
Resource
instance based on its identifier.findById
in interface ResourceStore
id
- the identifier of an existing resource instancepublic List<Resource> findByOwner(String ownerId)
ResourceStore
Resource
instances with the given ownerId
.findByOwner
in interface ResourceStore
ownerId
- the identifier of the ownerpublic List 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> findByScope(String... id)
ResourceStore
Resource
associated with a given scope.findByScope
in interface ResourceStore
id
- one or more scope identifierspublic Resource findByName(String name, String resourceServerId)
ResourceStore
Resource
by its name.findByName
in interface ResourceStore
name
- the name of the resourceresourceServerId
- the identifier of the resource serverpublic List<Resource> findByType(String type)
ResourceStore
Resource
with the given type.findByType
in interface ResourceStore
type
- the type of the resourceCopyright © 2016 JBoss by Red Hat. All rights reserved.