Interface EventProcessor

All Superinterfaces:
AutoCloseable, Closeable

public interface EventProcessor extends Closeable
Interface for an object that can send or store analytics events.

Application code normally does not need to interact with this interface. It is provided to allow a custom implementation or test fixture to be substituted for the SDK's normal analytics event logic.

Since:
3.3.0
  • Field Details

  • Method Details

    • recordEvaluationEvent

      void recordEvaluationEvent(LDContext context, String flagKey, int flagVersion, int variation, LDValue value, EvaluationReason reason, LDValue defaultValue, boolean requireFullEvent, Long debugEventsUntilDate)
      Records the action of evaluating a feature flag.

      Depending on the feature flag properties and event properties, this may be transmitted to the events service as an individual event, or may only be added into summary data.

      Parameters:
      context - the current evaluation context
      flagKey - key of the feature flag that was evaluated
      flagVersion - the version of the flag, or NO_VERSION if the flag was not found
      variation - the result variation index, or EvaluationDetail.NO_VARIATION if evaluation failed
      value - the result value
      reason - the evaluation reason, or null if the reason was not requested
      defaultValue - the default value parameter for the evaluation
      requireFullEvent - true if full-fidelity analytics events should be sent for this flag
      debugEventsUntilDate - if non-null, debug events are to be generated until this millisecond time
    • recordIdentifyEvent

      void recordIdentifyEvent(LDContext context)
      Registers an evaluation context, as when the SDK's identify method is called.
      Parameters:
      context - the evaluation context
    • recordCustomEvent

      void recordCustomEvent(LDContext context, String eventKey, LDValue data, Double metricValue)
      Creates a custom event, as when the SDK's track method is called.
      Parameters:
      context - the current evaluation context
      eventKey - the event key
      data - optional custom data provided for the event, may be null or LDValue.ofNull() if not used
      metricValue - optional numeric metric value provided for the event, or null
    • setInBackground

      void setInBackground(boolean inBackground)
      Puts the event processor into background mode if appropriate.
      Parameters:
      inBackground - true if we are running in the background
    • setOffline

      void setOffline(boolean offline)
      Puts the event processor into offline mode if appropriate.
      Parameters:
      offline - true if the SDK has been put offline
    • flush

      void flush()
      Specifies that any buffered events should be sent as soon as possible, rather than waiting for the next flush interval. This method is asynchronous, so events still may not be sent until a later time. However, calling Closeable.close() will synchronously deliver any events that were not yet delivered prior to shutting down.
    • blockingFlush

      void blockingFlush()
      Specifies that any buffered events should be sent immediately, blocking until done.