Class TrackingEvent

java.lang.Object
de.espirit.firstspirit.event.TrackingEvent
All Implemented Interfaces:
Serializable

public class TrackingEvent extends Object implements Serializable
This kind of event is thrown whenever a tracking point has been hit, e.g. with TrackingAgent.track(UUID, String, String).

In order to listen to these events, use the EventBusAgent along with the identifier specified by BUS_IDENTIFIER.

Since:
5.2.220703
See Also:
  • Field Details

    • BUS_IDENTIFIER

      public static final BusIdentifier<TrackingEvent> BUS_IDENTIFIER
      Use this bus identifier for registering listeners with the EventBusAgent in order to receive tracking events.
      Since:
      5.2.220703
  • Constructor Details

    • TrackingEvent

      public TrackingEvent(@NotNull @NotNull UUID uuid, @NotNull @NotNull Instant timestamp, long count, @Nullable @Nullable String category, @Nullable @Nullable String label)
      Creates a new immutable tracking event without payload data.
      Parameters:
      uuid - the unique id of the tracking point which has been hit
      timestamp - the timestamp when the tracking point has been hit
      count - the number of occurrences
      category - the category to group tracking points by, may be null if unavailable
      label - the human-readable label of the tracking point, may be null if unavailable
      Since:
      5.2.220703
    • TrackingEvent

      public TrackingEvent(@NotNull @NotNull UUID uuid, @NotNull @NotNull Instant timestamp, long count, @Nullable @Nullable String category, @Nullable @Nullable String label, @Nullable @Nullable String value)
      Creates a new immutable tracking event.
      Parameters:
      uuid - the unique id of the tracking point which has been hit
      timestamp - the timestamp when the tracking point has been hit
      count - the number of occurrences
      category - the category to group tracking points by, may be null if unavailable
      label - the human-readable label of the tracking point, may be null if unavailable
      value - the payload data, may be null
      Since:
      5.2.220805
  • Method Details

    • getUuid

      @NotNull public @NotNull UUID getUuid()
      Returns the unique id of the tracking point which has been hit.
      Returns:
      the unique id of the tracking point, never null.
      Since:
      5.2.220703
    • getTimestamp

      @NotNull public @NotNull Instant getTimestamp()
      Returns the timestamp when the tracking point has been hit.
      Returns:
      the timestamp, never null.
      Since:
      5.2.220703
    • getCount

      public long getCount()
      Returns the number of occurrences for this event.
      Returns:
      the number of occurrences
      Since:
      5.2.220703
    • getCategory

      public Optional<String> getCategory()
      Returns the category to group tracking points by, if available
      Returns:
      the category to group tracking points by
      Since:
      5.2.220703
    • getLabel

      public Optional<String> getLabel()
      Returns human-readable label of the tracking point, if available
      Returns:
      the human-readable label of the tracking point
      Since:
      5.2.220703
    • getValue

      public Optional<String> getValue()
      Returns the payload data of the tracking point, if available
      Returns:
      the payload data of the tracking point
      Since:
      5.2.220805