Package com.lightbend.cinnamon.event
Class Event
- java.lang.Object
-
- com.lightbend.cinnamon.event.Event
-
public abstract class Event extends java.lang.ObjectAnEventthat can be fired.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEvent.SeverityAll supported event severities.
-
Constructor Summary
Constructors Constructor Description Event()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voiddestroy()Clean up when destroyed.voidfire(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 voidfire(java.util.Map<java.lang.String,java.lang.Object> data)Fire an event with the given structured data.voidfireLimited(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> data)Fire an event, when enabled, using the lazily supplied data.voidfireLimited(java.util.Map<java.lang.String,java.lang.Object> data)Fire an event with the given structured data.abstract booleanisEnabled()Whether this event is enabled for firing.
-
-
-
Field Detail
-
NONE
public static final Event NONE
Empty no-opEvent.
-
-
Method Detail
-
isEnabled
public abstract boolean isEnabled()
Whether this event is enabled for firing.- Returns:
- whether this event is enabled
-
fire
public abstract void fire(java.util.Map<java.lang.String,java.lang.Object> data)
Fire an event with the given structured data.- Parameters:
data- structured event data
-
destroy
public abstract void destroy()
Clean up when destroyed.
-
fire
public 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.- Parameters:
data- supplier of data, only accessed if event is enabled
-
fireLimited
public void fireLimited(java.util.Map<java.lang.String,java.lang.Object> data)
Fire an event with the given structured 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.
- Parameters:
data- structured event data
-
fireLimited
public 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.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.
- Parameters:
data- supplier of data, only accessed if event is enabled
-
-