Skip to content

Commit a84f97b

Browse files
authored
Adds AAS Discovery Integration for AAS Repository (eclipse-basyx#726)
* Adds Feature Discovery-Integration - TODO: Test * Adds Tests for AAS Repository Discovery Integration * Adds Test for Authorized AAS Discovery Integration * Refactoring and adds missing Tests * Refactoring and adds missing Tests * Adapts examples and fixes error in parent pom * Resolves Bean Conflict * Resolves Bean Conflict * Resolves Bean Conflict * Adds Discovery Integration to example
1 parent cdd6ad7 commit a84f97b

32 files changed

Lines changed: 1271 additions & 21 deletions

File tree

.github/workflows/basyx_test.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
- name: Build BaSyx
4040
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
4141

42+
- name: Build Discovery Service
43+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
44+
4245
- name: Build Submodel Repository
4346
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
4447

@@ -91,6 +94,9 @@ jobs:
9194
- name: Build BaSyx
9295
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
9396

97+
- name: Build Discovery Service
98+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
99+
94100
- name: Build Submodel Repository
95101
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
96102

@@ -156,6 +162,9 @@ jobs:
156162
- name: Build BaSyx
157163
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
158164

165+
- name: Build Discovery Service
166+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
167+
159168
- name: Build Submodel Repository
160169
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
161170

@@ -221,6 +230,9 @@ jobs:
221230
- name: Build BaSyx
222231
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
223232

233+
- name: Build Discovery Service
234+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
235+
224236
- name: Build Submodel Repository
225237
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
226238

@@ -285,7 +297,10 @@ jobs:
285297

286298
- name: Build BaSyx
287299
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
288-
300+
301+
- name: Build Discovery Service
302+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
303+
289304
- name: Build Submodel Repository
290305
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
291306

@@ -340,7 +355,10 @@ jobs:
340355

341356
- name: Build BaSyx
342357
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
343-
358+
359+
- name: Build Discovery Service
360+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
361+
344362
- name: Build Submodel Repository
345363
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
346364

@@ -405,7 +423,10 @@ jobs:
405423

406424
- name: Build BaSyx
407425
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
408-
426+
427+
- name: Build Discovery Service
428+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
429+
409430
- name: Build Submodel Repository
410431
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
411432

@@ -460,7 +481,10 @@ jobs:
460481

461482
- name: Build BaSyx
462483
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
463-
484+
485+
- name: Build Discovery Service
486+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
487+
464488
- name: Build Submodel Repository
465489
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
466490

@@ -525,7 +549,10 @@ jobs:
525549

526550
- name: Build BaSyx
527551
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
528-
552+
553+
- name: Build Discovery Service
554+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
555+
529556
- name: Build Submodel Repository
530557
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
531558

@@ -591,6 +618,9 @@ jobs:
591618
- name: Build BaSyx
592619
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
593620

621+
- name: Build Discovery Service
622+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
623+
594624
- name: Build Submodel Repository
595625
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
596626

@@ -656,6 +686,9 @@ jobs:
656686
- name: Build BaSyx
657687
run: mvn clean install ${MVN_ARGS_BUILD_BASYX}
658688

689+
- name: Build Discovery Service
690+
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.aasdiscoveryservice.component"
691+
659692
- name: Build Submodel Repository
660693
run: mvn package -DskipTests -Ddocker.namespace=eclipsebasyx --pl "org.eclipse.digitaltwin.basyx:basyx.submodelrepository.component"
661694

basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-client/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/client/ConnectedAasDiscoveryService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public CursorResult<List<String>> getAllAssetAdministrationShellIdsByAssetLink(P
6161
return discoveryApi.getAllAssetAdministrationShellIdsByAssetLink(assetIds, pInfo.getLimit(), pInfo.getCursor());
6262
} catch (ApiException e) {
6363
if(e.getCode() == HttpStatus.NOT_FOUND.value()){
64-
throw new AssetLinkDoesNotExistException("No matching element for given assetIds");
64+
throw new AssetLinkDoesNotExistException();
6565
} else {
6666
throw new RuntimeException("Error while getting all Asset Administration Shell IDs by Asset Link", e);
6767
}
@@ -74,7 +74,7 @@ public List<SpecificAssetId> getAllAssetLinksById(String shellIdentifier) {
7474
return discoveryApi.getAllAssetLinksById(shellIdentifier);
7575
} catch (ApiException e) {
7676
if(e.getCode() == HttpStatus.NOT_FOUND.value()){
77-
throw new AssetLinkDoesNotExistException("Element with id "+shellIdentifier+" does not exist");
77+
throw new AssetLinkDoesNotExistException(shellIdentifier);
7878
} else {
7979
throw new RuntimeException("Error while getting all Asset Links by ID", e);
8080
}
@@ -87,7 +87,7 @@ public List<SpecificAssetId> createAllAssetLinksById(String shellIdentifier, Lis
8787
return discoveryApi.postAllAssetLinksById(shellIdentifier, assetIds);
8888
} catch (ApiException e) {
8989
if(e.getCode() == HttpStatus.CONFLICT.value()){
90-
throw new CollidingAssetLinkException("Asset Links for shell "+shellIdentifier+" already exists");
90+
throw new CollidingAssetLinkException(shellIdentifier);
9191
} else {
9292
throw new RuntimeException("Error while creating all Asset Links by ID", e);
9393
}
@@ -100,7 +100,7 @@ public void deleteAllAssetLinksById(String shellIdentifier) {
100100
discoveryApi.deleteAllAssetLinksById(shellIdentifier);
101101
} catch (ApiException e) {
102102
if(e.getCode() == HttpStatus.NOT_FOUND.value()){
103-
throw new AssetLinkDoesNotExistException("Element with id "+shellIdentifier+" does not exist");
103+
throw new AssetLinkDoesNotExistException(shellIdentifier);
104104
} else {
105105
throw new RuntimeException("Error while deleting all Asset Links by ID", e);
106106
}

basyx.aasenvironment/basyx.aasenvironment.component/src/main/resources/application.properties

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,25 @@ basyx.backend = InMemory
7373
####################################################################################
7474
# To define the total request size for a multipart/form-data (default 10 MB)
7575

76-
# spring.servlet.multipart.max-request-size=128KB
76+
# spring.servlet.multipart.max-request-size=128KB
77+
78+
####################################################################################
79+
# Feature: Registry Integration
80+
####################################################################################
81+
#basyx.aasrepository.feature.registryintegration=http://localhost:8050
82+
#basyx.externalurl=http://localhost:8081
83+
#basyx.aasrepository.feature.registryintegration.authorization.enabled=true
84+
#basyx.aasrepository.feature.registryintegration.authorization.token-endpoint=http://localhost/realms/BaSyx/protocol/openid-connect/token
85+
#basyx.aasrepository.feature.registryintegration.authorization.grant-type = CLIENT_CREDENTIALS
86+
#basyx.aasrepository.feature.registryintegration.authorization.client-id=workstation-1
87+
#basyx.aasrepository.feature.registryintegration.authorization.client-secret=nY0mjyECF60DGzNmQUjL81XurSl8etom
88+
89+
####################################################################################
90+
# Feature: Discovery Integration
91+
####################################################################################
92+
#basyx.aasrepository.feature.discoveryintegration=http://localhost:8084
93+
#basyx.aasrepository.feature.discoveryintegration.authorization.enabled=true
94+
#basyx.aasrepository.feature.discoveryintegration.authorization.token-endpoint=http://localhost/realms/BaSyx/protocol/openid-connect/token
95+
#basyx.aasrepository.feature.discoveryintegration.authorization.grant-type = CLIENT_CREDENTIALS
96+
#basyx.aasrepository.feature.discoveryintegration.authorization.client-id=workstation-1
97+
#basyx.aasrepository.feature.discoveryintegration.authorization.client-secret=nY0mjyECF60DGzNmQUjL81XurSl8etom
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
8+
<artifactId>basyx.aasrepository</artifactId>
9+
<version>${revision}</version>
10+
</parent>
11+
12+
<artifactId>basyx.aasrepository-feature-discovery-integration</artifactId>
13+
<name>BaSyx AAS Repository feature-discovery-integration</name>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
18+
<artifactId>basyx.aasdiscoveryservice-client</artifactId>
19+
</dependency>
20+
<dependency>
21+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
22+
<artifactId>basyx.aasrepository-core</artifactId>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
26+
<artifactId>basyx.http</artifactId>
27+
<scope>test</scope>
28+
<classifier>tests</classifier>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
32+
<artifactId>basyx.http</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
36+
<artifactId>basyx.aasrepository-http</artifactId>
37+
<classifier>tests</classifier>
38+
<scope>test</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
42+
<artifactId>basyx.filerepository-backend-inmemory</artifactId>
43+
<scope>test</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
47+
<artifactId>basyx.aasrepository-http</artifactId>
48+
<scope>test</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
52+
<artifactId>basyx.aasservice-backend-inmemory</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.eclipse.digitaltwin.basyx</groupId>
57+
<artifactId>basyx.aasrepository-backend-inmemory</artifactId>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.apache.httpcomponents.client5</groupId>
62+
<artifactId>httpclient5</artifactId>
63+
<scope>test</scope>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.mockito</groupId>
67+
<artifactId>mockito-core</artifactId>
68+
<scope>test</scope>
69+
</dependency>
70+
</dependencies>
71+
72+
</project>

0 commit comments

Comments
 (0)