public abstract class LookupDataAdapter
extends com.google.common.util.concurrent.AbstractIdleService
| Modifier and Type | Class and Description |
|---|---|
static class |
LookupDataAdapter.Descriptor<C extends LookupDataAdapterConfiguration> |
static interface |
LookupDataAdapter.Factory<T extends LookupDataAdapter> |
static interface |
LookupDataAdapter.Factory2<T extends LookupDataAdapter> |
| Modifier | Constructor and Description |
|---|---|
protected |
LookupDataAdapter(DataAdapterDto dto,
com.codahale.metrics.MetricRegistry metricRegistry) |
protected |
LookupDataAdapter(String id,
String name,
LookupDataAdapterConfiguration config,
com.codahale.metrics.MetricRegistry metricRegistry) |
| Modifier and Type | Method and Description |
|---|---|
LookupResult |
addStringList(Object key,
List<String> listValue,
boolean keepDuplicates)
Merge / append all list entries for the given key in a DataAdapter.
|
protected void |
clearError() |
void |
clearKey(Object key)
Clear (remove) the given key from the lookup table.
|
protected abstract LookupResult |
doGet(Object key) |
protected abstract void |
doRefresh(LookupCachePurge cachePurge) |
protected abstract void |
doStart() |
protected abstract void |
doStop() |
LookupResult |
get(Object key) |
LookupDataAdapterConfiguration |
getConfig() |
LookupResult |
getEmptyResult() |
Optional<Throwable> |
getError() |
LookupResult |
getErrorResult() |
String |
id() |
String |
name() |
void |
refresh(LookupCachePurge cachePurge) |
abstract org.joda.time.Duration |
refreshInterval()
Returns the refresh interval for this data adapter.
|
LookupResult |
removeStringList(Object key,
List<String> listValue)
Remove all matching list entries for the given key in a DataAdapter.
|
abstract void |
set(Object key,
Object value)
Deprecated.
|
protected void |
setError(Throwable throwable) |
LookupResult |
setStringList(Object key,
List<String> listValue)
Update all list entries for the given key in a DataAdapter.
|
LookupResult |
setValue(Object key,
Object value)
Update a value for the given key in a DataAdapter.
|
protected void |
shutDown() |
protected void |
startUp() |
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toStringprotected LookupDataAdapter(DataAdapterDto dto, com.codahale.metrics.MetricRegistry metricRegistry)
protected LookupDataAdapter(String id, String name, LookupDataAdapterConfiguration config, com.codahale.metrics.MetricRegistry metricRegistry)
public LookupResult getErrorResult()
public LookupResult getEmptyResult()
protected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractIdleServiceExceptionpublic abstract org.joda.time.Duration refreshInterval()
Duration.ZERO if refresh should be disabled.public void refresh(LookupCachePurge cachePurge)
protected abstract void doRefresh(LookupCachePurge cachePurge) throws Exception
Exceptionprotected void clearError()
protected void setError(Throwable throwable)
public String id()
public String name()
public LookupResult get(Object key)
protected abstract LookupResult doGet(Object key)
@Deprecated public abstract void set(Object key, Object value)
public LookupResult setValue(Object key, Object value)
key - The key that should be updated.value - The new value.public LookupResult setStringList(Object key, List<String> listValue)
key - The key that should be updated.listValue - The new list values.public LookupResult addStringList(Object key, List<String> listValue, boolean keepDuplicates)
key - The key that should be updated.listValue - The list values that should be merged / appended.keepDuplicates - Controls whether duplicated entries should be unified.public LookupResult removeStringList(Object key, List<String> listValue)
key - The key that should be updated.listValue - The list values that should be removed.public void clearKey(Object key)
key - The key that should be cleared.public LookupDataAdapterConfiguration getConfig()
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.