Skip to content

Commit d00fc2e

Browse files
committed
integrate latest
1 parent 47b4498 commit d00fc2e

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/main/java/cloud/eppo/EppoClient.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,21 @@ public static EppoClient getInstance() {
3737

3838
private EppoClient(
3939
String apiKey,
40-
String baseUrl,
4140
String sdkName,
4241
String sdkVersion,
42+
@Nullable @Deprecated String host,
43+
@Nullable String baseUrl,
4344
@Nullable AssignmentLogger assignmentLogger,
4445
@Nullable BanditLogger banditLogger,
4546
boolean isGracefulMode,
4647
@Nullable IAssignmentCache assignmentCache,
4748
@Nullable IAssignmentCache banditAssignmentCache) {
4849
super(
4950
apiKey,
50-
baseUrl,
5151
sdkName,
5252
sdkVersion,
53+
host,
54+
baseUrl,
5355
assignmentLogger,
5456
banditLogger,
5557
null,
@@ -76,7 +78,8 @@ public static class Builder {
7678
private boolean isGracefulMode = DEFAULT_IS_GRACEFUL_MODE;
7779
private boolean forceReinitialize = DEFAULT_FORCE_REINITIALIZE;
7880
private long pollingIntervalMs = DEFAULT_POLLING_INTERVAL_MS;
79-
private String host = Constants.DEFAULT_BASE_URL;
81+
private String host = null; // TODO remove with next major version bump.
82+
private String apiBaseUrl = null;
8083

8184
// Assignment and bandit caching on by default. To disable, call
8285
// `builder.assignmentCache(null).banditAssignmentCache(null);`
@@ -139,13 +142,23 @@ public Builder pollingIntervalMs(long pollingIntervalMs) {
139142

140143
/**
141144
* Overrides the host from where it fetches configurations. This typically should not be
142-
* explicitly set so that the default of the Fastly CDN is used.
145+
* explicitly set so that the default of the Fastly CDN is used. @Deprecated - use `apiBaseUrl`
146+
* instead
143147
*/
144148
public Builder host(String host) {
145149
this.host = host;
146150
return this;
147151
}
148152

153+
/**
154+
* Overrides the base URL from where the SDK fetches configurations. This typically should not
155+
* be explicitly set so that the default API URL is used.
156+
*/
157+
public Builder apiBaseUrl(String apiBaseUrl) {
158+
this.apiBaseUrl = apiBaseUrl;
159+
return this;
160+
}
161+
149162
public Builder assignmentCache(IAssignmentCache assignmentCache) {
150163
this.assignmentCache = assignmentCache;
151164
return this;
@@ -177,7 +190,8 @@ public EppoClient buildAndInit() {
177190
apiKey,
178191
sdkName,
179192
sdkVersion,
180-
host,
193+
host, // TODO remove with next major version bump.
194+
apiBaseUrl,
181195
assignmentLogger,
182196
banditLogger,
183197
isGracefulMode,

0 commit comments

Comments
 (0)