Welcome to the DevCycle Java SDK, which interfaces with the DevCycle Bucketing API.
This version of the DevCycle SDK works with Java 8 and above.
Using the Java SDK library requires Maven or Gradle >= 5.6.4 to be installed.
You can use the SDK in your Maven project by adding the following to your pom.xml:
<dependency>
<groupId>com.devcycle</groupId>
<artifactId>java-server-sdk</artifactId>
<version>1.3.0</version>
<scope>compile</scope>
</dependency>Alternatively you can use the SDK in your Gradle project by adding the following to build.gradle:
implementation("com.devcycle:java-server-sdk:1.3.0")The JVM, by default, caches DNS for infinity. DevCycle servers are load balanced and dynamic. To address this concern,
setting the DNS cache TTL to a short duration is recommended. The TTL is controlled by this security setting networkaddress.cache.ttl.
Recommended settings and how to configure them can be found here.
To use the DevCycle Java SDK, initialize a client object.
Cloud:
import com.devcycle.sdk.server.cloud.api.DVCCloudClient;
public class MyClass {
private DVCCloudClient dvcCloudClient;
public MyClass() {
dvcCloudClient = new DVCCloudClient("YOUR_DVC_SERVER_SDK_KEY");
}
}Local:
import com.devcycle.sdk.server.local.api.DVCLocalClient;
public class MyClass {
private DVCLocalClient dvcLocalClient;
public MyClass() {
dvcLocalClient = new DVCLocalClient("YOUR_DVC_SERVER_SDK_KEY");
}
}To find usage documentation, visit our docs for Local Bucketing.