Package org.graylog2.lookup
Class LookupTableService
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.graylog2.lookup.LookupTableService
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
@Singleton
public class LookupTableService
extends com.google.common.util.concurrent.AbstractIdleService
This service maintains the in-memory adapters, caches and lookup table instances.
It initially loads all entities and starts them, and later reacts on event bus messages to reflect the current system state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected classstatic classNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Constructor Summary
ConstructorsConstructorDescriptionLookupTableService(LookupTableConfigService configService, Map<String, LookupCache.Factory> cacheFactories, Map<String, LookupDataAdapter.Factory> adapterFactories, Map<String, LookupDataAdapter.Factory2> adapterFactories2, Map<String, LookupDataAdapter.Factory2> systemAdapterFactories, ScheduledExecutorService scheduler, com.google.common.eventbus.EventBus eventBus) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddListeners(LookupDataAdapter adapter, DataAdapterDto dto) protected LookupDataAdapterprotected CountDownLatchprotected LookupTableConfigServicegetDataAdapters(Set<String> adapterNames) protected ScheduledExecutorServicevoidhandleAdapterDelete(DataAdaptersDeleted deleted) voidvoidhandleAdapterUpdate(DataAdaptersUpdated updated) voidhandleCacheDelete(CachesDeleted deleted) voidhandleCacheUpdate(CachesUpdated updated) voidvoidbooleannewCachePurge(String tableName) protected voidshutDown()protected voidstartUp()Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Constructor Details
-
LookupTableService
@Inject public LookupTableService(LookupTableConfigService configService, Map<String, LookupCache.Factory> cacheFactories, Map<String, LookupDataAdapter.Factory> adapterFactories, Map<String, LookupDataAdapter.Factory2> adapterFactories2, Map<String, LookupDataAdapter.Factory2> systemAdapterFactories, @Named("daemonScheduler") ScheduledExecutorService scheduler, com.google.common.eventbus.EventBus eventBus)
-
-
Method Details
-
getConfigService
-
getScheduler
-
startUp
- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
shutDown
- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService- Throws:
Exception
-
handleAdapterUpdate
-
handleAdapterDelete
-
handleCacheUpdate
-
handleCacheDelete
-
handleLookupTableUpdate
-
handleLookupTableDelete
-
createAndStartAdapters
-
createAdapter
-
addListeners
-
newCachePurge
-
newBuilder
-
getTable
-
hasTable
-
getDataAdapters
-
getCaches
-