public interface ResourceService
Resource. A Resource can be anything that is meant to be protected by the consumer modules. For
instance, a Resource could be an Alert, an Inventory item or a Metric. Can be injected via CDI into managed beans
as follows:
@Inject ResourceService resourceService;
Concrete implementations do not hold any state, but it's advised to get an instance through CDI or as an EJB.| Modifier and Type | Method and Description |
|---|---|
Resource |
create(String id,
Persona persona)
|
Resource |
create(String id,
Resource parent)
Creates a new sub resource, based on a given ID and owning resource
|
Resource |
create(String id,
Resource parent,
Persona persona)
Creates a new sub resource, based on a given ID, parent and owned by the specified
Persona |
void |
delete(String id)
Removes a
Resource based on its ID. |
Resource |
get(String id)
Retrieves a
Resource based on its ID. |
Resource get(String id)
Resource based on its ID.id - the resource's IDResource or null if the resource doesn't exists.IllegalArgumentException - if the given ID is nullResource create(String id, Persona persona)
id - the ID to be assigned to this resource or null for a new UUIDpersona - a valid owner for this resourceResourceIllegalArgumentException - if the persona is nullResource create(String id, Resource parent)
id - the ID to be assigned to this resource or null for a new UUIDparent - a valid resource to serve as the parent of this sub resourceResourceIllegalArgumentException - if the parent is nullResource create(String id, Resource parent, Persona persona)
Personaid - the ID to be assigned to this resource or null for a new UUIDparent - the resource's parent or null if the owner is providedpersona - the resource's owner or null if the parent is providedResourceIllegalArgumentException - if both the parent and the owner are nullvoid delete(String id)
Resource based on its ID.id - the resource's IDIllegalArgumentException - if the given ID is nullCopyright © 2015 Red Hat, Inc.. All rights reserved.