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
Modifier and TypeClassDescriptionstatic class
protected class
static class
Nested 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
ConstructorDescriptionLookupTableService
(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 void
addListeners
(LookupDataAdapter adapter, DataAdapterDto dto) protected LookupDataAdapter
protected CountDownLatch
protected LookupTableConfigService
getDataAdapters
(Set<String> adapterNames) protected ScheduledExecutorService
void
handleAdapterDelete
(DataAdaptersDeleted deleted) void
void
handleAdapterUpdate
(DataAdaptersUpdated updated) void
handleCacheDelete
(CachesDeleted deleted) void
handleCacheUpdate
(CachesUpdated updated) void
void
boolean
newCachePurge
(String tableName) protected void
shutDown()
protected void
startUp()
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:
startUp
in classcom.google.common.util.concurrent.AbstractIdleService
- Throws:
Exception
-
shutDown
- Specified by:
shutDown
in classcom.google.common.util.concurrent.AbstractIdleService
- Throws:
Exception
-
handleAdapterUpdate
-
handleAdapterDelete
-
handleCacheUpdate
-
handleCacheDelete
-
handleLookupTableUpdate
-
handleLookupTableDelete
-
createAndStartAdapters
-
createAdapter
-
addListeners
-
newCachePurge
-
newBuilder
-
getTable
-
hasTable
-
getDataAdapters
-
getCaches
-