Skip to content

Commit 1039e6c

Browse files
Fix mvn verify errors
Signed-off-by: Thomas Poignant <[email protected]>
1 parent 5c0ae1e commit 1039e6c

23 files changed

+103
-44
lines changed

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/GoFeatureFlagProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import dev.openfeature.contrib.providers.gofeatureflag.bean.EvaluationType;
55
import dev.openfeature.contrib.providers.gofeatureflag.bean.IEvent;
66
import dev.openfeature.contrib.providers.gofeatureflag.bean.TrackingEvent;
7-
import dev.openfeature.contrib.providers.gofeatureflag.evaluator.EdgeEvaluator;
87
import dev.openfeature.contrib.providers.gofeatureflag.evaluator.IEvaluator;
98
import dev.openfeature.contrib.providers.gofeatureflag.evaluator.InProcessEvaluator;
9+
import dev.openfeature.contrib.providers.gofeatureflag.evaluator.RemoteEvaluator;
1010
import dev.openfeature.contrib.providers.gofeatureflag.exception.InvalidOptions;
1111
import dev.openfeature.contrib.providers.gofeatureflag.hook.DataCollectorHook;
1212
import dev.openfeature.contrib.providers.gofeatureflag.hook.DataCollectorHookOptions;
@@ -130,10 +130,10 @@ public void initialize(EvaluationContext evaluationContext) throws Exception {
130130
super.initialize(evaluationContext);
131131
this.evalService.init();
132132
this.hooks.add(new EnrichEvaluationContextHook(this.options.getExporterMetadata()));
133-
// In case of Edge evaluation, we don't need to send the data to the collector
133+
// In case of remote evaluation, we don't need to send the data to the collector
134134
// because the relay-proxy will collect events directly server side.
135135
if (!this.options.isDisableDataCollection()
136-
&& this.options.getEvaluationType() != EvaluationType.EDGE) {
136+
&& this.options.getEvaluationType() != EvaluationType.REMOTE) {
137137
this.dataCollectorHook = new DataCollectorHook(DataCollectorHookOptions.builder()
138138
.eventsPublisher(this.eventsPublisher)
139139
.collectUnCachedEvaluation(true)
@@ -195,7 +195,7 @@ private IEvaluator getEvaluator(GoFeatureFlagApi api) {
195195
Consumer<ProviderEventDetails> emitProviderConfigurationChanged = this::emitProviderConfigurationChanged;
196196
return new InProcessEvaluator(api, this.options, emitProviderConfigurationChanged);
197197
}
198-
return new EdgeEvaluator(api);
198+
return new RemoteEvaluator(api);
199199
}
200200

201201
/**

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/GoFeatureFlagProviderOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class GoFeatureFlagProviderOptions {
1515
/**
1616
* evaluationType is the type of evaluation you want to use.
1717
* - If you want to have a local evaluation, you should use IN_PROCESS.
18-
* - If you want to have an evaluation on the edge, you should use EDGE.
18+
* - If you want to have an evaluation on the relay-proxy directly, you should use REMOTE.
1919
* Default: IN_PROCESS
2020
*/
2121
private EvaluationType evaluationType;

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api/GoFeatureFlagApi.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
import okhttp3.RequestBody;
4343
import okhttp3.Response;
4444

45+
/**
46+
* GoFeatureFlagApi is the class to contact the GO Feature Flag relay proxy.
47+
*/
4548
@Slf4j
4649
public class GoFeatureFlagApi {
4750
/** apiKey contains the token to use while calling GO Feature Flag relay proxy. */
@@ -159,7 +162,7 @@ public FlagConfigResponse retrieveFlagConfiguration(final String etag, final Lis
159162
reqBuilder.addHeader(Const.HTTP_HEADER_IF_NONE_MATCH, etag);
160163
}
161164

162-
try (final Response response = this.httpClient.newCall(reqBuilder.build()).execute()) {
165+
try (Response response = this.httpClient.newCall(reqBuilder.build()).execute()) {
163166
val responseBody = response.body();
164167
String body = responseBody != null ? responseBody.string() : "";
165168
switch (response.code()) {
@@ -204,7 +207,7 @@ public void sendEventToDataCollector(final List<IEvent> eventsList, final Map<St
204207
.addEncodedPathSegment("collector")
205208
.build();
206209
val reqBuilder = prepareHttpRequest(url, requestBody);
207-
try (final Response response = this.httpClient.newCall(reqBuilder.build()).execute()) {
210+
try (Response response = this.httpClient.newCall(reqBuilder.build()).execute()) {
208211
val responseBody = response.body();
209212
String body = responseBody != null ? responseBody.string() : "";
210213
switch (response.code()) {

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api/bean/FlagConfigApiRequest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import lombok.AllArgsConstructor;
55
import lombok.Data;
66

7+
/**
8+
* Represents the request body for the flag configuration API.
9+
*/
710
@Data
811
@AllArgsConstructor
912
public class FlagConfigApiRequest {

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api/bean/FlagConfigApiResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import java.util.Map;
66
import lombok.Data;
77

8+
/**
9+
* Represents the response body for the flag configuration API.
10+
*/
811
@Data
912
public class FlagConfigApiResponse {
1013
@JsonProperty("flags")

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api/bean/OfrepRequest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import lombok.Builder;
55
import lombok.Data;
66

7+
/**
8+
* Represents the request body for the OFREP API request.
9+
*/
710
@Data
811
@Builder
912
public class OfrepRequest {

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api/bean/OfrepResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import lombok.Data;
66
import lombok.val;
77

8+
/**
9+
* This class represents the response from an OFREP response.
10+
*/
811
@Data
912
public class OfrepResponse {
1013
private Object value;
@@ -17,6 +20,11 @@ public class OfrepResponse {
1720
private String errorCode;
1821
private String errorDetails;
1922

23+
/**
24+
* Converts the OFREP response to a GO Feature Flag response.
25+
*
26+
* @return the converted GO Feature Flag response
27+
*/
2028
public GoFeatureFlagResponse toGoFeatureFlagResponse() {
2129
val goff = new GoFeatureFlagResponse();
2230
goff.setValue(value);
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
package dev.openfeature.contrib.providers.gofeatureflag.bean;
22

3+
/**
4+
* This enum represents the type of evaluation that can be performed.
5+
*
6+
* <p>IN_PROCESS: The evaluation is done in the process of the application.
7+
* REMOTE: The evaluation is done on the edge (e.g. CDN or API).</p>
8+
*/
39
public enum EvaluationType {
410
IN_PROCESS,
5-
EDGE
11+
REMOTE
612
}

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/bean/ExperimentationRollout.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import java.util.Date;
44
import lombok.Data;
55

6+
/**
7+
* This class represents the rollout of an experimentation.
8+
*/
69
@Data
710
public class ExperimentationRollout {
811
private Date start;

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/bean/FeatureEvent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import lombok.Builder;
55
import lombok.Data;
66

7+
/**
8+
* This class represents a feature event, this is used to send events evaluation events to the GO Feature Flag server.
9+
*/
710
@Builder
811
@Data
912
public class FeatureEvent implements IEvent {

0 commit comments

Comments
 (0)