Interface EventSender

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    DefaultEventSender

    public interface EventSender
    extends java.io.Closeable
    Internal interface for a component that can deliver preformatted event data.

    This is separate from the public EventSender interface in the SDK that applications can use to provide a custom implementation. The latter is used as a wrapper for this one, so we do not have to expose any types from the internal events code. The public interface is simpler because it only needs to return success/failure/shutdown status; the use of the Date header is an implementation detail that is specific to the default HTTP implementation of event delivery.

    • Method Detail

      • sendAnalyticsEvents

        EventSender.Result sendAnalyticsEvents​(byte[] data,
                                               int eventCount,
                                               java.net.URI eventsBaseUri)
        Attempt to deliver an analytics event data payload.

        This method will be called synchronously from an event delivery worker thread.

        Parameters:
        data - the preformatted JSON data, in UTF-8 encoding
        eventCount - the number of individual events in the data
        eventsBaseUri - the configured events endpoint base URI
        Returns:
        a EventSender.Result
      • sendDiagnosticEvent

        EventSender.Result sendDiagnosticEvent​(byte[] data,
                                               java.net.URI eventsBaseUri)
        Attempt to deliver a diagnostic event data payload.

        This method will be called synchronously from an event delivery worker thread.

        Parameters:
        data - the preformatted JSON data, as a string
        eventsBaseUri - the configured events endpoint base URI
        Returns:
        a EventSender.Result