E - the type of the backend-specific class representing entities and relationships.public abstract class BaseInventory<E> extends Object implements Inventory
Inventory that converts the API traversals into trees of filters that it then passes
for evaluation to a backend.
This class is meant to be inherited by the implementation that should provide the initialization and cleanup logic.
| Modifier and Type | Field and Description |
|---|---|
static Configuration.Property |
TRANSACTION_RETRIES |
| Constructor and Description |
|---|
BaseInventory() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract InventoryBackend<E> |
doInitialize(Configuration configuration)
This method is called during
initialize(Configuration) and provides the instance of the backend
initialized from the configuration. |
InventoryBackend<E> |
getBackend()
WARNING: This is not meant for general consumption but primarily for testing purposes.
|
boolean |
hasObservers(Interest<?,?> interest)
This method is mainly useful for testing.
|
void |
initialize(Configuration configuration)
Initializes the inventory from the provided configuration object.
|
<C,V> rx.Observable<C> |
observable(Interest<C,V> interest)
NOTE: The subscribers will receive the notifications even after they failed.
|
Relationships.Read |
relationships()
Global access to all relationships.
|
Tenants.ReadWrite |
tenants()
Entry point into the inventory.
|
public static final Configuration.Property TRANSACTION_RETRIES
public final void initialize(Configuration configuration)
Inventoryinitialize in interface Inventoryconfiguration - the configuration to use.protected abstract InventoryBackend<E> doInitialize(Configuration configuration)
initialize(Configuration) and provides the instance of the backend
initialized from the configuration.configuration - the configuration provided by the userpublic final void close()
throws Exception
close in interface AutoCloseableExceptionpublic Tenants.ReadWrite tenants()
InventoryResolvingToSingle.get(Object)) or
more (ResolvingToMultiple.getAll(org.hawkular.inventory.api.filters.Filter...))
tenants and navigate further to the entities of interest.public Relationships.Read relationships()
InventoryTo create relationships, first navigate to one of its endpoint entities and create it from there using the API calls.
relationships in interface Inventorypublic InventoryBackend<E> getBackend()
public boolean hasObservers(Interest<?,?> interest)
InventoryhasObservers in interface Inventoryinterest - the interest in changes of some inventory entity typepublic <C,V> rx.Observable<C> observable(Interest<C,V> interest)
Inventoryobservable in interface InventoryC - the type of object that will be passed to the subscribers of the returned observableV - the type of the entity the interest is expressed oninterest - the interest in changes of some inventory entity typeCopyright © 2015 Red Hat, Inc.. All rights reserved.