Class MinionStartEvent

java.lang.Object
com.suse.salt.netapi.event.MinionStartEvent

public class MinionStartEvent extends Object
Represents an event fired when a minion connects to the salt master
  • Field Details

    • PATTERN

      private static final Pattern PATTERN
    • GSON

      private static final com.google.gson.Gson GSON
    • minionId

      private final String minionId
    • data

      private final com.google.gson.JsonElement data
  • Constructor Details

    • MinionStartEvent

      private MinionStartEvent(String minionId, com.google.gson.JsonElement data)
      Creates a new MinionStartEvent
      Parameters:
      minionId - the id of the minion sending the event
      data - data containing more information about this event
  • Method Details

    • getMinionId

      public String getMinionId()
      The id of the minion that started
      Returns:
      the minion id
    • getStartUpGrains

      public <T> Optional<T> getStartUpGrains(Class<T> type)
      Gets the grains defined against start_event_grains.
      Type Parameters:
      T - T type to be returned after parsing
      Parameters:
      type - class of type T
      Returns:
      grains defined in start_event_grains
    • 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

      public <R> R getData(Class<R> type)
      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

      public Map<String,Object> getData()
      Return event data as Map
      Returns:
      event data as map
    • parse

      public static Optional<MinionStartEvent> parse(Event event)
      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