Class Analytics.Builder

  • Enclosing class:
    Analytics

    public static class Analytics.Builder
    extends java.lang.Object
    Fluent API for creating Analytics instances.
    • Field Detail

      • endpoint

        public okhttp3.HttpUrl endpoint
      • uploadURL

        public okhttp3.HttpUrl uploadURL
    • Method Detail

      • client

        public Analytics.Builder client​(okhttp3.OkHttpClient client)
        Set a custom networking client.
      • log

        public Analytics.Builder log​(Log log)
        Configure debug logging mechanism. By default, nothing is logged.
      • endpoint

        public Analytics.Builder endpoint​(java.lang.String endpoint)
        Set an endpoint (host only) that this client should upload events to. Uses https://api.segment.io by default.
      • setUploadURL

        public Analytics.Builder setUploadURL​(java.lang.String uploadURL)
        Set an endpoint (host and prefix) that this client should upload events to. Uses https://api.segment.io/v1 by default.
      • userAgent

        public Analytics.Builder userAgent​(java.lang.String userAgent)
        Sets a user agent for HTTP requests.
      • queueCapacity

        public Analytics.Builder queueCapacity​(int capacity)
        Set queue capacity
      • flushQueueSize

        @Beta
        public Analytics.Builder flushQueueSize​(int flushQueueSize)
        Set the queueSize at which flushes should be triggered.
      • maximumQueueSizeInBytes

        @Beta
        public Analytics.Builder maximumQueueSizeInBytes​(int bytes)
        Set the queueSize at which flushes should be triggered.
      • flushInterval

        @Beta
        public Analytics.Builder flushInterval​(long flushInterval,
                                               java.util.concurrent.TimeUnit unit)
        Set the interval at which the queue should be flushed.
      • retries

        public Analytics.Builder retries​(int maximumRetries)
        Set how many retries should happen before getting exhausted
      • networkExecutor

        public Analytics.Builder networkExecutor​(java.util.concurrent.ExecutorService networkExecutor)
        Set the ExecutorService on which all HTTP requests will be made.
      • threadFactory

        @Beta
        public Analytics.Builder threadFactory​(java.util.concurrent.ThreadFactory threadFactory)
        Set the ThreadFactory used to create threads.
      • forceTlsVersion1

        public Analytics.Builder forceTlsVersion1()
        Specify if need TlsV1