public static class EmptyInventory.MetricsReadWrite extends Object implements Metrics.ReadWrite
| Constructor and Description |
|---|
MetricsReadWrite() |
| Modifier and Type | Method and Description |
|---|---|
Metrics.Single |
create(Metric.Blueprint blueprint)
Creates a new entity at the current position in the inventory traversal.
|
void |
delete(String id)
Deletes an entity with the provided id from the current position in the inventory traversal.
|
Metrics.Single |
get(String id)
Tries to find a single entity in the current position in the inventory traversal.
|
Metrics.Multiple |
getAll(Filter[][] filters)
Returns access interface to all entities conforming to the provided filters in the current position in the
inventory traversal.
|
void |
update(String id,
Metric.Update update)
Persists the provided entity on the current position in the inventory traversal.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllpublic Metrics.Multiple getAll(Filter[][] filters)
ResolvingToMultipleThe filters parameter is actually composed of individual sets of filters each of which is applied to the "source" entities. Each set can have multiple filters that are then applied one after another on their intermediate results. This becomes useful when you want to filter by sources having some kind of relationships with other entities and in addition filter on the sources themselves, too. E.g.:
inventory.tenants().getAll(new Filter[][]{{Related.by("myRel"), With.type(ResourceType.class)},
{With.id("asf")}}).entities();
The filter above would first check that the tenants in question have a relationship called "myRel" with some
resource types and then would also check if the tenant has ID "asf".filters - the sets of filters to applypublic Metrics.Single get(String id) throws EntityNotFoundException
ResolvingToSingleid - the identification of sorts of the entity to find in the current traversal positionEntityNotFoundExceptionpublic Metrics.Single create(Metric.Blueprint blueprint) throws EntityAlreadyExistsException
WriteInterfaceblueprint - the blueprint to be used to create the new entityEntityAlreadyExistsException - if the entity already existspublic void update(String id, Metric.Update update) throws EntityNotFoundException
WriteInterfaceid - the id of the entity to updateupdate - the updates to the entityEntityNotFoundException - if the entity is not found in the databasepublic void delete(String id) throws EntityNotFoundException
WriteInterfaceid - the id of the entity to deleteEntityNotFoundException - if an entity with given ID doesn't exist on the current postion in the inventory
traversalCopyright © 2015 Red Hat, Inc.. All rights reserved.