Package org.graylog2.plugin.lookup
Class LookupResult
java.lang.Object
org.graylog2.plugin.lookup.LookupResult
The result of looking up a key in a lookup table (i. e. lookup data adapter or lookup cache).
For convenience, this class can be serialized and deserialized with Jackson (see
ObjectMapper
, but we strongly recommend implementing your own
serialization and deserialization logic if you're implementing a lookup cache.
There are no guarantees about binary compatibility of this class across Graylog releases!
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LookupResult.Builder
addDefaults
(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) static LookupResult.Builder
builder()
abstract long
cacheTTL()
The time to live (in milliseconds) for a LookupResult instance.static LookupResult
createFromJSON
(Object singleValue, Map<Object, Object> multiValue, List<String> stringListValue, boolean hasError, long cacheTTL) static LookupResult
empty()
abstract boolean
hasError()
boolean
hasTTL()
boolean
isEmpty()
static LookupResult
static LookupResult
multi
(CharSequence singleValue, Map<Object, Object> multiValue) static LookupResult
static LookupResult
static LookupResult
single
(CharSequence singleValue) static LookupResult
abstract Object
static LookupResult
withDefaults
(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) static LookupResult
static LookupResult
withError
(long errorTTL) static LookupResult
static LookupResult.Builder
-
Field Details
-
SINGLE_VALUE_KEY
- See Also:
-
-
Constructor Details
-
LookupResult
public LookupResult()
-
-
Method Details
-
singleValue
-
multiValue
-
stringListValue
-
hasError
public abstract boolean hasError() -
cacheTTL
public abstract long cacheTTL()The time to live (in milliseconds) for a LookupResult instance. Prevents repeated lookups for the same key during the time to live period. Depending on the LookupCache implementation this might be ignored. -
isEmpty
public boolean isEmpty() -
hasTTL
public boolean hasTTL() -
empty
-
withError
-
withError
-
withError
-
single
-
single
-
single
-
multi
-
multi
-
multi
-
withDefaults
public static LookupResult withDefaults(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) -
addDefaults
public static LookupResult.Builder addDefaults(LookupDefaultSingleValue singleValue, LookupDefaultMultiValue multiValue) -
createFromJSON
-
withoutTTL
-
builder
-