Changesets · Branches · Tags · Compare
| Changeset | 013e37aefd54de154fdccc05e60d3caef235fd86a854b820dc7d92aeab721345 |
|---|---|
| Author | Enrico Risa <enrico.risa@gmail.com> · 2024-07-10 12:02 +02:00 |
| Committer | GitHub <noreply@github.com> · 2024-07-10 12:02 +02:00 |
| Parents | f67c47f35fe4 |
8 files changed
modified DEPENDENCIES +3 −1
| @@ -136,7 +136,7 @@ | ||
| 136 | 136 | maven/mavencentral/io.prometheus/simpleclient_tracer_otel_agent/0.16.0, Apache-2.0, approved, clearlydefined |
| 137 | 137 | maven/mavencentral/io.rest-assured/json-path/5.5.0, Apache-2.0, approved, clearlydefined |
| 138 | 138 | maven/mavencentral/io.rest-assured/rest-assured-common/5.5.0, Apache-2.0, approved, clearlydefined |
| 139 | -maven/mavencentral/io.rest-assured/rest-assured/5.5.0, Apache-2.0, restricted, clearlydefined | |
| 139 | +maven/mavencentral/io.rest-assured/rest-assured/5.5.0, Apache-2.0, approved, #15676 | |
| 140 | 140 | maven/mavencentral/io.rest-assured/xml-path/5.5.0, Apache-2.0, approved, clearlydefined |
| 141 | 141 | maven/mavencentral/io.setl/rdf-urdna/1.1, Apache-2.0, approved, clearlydefined |
| 142 | 142 | maven/mavencentral/io.swagger.core.v3/swagger-annotations-jakarta/2.2.22, Apache-2.0, approved, #5947 |
| @@ -188,6 +188,7 @@ | ||
| 188 | 188 | maven/mavencentral/net.bytebuddy/byte-buddy/1.14.1, Apache-2.0 AND BSD-3-Clause, approved, #7163 |
| 189 | 189 | maven/mavencentral/net.bytebuddy/byte-buddy/1.14.15, Apache-2.0 AND BSD-3-Clause, approved, #7163 |
| 190 | 190 | maven/mavencentral/net.bytebuddy/byte-buddy/1.14.16, Apache-2.0 AND BSD-3-Clause, approved, #7163 |
| 191 | +maven/mavencentral/net.bytebuddy/byte-buddy/1.14.18, Apache-2.0 AND BSD-3-Clause, approved, #7163 | |
| 191 | 192 | maven/mavencentral/net.java.dev.jna/jna/5.13.0, Apache-2.0 AND LGPL-2.1-or-later, approved, #15196 |
| 192 | 193 | maven/mavencentral/net.javacrumbs.json-unit/json-unit-core/2.36.0, Apache-2.0, approved, clearlydefined |
| 193 | 194 | maven/mavencentral/net.minidev/accessors-smart/2.4.7, Apache-2.0, approved, #7515 |
| @@ -228,6 +229,7 @@ | ||
| 228 | 229 | maven/mavencentral/org.apache.xbean/xbean-reflect/3.7, Apache-2.0, approved, clearlydefined |
| 229 | 230 | maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved, clearlydefined |
| 230 | 231 | maven/mavencentral/org.assertj/assertj-core/3.26.0, Apache-2.0, approved, #14886 |
| 232 | +maven/mavencentral/org.assertj/assertj-core/3.26.3, Apache-2.0, approved, #14886 | |
| 231 | 233 | maven/mavencentral/org.awaitility/awaitility/4.2.1, Apache-2.0, approved, #14178 |
| 232 | 234 | maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.72, MIT, approved, #3789 |
| 233 | 235 | maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.78.1, MIT, approved, #14434 |
modified core/common/lib/transform-lib/src/main/java/org/eclipse/edc/transform/transformer/edc/from/JsonObjectFromDataPlaneInstanceTransformer.java +12 −0
| @@ -18,14 +18,19 @@ | ||
| 18 | 18 | import jakarta.json.JsonBuilderFactory; |
| 19 | 19 | import jakarta.json.JsonObject; |
| 20 | 20 | import org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance; |
| 21 | +import org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstanceStates; | |
| 21 | 22 | import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer; |
| 22 | 23 | import org.eclipse.edc.transform.spi.TransformerContext; |
| 23 | 24 | import org.jetbrains.annotations.NotNull; |
| 24 | 25 | import org.jetbrains.annotations.Nullable; |
| 25 | 26 | |
| 27 | +import java.util.Optional; | |
| 28 | + | |
| 26 | 29 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_DEST_TYPES; |
| 27 | 30 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_SOURCE_TYPES; |
| 28 | 31 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_TRANSFER_TYPES; |
| 32 | +import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.DATAPLANE_INSTANCE_STATE; | |
| 33 | +import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.DATAPLANE_INSTANCE_STATE_TIMESTAMP; | |
| 29 | 34 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.LAST_ACTIVE; |
| 30 | 35 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.PROPERTIES; |
| 31 | 36 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.TURN_COUNT; |
| @@ -68,6 +73,13 @@ | ||
| 68 | 73 | var transferTypesBldr = jsonFactory.createArrayBuilder(dataPlaneInstance.getAllowedTransferTypes()); |
| 69 | 74 | builder.add(ALLOWED_TRANSFER_TYPES, transferTypesBldr); |
| 70 | 75 | |
| 76 | + var state = Optional.ofNullable(DataPlaneInstanceStates.from(dataPlaneInstance.getState())) | |
| 77 | + .map(Enum::name) | |
| 78 | + .orElse(null); | |
| 79 | + | |
| 80 | + addIfNotNull(state, DATAPLANE_INSTANCE_STATE, builder); | |
| 81 | + | |
| 82 | + builder.add(DATAPLANE_INSTANCE_STATE_TIMESTAMP, dataPlaneInstance.getStateTimestamp()); | |
| 71 | 83 | |
| 72 | 84 | return builder.build(); |
| 73 | 85 | } |
modified core/common/lib/transform-lib/src/main/java/org/eclipse/edc/transform/transformer/edc/to/JsonObjectToDataPlaneInstanceTransformer.java +2 −0
| @@ -34,6 +34,7 @@ | ||
| 34 | 34 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_SOURCE_TYPES; |
| 35 | 35 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_TRANSFER_TYPES; |
| 36 | 36 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.Builder; |
| 37 | +import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.DATAPLANE_INSTANCE_STATE_TIMESTAMP; | |
| 37 | 38 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.LAST_ACTIVE; |
| 38 | 39 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.PROPERTIES; |
| 39 | 40 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.TURN_COUNT; |
| @@ -76,6 +77,7 @@ | ||
| 76 | 77 | var set = jsonValue.asJsonArray().stream().map(jv -> transformString(jv, context)).collect(Collectors.toSet()); |
| 77 | 78 | builder.allowedTransferType(set); |
| 78 | 79 | } |
| 80 | + case DATAPLANE_INSTANCE_STATE_TIMESTAMP -> transformLong(context, jsonValue, builder::stateTimestamp); | |
| 79 | 81 | case PROPERTIES -> { |
| 80 | 82 | var props = jsonValue.asJsonArray().getJsonObject(0); |
| 81 | 83 | visitProperties(props, (k, val) -> transformProperties(k, val, builder, context)); |
modified core/common/lib/transform-lib/src/test/java/org/eclipse/edc/transform/transformer/edc/from/JsonObjectFromDataPlaneInstanceTransformerTest.java +33 −0
| @@ -27,10 +27,13 @@ | ||
| 27 | 27 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_DEST_TYPES; |
| 28 | 28 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_SOURCE_TYPES; |
| 29 | 29 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.ALLOWED_TRANSFER_TYPES; |
| 30 | +import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.DATAPLANE_INSTANCE_STATE; | |
| 31 | +import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.DATAPLANE_INSTANCE_STATE_TIMESTAMP; | |
| 30 | 32 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.LAST_ACTIVE; |
| 31 | 33 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.PROPERTIES; |
| 32 | 34 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.TURN_COUNT; |
| 33 | 35 | import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstance.URL; |
| 36 | +import static org.eclipse.edc.connector.dataplane.selector.spi.instance.DataPlaneInstanceStates.AVAILABLE; | |
| 34 | 37 | import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID; |
| 35 | 38 | import static org.eclipse.edc.jsonld.util.JacksonJsonLd.createObjectMapper; |
| 36 | 39 | import static org.mockito.Mockito.mock; |
| @@ -71,4 +74,34 @@ | ||
| 71 | 74 | assertThat(jsonObject.getJsonObject(PROPERTIES).getJsonString("foo").getString()).isEqualTo("bar"); |
| 72 | 75 | |
| 73 | 76 | } |
| 77 | + | |
| 78 | + @Test | |
| 79 | + void transform_withState() { | |
| 80 | + var dpi = DataPlaneInstance.Builder.newInstance() | |
| 81 | + .id("test-id") | |
| 82 | + .url("http://foo.bar") | |
| 83 | + .allowedSourceType("test-source-type") | |
| 84 | + .allowedDestType("test-dest-type") | |
| 85 | + .allowedTransferType("test-transfer-type") | |
| 86 | + .lastActive(15) | |
| 87 | + .turnCount(42) | |
| 88 | + .state(AVAILABLE.code()) | |
| 89 | + .property("foo", "bar") | |
| 90 | + .build(); | |
| 91 | + | |
| 92 | + var jsonObject = transformer.transform(dpi, context); | |
| 93 | + | |
| 94 | + assertThat(jsonObject).isNotNull(); | |
| 95 | + assertThat(jsonObject.getString(ID)).isEqualTo("test-id"); | |
| 96 | + assertThat(jsonObject.getString(URL)).isEqualTo("http://foo.bar"); | |
| 97 | + assertThat(jsonObject.getJsonArray(ALLOWED_SOURCE_TYPES)).hasSize(1).allMatch(v -> ((JsonString) v).getString().equals("test-source-type")); | |
| 98 | + assertThat(jsonObject.getJsonArray(ALLOWED_DEST_TYPES)).hasSize(1).allMatch(v -> ((JsonString) v).getString().equals("test-dest-type")); | |
| 99 | + assertThat(jsonObject.getJsonArray(ALLOWED_TRANSFER_TYPES)).hasSize(1).allMatch(v -> ((JsonString) v).getString().equals("test-transfer-type")); | |
| 100 | + assertThat(jsonObject.getJsonNumber(LAST_ACTIVE).intValue()).isEqualTo(15); | |
| 101 | + assertThat(jsonObject.getJsonNumber(TURN_COUNT).intValue()).isEqualTo(42); | |
| 102 | + assertThat(jsonObject.getString(DATAPLANE_INSTANCE_STATE)).isEqualTo(AVAILABLE.name()); | |
| 103 | + assertThat(jsonObject.getJsonNumber(DATAPLANE_INSTANCE_STATE_TIMESTAMP).longValue()).isEqualTo(dpi.getStateTimestamp()); | |
| 104 | + assertThat(jsonObject.getJsonObject(PROPERTIES).getJsonString("foo").getString()).isEqualTo("bar"); | |
| 105 | + | |
| 106 | + } | |
| 74 | 107 | } |
modified extensions/common/api/management-api-configuration/src/main/resources/management-api-version.json +2 −2
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | { |
| 3 | - "version": "3.0.1", | |
| 3 | + "version": "3.0.2", | |
| 4 | 4 | "urlPath": "/v3", |
| 5 | - "lastUpdated": "2024-06-13T14:28:00Z", | |
| 5 | + "lastUpdated": "2024-07-10T09:17:00Z", | |
| 6 | 6 | "maturity": "stable" |
| 7 | 7 | }, |
| 8 | 8 | { |
modified extensions/data-plane-selector/data-plane-selector-api/src/main/java/org/eclipse/edc/connector/dataplane/selector/api/schemas/DataPlaneInstanceSchema.java +6 −2
| @@ -40,7 +40,9 @@ | ||
| 40 | 40 | @Schema(requiredMode = REQUIRED) |
| 41 | 41 | Set<String> allowedDestTypes, |
| 42 | 42 | Integer turnCount, |
| 43 | - Long lastActive) { | |
| 43 | + Long lastActive, | |
| 44 | + String state, | |
| 45 | + Long stateTimestamp) { | |
| 44 | 46 | public static final String DATAPLANE_INSTANCE_EXAMPLE = """ |
| 45 | 47 | { |
| 46 | 48 | "@context": { |
| @@ -53,7 +55,9 @@ | ||
| 53 | 55 | "source-type2" |
| 54 | 56 | ], |
| 55 | 57 | "allowedDestTypes": ["your-dest-type"], |
| 56 | - "allowedTransferTypes": ["transfer-type"] | |
| 58 | + "allowedTransferTypes": ["transfer-type"], | |
| 59 | + "state": "AVAILABLE", | |
| 60 | + "stateTimestamp": 1688465655 | |
| 57 | 61 | } |
| 58 | 62 | """; |
| 59 | 63 | } |
modified spi/data-plane-selector/data-plane-selector-spi/src/main/java/org/eclipse/edc/connector/dataplane/selector/spi/instance/DataPlaneInstance.java +5 −1
| @@ -54,6 +54,10 @@ | ||
| 54 | 54 | @Deprecated(since = "0.7.0") |
| 55 | 55 | public static final String ALLOWED_DEST_TYPES = EDC_NAMESPACE + "allowedDestTypes"; |
| 56 | 56 | |
| 57 | + public static final String DATAPLANE_INSTANCE_STATE = EDC_NAMESPACE + "state"; | |
| 58 | + public static final String DATAPLANE_INSTANCE_STATE_TIMESTAMP = EDC_NAMESPACE + "stateTimestamp"; | |
| 59 | + | |
| 60 | + | |
| 57 | 61 | private Map<String, Object> properties = new HashMap<>(); |
| 58 | 62 | private Set<String> allowedTransferTypes = new HashSet<>(); |
| 59 | 63 | private Set<String> allowedSourceTypes = new HashSet<>(); |
| @@ -91,7 +95,7 @@ | ||
| 91 | 95 | * transferType against an internal list of allowed source and transfer types. |
| 92 | 96 | * |
| 93 | 97 | * @param sourceAddress the sourceAddress |
| 94 | - * @param transferType the transferType | |
| 98 | + * @param transferType the transferType | |
| 95 | 99 | * @return true if it can handle, false otherwise. |
| 96 | 100 | */ |
| 97 | 101 | public boolean canHandle(DataAddress sourceAddress, @Nullable String transferType) { |
modified system-tests/version-api/version-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/versionapi/VersionApiEndToEndTest.java +1 −1
| @@ -55,7 +55,7 @@ | ||
| 55 | 55 | |
| 56 | 56 | assertThat(result).containsKeys("management", "version", "control", "observability", "sts"); |
| 57 | 57 | assertThat(result.get("management")).hasSize(2) |
| 58 | - .anyMatch(vr -> vr.version().equals("3.0.1") && vr.maturity().equals("stable")) | |
| 58 | + .anyMatch(vr -> vr.version().equals("3.0.2") && vr.maturity().equals("stable")) | |
| 59 | 59 | .anyMatch(vr -> vr.version().equals("3.1.0-alpha") && vr.maturity().equals("alpha")); |
| 60 | 60 | assertThat(result.get("version")).hasSize(1).anyMatch(vr -> vr.version().equals("1.0.0")); |
| 61 | 61 | assertThat(result.get("observability")).hasSize(1).anyMatch(vr -> vr.version().equals("1.0.0")); |