Package com.lucidworks.apollo.component
Class CollectionComponent
java.lang.Object
com.lucidworks.apollo.store.AbstractItemReadStore<T>
com.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>
com.lucidworks.apollo.component.CollectionComponent
- All Implemented Interfaces:
com.lucidworks.apollo.store.ItemReadStore<com.lucidworks.apollo.common.models.Collection>,Closeable,AutoCloseable
public class CollectionComponent
extends com.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>
Does basic data reading involving collections. Caches the results internally.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.lucidworks.apollo.store.ItemReadStore
com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<T extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.lucidworks.apollo.store.AbstractItemReadStore
CHARSET, deserializeTimer, getItemTimer, itemPath, itemReader, listItemsTimer, LOG, metricRegistry -
Constructor Summary
ConstructorsConstructorDescriptionCollectionComponent(org.apache.curator.framework.CuratorFramework curator, com.codahale.metrics.MetricRegistry metricRegistry, com.fasterxml.jackson.databind.ObjectMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected List<CollectionComponent.CollectionChangeAware>Optional<com.lucidworks.apollo.common.models.Collection>getCollection(String id) intThis returns the number of collections *that are registered in Apollo.*.booleanhasCollection(String collectionId) voidinit()Collection<com.lucidworks.apollo.common.models.Collection>protected voidonItemAdded(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item) protected voidonItemRemoved(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item) protected voidonItemUpdated(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item) Methods inherited from class com.lucidworks.apollo.store.ItemCache
close, getItem, getItemBytes, getItems, getStorePath, hasItem, listItems, refreshMethods inherited from class com.lucidworks.apollo.store.AbstractItemReadStore
convert, getPath, metricName
-
Field Details
-
collectionChangeListeners
-
-
Constructor Details
-
CollectionComponent
public CollectionComponent(org.apache.curator.framework.CuratorFramework curator, com.codahale.metrics.MetricRegistry metricRegistry, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
init
- Overrides:
initin classcom.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>- Throws:
Exception
-
listCollections
public Collection<com.lucidworks.apollo.common.models.Collection> listCollections() throws com.lucidworks.apollo.store.ItemStoreException- Throws:
com.lucidworks.apollo.store.ItemStoreException
-
hasCollection
-
getCollection
public Optional<com.lucidworks.apollo.common.models.Collection> getCollection(String id) throws com.lucidworks.apollo.store.ItemStoreException - Throws:
com.lucidworks.apollo.store.ItemStoreException
-
getTotalCollectionCount
public int getTotalCollectionCount() throws com.lucidworks.apollo.client.SolrAPIException, IOExceptionThis returns the number of collections *that are registered in Apollo.*. Not the total number of collections in all the Solr instances Apollo knows about.- Returns:
- Throws:
com.lucidworks.apollo.client.SolrAPIExceptionIOException
-
addCollectionChangeListener
-
cloneListeners
-
onItemRemoved
protected void onItemRemoved(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item) - Overrides:
onItemRemovedin classcom.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>
-
onItemAdded
protected void onItemAdded(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item) - Overrides:
onItemAddedin classcom.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>
-
onItemUpdated
protected void onItemUpdated(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item) - Overrides:
onItemUpdatedin classcom.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>
-