Class AnalyticsBatch

java.lang.Object
liquibase.analytics.AnalyticsBatch

public class AnalyticsBatch extends Object
The batch method lets you send a series of Identify, Group, Track, Page and Screen requests in a single batch, saving on outbound requests. See more info here: https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/#batch
  • Constructor Details

    • AnalyticsBatch

      public AnalyticsBatch()
  • Method Details

    • fromLiquibaseEvent

      public static AnalyticsBatch fromLiquibaseEvent(Event event, String userId) throws Exception
      Converts a Liquibase-specific event into an AnalyticsBatch that is expected by Segment.

      This method processes the given Liquibase Event, converts it into a format that Segment can handle, and wraps it into an AnalyticsBatch. If the event has child events, those will be recursively added to the batch. The batch is constructed using the write key from the LiquibaseRemoteAnalyticsConfiguration, if available.

      Parameters:
      event - the Liquibase Event to be converted, which may contain child events
      userId - the ID of the user associated with this event, used to identify the event's source
      Returns:
      an AnalyticsBatch object containing the converted event and any child events
      Throws:
      Exception - if there is an error during event processing or configuration retrieval