@@ -57,6 +57,7 @@ public class SplitClientConfig {
5757 private final int _onDemandFetchMaxRetries ;
5858 private final int _failedAttemptsBeforeLogging ;
5959 private final boolean _cdnDebugLogging ;
60+ private long _validateAfterInactivityInMillis ;
6061
6162 // Proxy configs
6263 private final HttpHost _proxy ;
@@ -106,7 +107,8 @@ private SplitClientConfig(String endpoint,
106107 int onDemandFetchRetryDelayMs ,
107108 int onDemandFetchMaxRetries ,
108109 int failedAttemptsBeforeLogging ,
109- boolean cdnDebugLogging ) {
110+ boolean cdnDebugLogging ,
111+ long validateAfterInactivityInMillis ) {
110112 _endpoint = endpoint ;
111113 _eventsEndpoint = eventsEndpoint ;
112114 _featuresRefreshRate = pollForFeatureChangesEveryNSeconds ;
@@ -143,6 +145,7 @@ private SplitClientConfig(String endpoint,
143145 _onDemandFetchMaxRetries = onDemandFetchMaxRetries ;
144146 _failedAttemptsBeforeLogging = failedAttemptsBeforeLogging ;
145147 _cdnDebugLogging = cdnDebugLogging ;
148+ _validateAfterInactivityInMillis = validateAfterInactivityInMillis ;
146149
147150 Properties props = new Properties ();
148151 try {
@@ -286,6 +289,9 @@ public int get_telemetryRefreshRate() {
286289
287290 public boolean cdnDebugLogging () { return _cdnDebugLogging ; }
288291
292+ public long validateAfterInactivityInMillis () {
293+ return _validateAfterInactivityInMillis ;
294+ }
289295
290296 public static final class Builder {
291297
@@ -323,11 +329,12 @@ public static final class Builder {
323329 private String _authServiceURL = AUTH_ENDPOINT ;
324330 private String _streamingServiceURL = STREAMING_ENDPOINT ;
325331 private String _telemetryURl = TELEMETRY_ENDPOINT ;
326- private int _telemetryRefreshRate = 60 ;
332+ private int _telemetryRefreshRate = 3600 ;
327333 private int _onDemandFetchRetryDelayMs = 50 ;
328334 private final int _onDemandFetchMaxRetries = 10 ;
329335 private final int _failedAttemptsBeforeLogging = 10 ;
330336 private final boolean _cdnDebugLogging = true ;
337+ private long _validateAfterInactivityInMillis = 1000 ;
331338
332339 public Builder () {
333340 }
@@ -719,8 +726,7 @@ public Builder streamingServiceURL(String streamingServiceURL) {
719726 return this ;
720727 }
721728
722- /**
723- * Set telemetry service URL.
729+ /** Set telemetry service URL.
724730 * @param telemetryURL
725731 * @return
726732 */
@@ -817,10 +823,15 @@ public SplitClientConfig build() {
817823 if (_onDemandFetchRetryDelayMs <= 0 ) {
818824 throw new IllegalStateException ("streamingRetryDelay must be > 0" );
819825 }
826+
820827 if (_onDemandFetchMaxRetries <= 0 ) {
821828 throw new IllegalStateException ("_onDemandFetchMaxRetries must be > 0" );
822829 }
823830
831+ if (_telemetryRefreshRate <= 60 ) {
832+ throw new IllegalStateException ("_telemetryRefreshRate must be >= 60" );
833+ }
834+
824835 return new SplitClientConfig (
825836 _endpoint ,
826837 _eventsEndpoint ,
@@ -857,7 +868,8 @@ public SplitClientConfig build() {
857868 _onDemandFetchRetryDelayMs ,
858869 _onDemandFetchMaxRetries ,
859870 _failedAttemptsBeforeLogging ,
860- _cdnDebugLogging );
871+ _cdnDebugLogging ,
872+ _validateAfterInactivityInMillis );
861873 }
862874 }
863875}
0 commit comments