Package org.dizitart.no2.store
Class AbstractNitriteStore<Config extends StoreConfig>
- java.lang.Object
-
- org.dizitart.no2.store.AbstractNitriteStore<Config>
-
- Type Parameters:
Config- the type of the store configuration object
- All Implemented Interfaces:
AutoCloseable,NitritePlugin,NitriteStore<Config>
public abstract class AbstractNitriteStore<Config extends StoreConfig> extends Object implements NitriteStore<Config>
An abstract implementation of theNitriteStoreinterface that provides common functionality for Nitrite data stores.- Since:
- 4.0
- Author:
- Anindya Chatterjee
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeClose()This method is called before closing the store.StoreCataloggetCatalog()Gets the store catalog.Set<String>getCollectionNames()Returns a set of all collection names in the store.org.dizitart.no2.common.event.NitriteEventBus<EventInfo,StoreEventListener>getEventBus()The event bus used to publish and subscribe to store events.Map<String,Set<String>>getKeyedRepositoryRegistry()Returns a set of all the keyed-repository names registered in the Nitrite store.NitriteConfiggetNitriteConfig()The NitriteConfig object that holds the configuration for the Nitrite database.Set<String>getRepositoryRegistry()Returns a set of all the repository names registered in the Nitrite store.StoreCataloggetStoreCatalog()The catalog of all the collections and repositories in the Nitrite database.ConfiggetStoreConfig()The configuration object for the Nitrite store.voidinitialize(NitriteConfig nitriteConfig)Initializes the plugin instance.voidsetStoreConfig(Config storeConfig)The configuration object for the Nitrite store.voidsubscribe(StoreEventListener listener)Subscribes aStoreEventListenerto this store.voidunsubscribe(StoreEventListener listener)Unsubscribes aStoreEventListenerfrom this store.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dizitart.no2.common.module.NitritePlugin
close
-
Methods inherited from interface org.dizitart.no2.store.NitriteStore
closeMap, closeRTree, commit, getStoreVersion, hasMap, hasUnsavedChanges, isClosed, isReadOnly, openMap, openOrCreate, openRTree, removeMap, removeRTree
-
-
-
-
Method Detail
-
getCollectionNames
public Set<String> getCollectionNames()
Description copied from interface:NitriteStoreReturns a set of all collection names in the store.- Specified by:
getCollectionNamesin interfaceNitriteStore<Config extends StoreConfig>- Returns:
- a set of all collection names in the store
-
getRepositoryRegistry
public Set<String> getRepositoryRegistry()
Description copied from interface:NitriteStoreReturns a set of all the repository names registered in the Nitrite store.- Specified by:
getRepositoryRegistryin interfaceNitriteStore<Config extends StoreConfig>- Returns:
- a set of all the repository names registered in the Nitrite store
-
getKeyedRepositoryRegistry
public Map<String,Set<String>> getKeyedRepositoryRegistry()
Description copied from interface:NitriteStoreReturns a set of all the keyed-repository names registered in the Nitrite store.- Specified by:
getKeyedRepositoryRegistryin interfaceNitriteStore<Config extends StoreConfig>- Returns:
- a set of all the keyed-repository names registered in the Nitrite store
-
beforeClose
public void beforeClose()
Description copied from interface:NitriteStoreThis method is called before closing the store. Any cleanup or finalization tasks should be performed in this method.- Specified by:
beforeClosein interfaceNitriteStore<Config extends StoreConfig>
-
subscribe
public void subscribe(StoreEventListener listener)
Description copied from interface:NitriteStoreSubscribes aStoreEventListenerto this store. The listener will be notified of any changes made to the store.- Specified by:
subscribein interfaceNitriteStore<Config extends StoreConfig>- Parameters:
listener- the listener to subscribe
-
unsubscribe
public void unsubscribe(StoreEventListener listener)
Description copied from interface:NitriteStoreUnsubscribes aStoreEventListenerfrom this store.- Specified by:
unsubscribein interfaceNitriteStore<Config extends StoreConfig>- Parameters:
listener- the listener to unsubscribe
-
initialize
public void initialize(NitriteConfig nitriteConfig)
Description copied from interface:NitritePluginInitializes the plugin instance.- Specified by:
initializein interfaceNitritePlugin- Parameters:
nitriteConfig- the nitrite config
-
getCatalog
public StoreCatalog getCatalog()
Description copied from interface:NitriteStoreGets the store catalog.- Specified by:
getCatalogin interfaceNitriteStore<Config extends StoreConfig>- Returns:
- the catalog
-
getStoreConfig
public Config getStoreConfig()
The configuration object for the Nitrite store.- Specified by:
getStoreConfigin interfaceNitriteStore<Config extends StoreConfig>- Returns:
- the store config
-
getEventBus
public org.dizitart.no2.common.event.NitriteEventBus<EventInfo,StoreEventListener> getEventBus()
The event bus used to publish and subscribe to store events.
-
getNitriteConfig
public NitriteConfig getNitriteConfig()
The NitriteConfig object that holds the configuration for the Nitrite database.
-
getStoreCatalog
public StoreCatalog getStoreCatalog()
The catalog of all the collections and repositories in the Nitrite database.
-
setStoreConfig
public void setStoreConfig(Config storeConfig)
The configuration object for the Nitrite store.
-
-