public abstract class Event
extends java.lang.Object
Event
that can be fired.Modifier and Type | Class and Description |
---|---|
static class |
Event.Severity
All supported event severities.
|
Constructor and Description |
---|
Event() |
Modifier and Type | Method and Description |
---|---|
abstract void |
destroy()
Clean up when destroyed.
|
abstract void |
fire(java.util.Map<java.lang.String,java.lang.Object> data)
Fire an event with the given structured data.
|
void |
fire(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> data)
Fire an event, when enabled, using the lazily supplied data.
|
void |
fireLimited(java.util.Map<java.lang.String,java.lang.Object> data)
Fire an event with the given structured data.
|
void |
fireLimited(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> data)
Fire an event, when enabled, using the lazily supplied data.
|
abstract boolean |
isEnabled()
Whether this event is enabled for firing.
|
public static final Event NONE
Event
.public abstract boolean isEnabled()
public abstract void fire(java.util.Map<java.lang.String,java.lang.Object> data)
data
- structured event datapublic abstract void destroy()
public void fire(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> data)
data
- supplier of data, only accessed if event is enabledpublic void fireLimited(java.util.Map<java.lang.String,java.lang.Object> data)
This can be used by events to be notified of rate limited triggers as well, to do things like counting the total number of times being fired, even if some are not sent off to the receiver.
data
- structured event datapublic void fireLimited(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> data)
This can be used by events to be notified of rate limited triggers as well, to do things like counting the total number of times being fired, even if some are not sent off to the receiver.
data
- supplier of data, only accessed if event is enabledCinnamon API. Copyright (c) 2015–2021 Lightbend.