Class EngineEvent
java.lang.Object
com.suse.salt.netapi.event.EngineEvent
Represents an event fired by engines
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides additional information from the tag depending on the type of enginegetData()Return event data as Map<R> RgetData(com.google.gson.reflect.TypeToken<R> type) Return the event data parsed into the given type.<R> RReturn this event's data parsed into the given type.Returns the engine name.Returns the id of the minion that triggered the engine eventReturns the timestamp of the eventstatic Optional<EngineEvent> Utility method to parse e generic event to a more specific one
-
Field Details
-
PATTERN
-
GSON
private static final com.google.gson.Gson GSON -
engine
-
timestamp
-
additional
-
minionId
-
data
private final com.google.gson.JsonElement data
-
-
Constructor Details
-
EngineEvent
private EngineEvent(String engine, String additional, String timestamp, Optional<String> minionId, com.google.gson.JsonElement data) Creates a new EngineEvent- Parameters:
engine- the engine nameadditional- additional information depending on the enginetimestamp- datetime of the eventminionId- minion id if the event comes from a minion, empty it comes from the masterdata- data containing more information about this event
-
-
Method Details
-
getEngine
-
getAdditional
Provides additional information from the tag depending on the type of engine- Returns:
- additional information
-
getTimestamp
-
getMinionId
-
getData
public <R> R getData(com.google.gson.reflect.TypeToken<R> type) Return the event data parsed into the given type.- Type Parameters:
R- type to parse the data into- Parameters:
type- type token to parse data- Returns:
- the event data
-
getData
Return this event's data parsed into the given type.- Type Parameters:
R- type to parse the data into- Parameters:
type- class to parse data- Returns:
- the data
-
getData
-
parse
Utility method to parse e generic event to a more specific one- Parameters:
event- the generic event to parse- Returns:
- an option containing the parsed value or non if it could not be parsed
-