TrackingManagerConfig constructor

TrackingManagerConfig({
  1. int batchIntervals = DEFAULT_TIME_INTERVAL,
  2. int poolMaxSize = DEFAULT_BATCH_LENGTH,
  3. BatchCachingStrategy batchStrategy = BatchCachingStrategy.BATCH_CONTINUOUS_CACHING,
})

Implementation

TrackingManagerConfig(
    {this.batchIntervals = DEFAULT_TIME_INTERVAL,
    this.poolMaxSize = DEFAULT_BATCH_LENGTH,
    this.batchStrategy = BatchCachingStrategy.BATCH_CONTINUOUS_CACHING}) {
  // batchIntervals  should not be greater than 14400 (4h) and less than 1s  otherwise default value should be used
  if (batchIntervals > MAX_TIME_INTERVAL ||
      batchIntervals < MIN_TIME_INTERVAL) {
    Flagship.logger(Level.INFO,
        "batchIntervals should not be greater than 14400 (4h) and less than 1s. w'll use a default value: $DEFAULT_TIME_INTERVAL");
    this.batchIntervals = DEFAULT_TIME_INTERVAL;
  }

  // poolMaxSize should not be less than 5 otherwise default value should be used
  if (this.poolMaxSize < MIN_BATCH_LENGTH) {
    Flagship.logger(Level.INFO,
        "poolMaxSize should not be less than 5. w'll use a default value: $DEFAULT_BATCH_LENGTH");
    this.poolMaxSize = DEFAULT_BATCH_LENGTH;
  }
}