diff --git a/README.md b/README.md index 79d90e3..870c48d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ```groovy dependencies { - implementation 'cloud.eppo:eppo-server-sdk:3.1.0' + implementation 'cloud.eppo:eppo-server-sdk:4.0.0' } ``` @@ -58,6 +58,6 @@ repositories { } dependencies { - implementation 'cloud.eppo:eppo-server-sdk:3.2.0-SNAPSHOT' + implementation 'cloud.eppo:eppo-server-sdk:4.0.1-SNAPSHOT' } ``` diff --git a/build.gradle b/build.gradle index d31a259..b4c6c99 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ java { } group = 'cloud.eppo' -version = '3.2.0-SNAPSHOT' +version = '4.0.0' ext.isReleaseVersion = !version.endsWith("SNAPSHOT") import org.apache.tools.ant.filters.ReplaceTokens @@ -30,7 +30,7 @@ repositories { } dependencies { - api 'cloud.eppo:sdk-common-jvm:3.5.4' + api 'cloud.eppo:sdk-common-jvm:3.6.0' implementation 'com.github.zafarkhaja:java-semver:0.10.2' implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2' diff --git a/src/main/java/cloud/eppo/EppoClient.java b/src/main/java/cloud/eppo/EppoClient.java index e26cc25..b16d323 100644 --- a/src/main/java/cloud/eppo/EppoClient.java +++ b/src/main/java/cloud/eppo/EppoClient.java @@ -20,7 +20,6 @@ public class EppoClient extends BaseEppoClient { private static final Logger log = LoggerFactory.getLogger(EppoClient.class); - private static final String DEFAULT_HOST = "https://fscdn.eppo.cloud"; private static final boolean DEFAULT_IS_GRACEFUL_MODE = true; private static final boolean DEFAULT_FORCE_REINITIALIZE = false; private static final long DEFAULT_POLLING_INTERVAL_MS = 30 * 1000; @@ -38,9 +37,9 @@ public static EppoClient getInstance() { private EppoClient( String apiKey, - String host, String sdkName, String sdkVersion, + @Nullable String baseUrl, @Nullable AssignmentLogger assignmentLogger, @Nullable BanditLogger banditLogger, boolean isGracefulMode, @@ -48,9 +47,10 @@ private EppoClient( @Nullable IAssignmentCache banditAssignmentCache) { super( apiKey, - host, sdkName, sdkVersion, + null, + baseUrl, assignmentLogger, banditLogger, null, @@ -77,7 +77,7 @@ public static class Builder { private boolean isGracefulMode = DEFAULT_IS_GRACEFUL_MODE; private boolean forceReinitialize = DEFAULT_FORCE_REINITIALIZE; private long pollingIntervalMs = DEFAULT_POLLING_INTERVAL_MS; - private String host = DEFAULT_HOST; + private String apiBaseUrl = null; // Assignment and bandit caching on by default. To disable, call // `builder.assignmentCache(null).banditAssignmentCache(null);` @@ -139,11 +139,11 @@ public Builder pollingIntervalMs(long pollingIntervalMs) { } /** - * Overrides the host from where it fetches configurations. This typically should not be - * explicitly set so that the default of the Fastly CDN is used. + * Overrides the base URL from where the SDK fetches configurations. This typically should not + * be explicitly set so that the default API URL is used. */ - public Builder host(String host) { - this.host = host; + public Builder apiBaseUrl(String apiBaseUrl) { + this.apiBaseUrl = apiBaseUrl; return this; } @@ -178,7 +178,7 @@ public EppoClient buildAndInit() { apiKey, sdkName, sdkVersion, - host, + apiBaseUrl, assignmentLogger, banditLogger, isGracefulMode, diff --git a/src/test/java/cloud/eppo/EppoClientTest.java b/src/test/java/cloud/eppo/EppoClientTest.java index 924bd86..db94f0e 100644 --- a/src/test/java/cloud/eppo/EppoClientTest.java +++ b/src/test/java/cloud/eppo/EppoClientTest.java @@ -287,7 +287,7 @@ private EppoClient initClient(String apiKey) { return new EppoClient.Builder() .apiKey(apiKey) - .host(TEST_HOST) + .apiBaseUrl(Constants.appendApiPathToHost(TEST_HOST)) .assignmentLogger(mockAssignmentLogger) .banditLogger(mockBanditLogger) .isGracefulMode(false) @@ -301,7 +301,7 @@ private EppoClient initFailingGracefulClient(boolean isGracefulMode) { return new EppoClient.Builder() .apiKey(DUMMY_FLAG_API_KEY) - .host("blag") + .apiBaseUrl("blag") .assignmentLogger(mockAssignmentLogger) .banditLogger(mockBanditLogger) .isGracefulMode(isGracefulMode)