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.
  • Field Details

  • 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

      @PostConstruct public void init() throws Exception
      Overrides:
      init in class com.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

      public boolean hasCollection(String collectionId)
    • 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, IOException
      This 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.SolrAPIException
      IOException
    • addCollectionChangeListener

      public void addCollectionChangeListener(CollectionComponent.CollectionChangeAware listener)
    • cloneListeners

      protected List<CollectionComponent.CollectionChangeAware> cloneListeners()
    • onItemRemoved

      protected void onItemRemoved(String itemPath, com.lucidworks.apollo.store.ItemReadStore.ItemAndVersion<com.lucidworks.apollo.common.models.Collection> item)
      Overrides:
      onItemRemoved in class com.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:
      onItemAdded in class com.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:
      onItemUpdated in class com.lucidworks.apollo.store.ItemCache<com.lucidworks.apollo.common.models.Collection>