Skip to content

Commit 5632d89

Browse files
jonathannorrischris-hoefgen
andauthored
feat!: rename public interfaces from DVC to DevCycle (#92)
* feat!: rename public interfaces from DVC to DevCycle * update example apps * fix: cleanup * fix: cleanup more DVC refrences in logs / docs * Retrigger Test Harness --------- Co-authored-by: chris-hoefgen <chris.hoefgen@taplytics.com>
1 parent 3f414be commit 5632d89

File tree

56 files changed

+466
-429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+466
-429
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,28 @@ To use the DevCycle Java SDK, initialize a client object.
5858

5959
Cloud:
6060
```java
61-
import com.devcycle.sdk.server.cloud.api.DVCCloudClient;
61+
import com.devcycle.sdk.server.cloud.api.DevCycleCloudClient;
6262

6363
public class MyClass {
6464

65-
private DVCCloudClient dvcCloudClient;
65+
private DevCycleCloudClient dvcCloudClient;
6666

6767
public MyClass() {
68-
dvcCloudClient = new DVCCloudClient("YOUR_DVC_SERVER_SDK_KEY");
68+
dvcCloudClient = new DevCycleCloudClient("DEVCYCLE_SERVER_SDK_KEY");
6969
}
7070
}
7171
```
7272

7373
Local:
7474
```java
75-
import com.devcycle.sdk.server.local.api.DVCLocalClient;
75+
import com.devcycle.sdk.server.local.api.DevCycleLocalClient;
7676

7777
public class MyClass {
7878

79-
private DVCLocalClient dvcLocalClient;
79+
private DevCycleLocalClient dvcLocalClient;
8080

8181
public MyClass() {
82-
dvcLocalClient = new DVCLocalClient("YOUR_DVC_SERVER_SDK_KEY");
82+
dvcLocalClient = new DevCycleLocalClient("DEVCYCLE_SERVER_SDK_KEY");
8383
}
8484
}
8585
```
@@ -91,13 +91,13 @@ To find usage documentation, visit our docs for [Local Bucketing](https://docs.d
9191
## Logging
9292

9393
The DevCycle SDK logs to **stdout** by default and does not require any specific logging package. To integrate with your
94-
own logging system, such as Java Logging or SLF4J, you can create a wrapper that implements the `IDVCLogger` interface.
94+
own logging system, such as Java Logging or SLF4J, you can create a wrapper that implements the `IDevCycleLogger` interface.
9595
Then you can set the logger into the Java Server SDK setting the Custom Logger property in the options object used to
9696
initialize the client.
9797

9898
```java
9999
// Create your logging wrapper
100-
IDVCLogger loggingWrapper = new IDVCLogger() {
100+
IDevCycleLogger loggingWrapper = new IDevCycleLogger() {
101101
@Override
102102
public void debug(String message) {
103103
// Your logging implementation here
@@ -124,13 +124,13 @@ IDVCLogger loggingWrapper = new IDVCLogger() {
124124
}
125125
};
126126

127-
// Set the logger in the options before creating the DVCLocalClient
128-
DVCLocalOptions options = DVCLocalOptions.builder().customLogger(loggingWrapper).build();
129-
DVCLocalClient dvcClient = new DVCLocalClient("YOUR_DVC_SERVER_SDK_KEY", options);
127+
// Set the logger in the options before creating the DevCycleLocalClient
128+
DevCycleLocalOptions options = DevCycleLocalOptions.builder().customLogger(loggingWrapper).build();
129+
DevCycleLocalClient dvcClient = new DevCycleLocalClient("DEVCYCLE_SERVER_SDK_KEY", options);
130130

131-
// Or for DVCCloudClient
132-
DVCCloudOptions options = DVCCloudOptions.builder().customLogger(loggingWrapper).build();
133-
DVCCloudClient dvcClient = new DVCCloudClient("YOUR_DVC_SERVER_SDK_KEY", options);
131+
// Or for DevCycleCloudClient
132+
DevCycleCloudOptions options = DevCycleCloudOptions.builder().customLogger(loggingWrapper).build();
133+
DevCycleCloudClient dvcClient = new DevCycleCloudClient("DEVCYCLE_SERVER_SDK_KEY", options);
134134
```
135135

136-
You can also disable all logging by setting the custom logger to `new SimpleDVCLogger(SimpleDVCLogger.Level.OFF)`.
136+
You can also disable all logging by setting the custom logger to `new SimpleDevCycleLogger(SimpleDevCycleLogger.Level.OFF)`.

benchmark/src/main/java/com/devcycle/SDKBenchmark.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.devcycle;
22

3-
import com.devcycle.sdk.server.common.model.User;
3+
import com.devcycle.sdk.server.common.model.DevCycleUser;
44
import com.devcycle.sdk.server.common.model.Variable;
5-
import com.devcycle.sdk.server.local.api.DVCLocalClient;
6-
import com.devcycle.sdk.server.local.model.DVCLocalOptions;
5+
import com.devcycle.sdk.server.local.api.DevCycleLocalClient;
6+
import com.devcycle.sdk.server.local.model.DevCycleLocalOptions;
77

88
import org.openjdk.jmh.annotations.*;
99
import org.openjdk.jmh.runner.Runner;
@@ -19,7 +19,7 @@ public class SDKBenchmark {
1919
public static class BenchmarkState {
2020
public MockServer mockServer;
2121

22-
public DVCLocalClient client;
22+
public DevCycleLocalClient client;
2323

2424
@Setup(Level.Iteration)
2525
public void setup() {
@@ -30,7 +30,7 @@ public void setup() {
3030
e.printStackTrace();
3131
}
3232

33-
DVCLocalOptions dvcLocalOptions = DVCLocalOptions.builder()
33+
DevCycleLocalOptions dvcLocalOptions = DevCycleLocalOptions.builder()
3434
.configPollingIntervalMS(10000)
3535
.configRequestTimeoutMs(5000)
3636
.eventFlushIntervalMS(5000)
@@ -40,18 +40,18 @@ public void setup() {
4040
.eventsApiBaseUrl("http://localhost:8000/event/")
4141
.build();
4242

43-
client = new DVCLocalClient("dvc_server_some_real_sdk_key", dvcLocalOptions);
43+
client = new DevCycleLocalClient("dvc_server_some_real_sdk_key", dvcLocalOptions);
4444

4545
try {
46-
System.out.println("Waiting for DVC client to load");
46+
System.out.println("Waiting for DevCycle client to load");
4747
Thread.sleep(1000);
4848
} catch (InterruptedException e) {
4949
throw new RuntimeException(e);
5050
}
5151
}
5252
@TearDown(Level.Iteration)
5353
public void tearDown() {
54-
System.out.println("Cleaning up DVC client");
54+
System.out.println("Cleaning up DevCycle client");
5555
client.close();
5656
System.out.println("Stop mock HTTP server");
5757
mockServer.close();
@@ -64,7 +64,7 @@ public void tearDown() {
6464
@Fork(1)
6565
@OutputTimeUnit(TimeUnit.NANOSECONDS)
6666
public void variableBenchmark(BenchmarkState state) {
67-
User user = User.builder().userId("12345").email("some.user@gmail.com").build();
67+
DevCycleUser user = DevCycleUser.builder().userId("12345").email("some.user@gmail.com").build();
6868
Variable<Boolean> var = state.client.variable(user, "v-key-25", false);
6969

7070
if( var == null) {

benchmark/src/main/java/com/devcycle/VariableTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package com.devcycle;
22

33
import com.devcycle.sdk.server.common.model.PlatformData;
4-
import com.devcycle.sdk.server.common.model.User;
4+
import com.devcycle.sdk.server.common.model.DevCycleUser;
55
import com.devcycle.sdk.server.common.model.Variable;
6-
import com.devcycle.sdk.server.local.api.DVCLocalClient;
7-
import com.devcycle.sdk.server.local.model.DVCLocalOptions;
6+
import com.devcycle.sdk.server.local.api.DevCycleLocalClient;
7+
import com.devcycle.sdk.server.local.model.DevCycleLocalOptions;
88

99
import java.io.IOException;
1010

1111
/**
12-
* A simple loop to test and profile variable evaluation of the DVCClient
12+
* A simple loop to test and profile variable evaluation of the DevCycleLocalClient
1313
*/
1414
public class VariableTest {
1515
public static void main(String[] args) throws IOException {
1616
MockServer server = new MockServer();
17-
DVCLocalOptions dvcLocalOptions = DVCLocalOptions.builder()
17+
DevCycleLocalOptions dvcLocalOptions = DevCycleLocalOptions.builder()
1818
.configPollingIntervalMS(10000)
1919
.configRequestTimeoutMs(5000)
2020
.eventFlushIntervalMS(5000)
@@ -24,9 +24,9 @@ public static void main(String[] args) throws IOException {
2424
.disableAutomaticEventLogging(false)
2525
.build();
2626

27-
System.out.println("Initializing DVC Client version: " + PlatformData.builder().build().getSdkVersion());
27+
System.out.println("Initializing DevCycle Client version: " + PlatformData.builder().build().getSdkVersion());
2828
System.out.print("Setup Client");
29-
DVCLocalClient dvcClient = new DVCLocalClient("dvc_server_some_sdk_key", dvcLocalOptions);
29+
DevCycleLocalClient dvcClient = new DevCycleLocalClient("dvc_server_some_sdk_key", dvcLocalOptions);
3030

3131
System.out.print("Wait for config to load");
3232
try {
@@ -39,7 +39,7 @@ public static void main(String[] args) throws IOException {
3939
int iterations = 100000;
4040
int defaultCount = 0;
4141
int nullVarCount = 0;
42-
User user = User.builder().userId("1234567890").email("some.user@gmail.com").build();
42+
DevCycleUser user = DevCycleUser.builder().userId("1234567890").email("some.user@gmail.com").build();
4343
for(int i = 0; i < iterations; i++) {
4444
Variable<Boolean> var = dvcClient.variable(user, "v-key-25", false);
4545
if( var == null) {

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ if (project == rootProject) {
1515
}
1616

1717
task javadocJar(type: Jar) {
18-
classifier = 'javadoc'
18+
archiveClassifier.set("javadoc")
1919
from javadoc
2020
}
2121

2222
task sourcesJar(type: Jar) {
23-
classifier = 'sources'
23+
archiveClassifier.set("sources")
2424
from sourceSets.main.allSource
2525
}
2626

@@ -117,7 +117,7 @@ task downloadDVCBucketingWASM(type: Download) {
117117
src wasmUrl
118118
dest wasmResourcePath
119119
doLast {
120-
println "Completed DVC Bucketing WASM Download to $wasmResourcePath"
120+
println "Completed DevCycle Bucketing WASM Download to $wasmResourcePath"
121121
}
122122
}
123123

@@ -156,9 +156,9 @@ dependencies {
156156
api("com.fasterxml.jackson.core:jackson-databind:$jackson_version")
157157
implementation("io.swagger.core.v3:swagger-annotations:$swagger_annotations_version")
158158

159-
implementation ("io.github.kawamuray.wasmtime:wasmtime-java:$wasmtime_version")
159+
implementation("io.github.kawamuray.wasmtime:wasmtime-java:$wasmtime_version")
160160

161-
implementation ("com.google.protobuf:protobuf-java:$protobuf_version")
161+
implementation("com.google.protobuf:protobuf-java:$protobuf_version")
162162

163163
compileOnly("org.projectlombok:lombok:$lombok_version")
164164

docs/Event.md renamed to docs/DevCycleEvent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Event
1+
# DevCycleEvent
22

33
## Properties
44
Name | Type | Description | Notes

docs/DVC.md renamed to docs/DevCycleLocalClient.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# DVC API
1+
# DevCycleLocalClient
22

33
Method | HTTP request | Description
44
------------- | ------------- | -------------
5-
[**allFeatures**](DVC.md#allFeatures) | **POST** v1/features | Get all features for user data
6-
[**variable**](DVC.md#variable) | **POST** v1/variables/{key} | Get variable by key for user data
7-
[**allVariables**](DVC.md#allVariables) | **POST** v1/variables | Get all variables for user data
8-
[**track**](DVC.md#track) | **POST** v1/track | Post events to DevCycle for user
5+
[**allFeatures**](DevCycleLocalClient.md#allFeatures) | **POST** v1/features | Get all features for user data
6+
[**variable**](DevCycleLocalClient.md#variable) | **POST** v1/variables/{key} | Get variable by key for user data
7+
[**allVariables**](DevCycleLocalClient.md#allVariables) | **POST** v1/variables | Get all variables for user data
8+
[**track**](DevCycleLocalClient.md#track) | **POST** v1/track | Post events to DevCycle for user
99

1010
<a name="allFeatures"></a>
1111
# **allFeatures**
@@ -15,18 +15,18 @@ Get all features for user data
1515

1616
### Example
1717
```java
18-
import com.devcycle.sdk.server.api.DVCClient;
18+
import com.devcycle.sdk.server.api.DevCycleLocalClient;
1919

2020
public class MyClass {
2121

22-
private DVCClient dvcClient;
22+
private DevCycleLocalClient dvcClient;
2323

2424
public MyClass() {
25-
dvcClient = new DVCClient("YOUR_DVC_SERVER_SDK_KEY");
25+
dvcClient = new DevCycleLocalClient("DEVCYCLE_SERVER_SDK_KEY");
2626
}
2727

2828
public void allFeatures() {
29-
User user = User.builder()
29+
DevCycleUser user = DevCycleUser.builder()
3030
.userId("a_user_id")
3131
.country("US")
3232
.build();
@@ -40,7 +40,7 @@ public class MyClass {
4040

4141
Name | Type | Description | Notes
4242
------------- | ------------- | ------------- | -------------
43-
**user** | [**User**](User.md)| |
43+
**user** | [**DevCycleUser**](DevCycleUser.md)| |
4444

4545
### Return type
4646

@@ -54,18 +54,18 @@ Get variable by key for user data
5454

5555
### Example
5656
```java
57-
import com.devcycle.sdk.server.api.DVCClient;
57+
import com.devcycle.sdk.server.api.DevCycleLocalClient;
5858

5959
public class MyClass {
6060

61-
private DVCClient dvcClient;
61+
private DevCycleLocalClient dvcClient;
6262

6363
public MyClass() {
64-
dvcClient = new DVCClient("YOUR_DVC_SERVER_SDK_KEY");
64+
dvcClient = new DevCycleLocalClient("DEVCYCLE_SERVER_SDK_KEY");
6565
}
6666

6767
public void setFlag() {
68-
User user = User.builder()
68+
DevCycleUser user = DevCycleUser.builder()
6969
.userId("a_user_id")
7070
.country("US")
7171
.build();
@@ -87,7 +87,7 @@ public class MyClass {
8787

8888
Name | Type | Description | Notes
8989
------------- | ------------- | ------------- | -------------
90-
**user** | [**User**](User.md)| |
90+
**user** | [**DevCycleUser**](DevCycleUser.md)| |
9191
**key** | **String**| Variable key |
9292

9393
### Return type
@@ -102,18 +102,18 @@ Get all variables for user data
102102

103103
### Example
104104
```java
105-
import com.devcycle.sdk.server.api.DVCClient;
105+
import com.devcycle.sdk.server.api.DevCycleLocalClient;
106106

107107
public class MyClass {
108108

109-
private DVCClient dvcClient;
109+
private DevCycleLocalClient dvcClient;
110110

111111
public MyClass() {
112-
dvcClient = new DVCClient("YOUR_DVC_SERVER_SDK_KEY");
112+
dvcClient = new DevCycleLocalClient("DEVCYCLE_SERVER_SDK_KEY");
113113
}
114114

115115
public void allVariables() {
116-
User user = User.builder()
116+
DevCycleUser user = DevCycleUser.builder()
117117
.userId("a_user_id")
118118
.country("US")
119119
.build();
@@ -127,7 +127,7 @@ public class MyClass {
127127

128128
Name | Type | Description | Notes
129129
------------- | ------------- | ------------- | -------------
130-
**user** | [**User**](User.md)| |
130+
**user** | [**DevCycleUser**](DevCycleUser.md)| |
131131

132132
### Return type
133133

@@ -141,30 +141,30 @@ Post events to DevCycle for user
141141

142142
### Example
143143
```java
144-
import com.devcycle.sdk.server.api.DVCClient;
144+
import com.devcycle.sdk.server.api.DevCycleLocalClient;
145145

146146
public class MyClass {
147147

148-
private DVCClient dvcClient;
148+
private DevCycleLocalClient dvcClient;
149149

150150
public MyClass() {
151-
dvcClient = new DVCClient("YOUR_DVC_SERVER_SDK_KEY");
151+
dvcClient = new DevCycleLocalClient("DEVCYCLE_SERVER_SDK_KEY");
152152
}
153153

154154
public void addAnEvent() {
155-
User user = User.builder()
155+
DevCycleUser user = DevCycleUser.builder()
156156
.userId("a_user_id")
157157
.country("US")
158158
.build();
159159

160-
Event event = Event.builder()
160+
DevCycleEvent event = DevCycleEvent.builder()
161161
.date(Instant.now().toEpochMilli())
162162
.target("test target")
163163
.type("test event")
164164
.value(new BigDecimal(600))
165165
.build();
166166

167-
DVCResponse response = dvcClient.track(user, event);
167+
DevCycleResponse response = dvcClient.track(user, event);
168168
}
169169
}
170170
```
@@ -173,9 +173,9 @@ public class MyClass {
173173

174174
Name | Type | Description | Notes
175175
------------- | ------------- | ------------- | -------------
176-
**user** | [**User**](User.md)| |
177-
**event** | [**Event**](Event.md)|
176+
**user** | [**DevCycleUser**](DevCycleUser.md)| |
177+
**event** | [**DevCycleEvent**](DevCycleEvent.md)|
178178

179179
### Return type
180180

181-
[**DVCResponse200**](DVCResponse.md)
181+
[**DVCResponse200**](DevCycleResponse.md)

docs/DVCResponse.md renamed to docs/DevCycleResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DVCResponse
1+
# DevCycleResponse
22

33
## Properties
44
Name | Type | Description | Notes

docs/User.md renamed to docs/DevCycleUser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# User
1+
# DevCycleUser
22

33
## Properties
44
Name | Type | Description | Notes

0 commit comments

Comments
 (0)