You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2024. It is now read-only.
* This class exposes advanced configuration options for the {@link LDClient}.
12
+
* This class exposes advanced configuration options for the {@link LDClient}. Instances of this class must be constructed with a {@link com.launchdarkly.client.LDConfig.Builder}.
* Creates a builder with all configuration parameters set to the default
61
+
*/
62
+
publicBuilder() {
63
+
}
64
+
65
+
/**
66
+
* Set the base URL of the LaunchDarkly server for this configuration
67
+
* @param baseURI the base URL of the LaunchDarkly server for this configuration
68
+
* @return the builder
69
+
*/
70
+
publicBuilderbaseURI(URIbaseURI) {
71
+
this.baseURI = baseURI;
72
+
returnthis;
73
+
}
74
+
75
+
/**
76
+
* Set the connection timeout in seconds for the configuration. This is the time allowed for the underlying HTTP client to connect
77
+
* to the LaunchDarkly server. The default is 2 seconds.
78
+
* @param connectTimeout the connection timeout in seconds
79
+
* @return the builder
80
+
*/
81
+
publicBuilderconnectTimeout(intconnectTimeout) {
82
+
this.connectTimeout = connectTimeout;
83
+
returnthis;
84
+
}
85
+
86
+
/**
87
+
* Set the socket timeout in seconds for the configuration. This is the time allowed for the server to return a response after
88
+
* the connection is established. The default is 10 seconds.
89
+
* @param socketTimeout the socket timeout in seconds
90
+
* @return the builder
91
+
*/
92
+
publicBuildersocketTimeout(intsocketTimeout) {
93
+
this.socketTimeout = socketTimeout;
94
+
returnthis;
95
+
}
96
+
97
+
/**
98
+
* Set the number of seconds between flushes of the event buffer. Decreasing the flush interval means
99
+
* that the event buffer is less likely to reach capacity.
100
+
*
101
+
* @param flushInterval the flush interval in seconds
102
+
* @return the builder
103
+
*/
104
+
publicBuilderflushInterval(intflushInterval) {
105
+
this.flushInterval = flushInterval;
106
+
returnthis;
107
+
}
108
+
109
+
/**
110
+
* Set the capacity of the events buffer. The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events will be discarded.
111
+
* Increasing the capacity means that events are less likely to be discarded, at the cost of consuming more memory.
112
+
*
113
+
* @param capacity the capacity of the event buffer
114
+
* @return the builder
115
+
*/
116
+
publicBuildercapacity(intcapacity) {
117
+
this.capacity = capacity;
118
+
returnthis;
119
+
}
120
+
121
+
/**
122
+
* Build the configured {@link com.launchdarkly.client.LDConfig} object
123
+
* @return the {@link com.launchdarkly.client.LDConfig} configured by this builder
124
+
*/
125
+
publicLDConfigbuild() {
126
+
returnnewLDConfig(this);
127
+
}
38
128
39
-
/**
40
-
* Create a configuration using the specified base URL and API key
41
-
* @param apiKey the API key
42
-
* @param baseURI the base URL for the LaunchDarkly API. Any path specified in the URI will be ignored.
43
-
* @param capacity the maximum number of events that will be buffered before discarding. Events are batched and sent every 30 seconds,
44
-
* so this should be larger than the number of events the app might create in that time.
0 commit comments