Skip to content

Commit 07458c0

Browse files
author
faheem
committed
suggested changes from the main authors
1 parent fec73f8 commit 07458c0

16 files changed

Lines changed: 181 additions & 293 deletions

File tree

.github/workflows/docker_test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ jobs:
242242

243243
- name: Clean up
244244
run: exit 0
245-
246245
build-test-aasx-fileserver:
247246
runs-on: ubuntu-latest
248247
name: AASX File Server - Build and Start Docker Image

basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/LookupApiController.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,25 @@
5959
@RestController
6060
public class LookupApiController implements LookupApi {
6161

62-
private final AasDiscoveryService aasDiscoveryService;
62+
private final AasDiscoveryService aasDiscoveryService;
6363
private final ObjectMapper objectMapper;
6464

65-
@Autowired
66-
public LookupApiController(AasDiscoveryService aasDiscoveryService, ObjectMapper objectMapper) {
67-
this.aasDiscoveryService = aasDiscoveryService;
65+
@Autowired
66+
public LookupApiController(AasDiscoveryService aasDiscoveryService, ObjectMapper objectMapper) {
67+
this.aasDiscoveryService = aasDiscoveryService;
6868
this.objectMapper = objectMapper;
69-
}
69+
}
7070

71-
public ResponseEntity<Void> deleteAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier) {
72-
aasDiscoveryService.deleteAllAssetLinksById(aasIdentifier.getIdentifier());
71+
public ResponseEntity<Void> deleteAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier) {
72+
aasDiscoveryService.deleteAllAssetLinksById(aasIdentifier.getIdentifier());
7373

7474
return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
75-
}
75+
}
7676

77-
public ResponseEntity<PagedResult> getAllAssetAdministrationShellIdsByAssetLink(@Parameter(in = ParameterIn.QUERY, description = "A list of specific Asset identifiers. Each Asset identifier is a base64-url-encoded [SpecificAssetId](https://api.swaggerhub.com/domains/Plattform_i40/Part1-MetaModel-Schemas/V3.0.1#/components/schemas/SpecificAssetId)" ,schema=@Schema()) @Valid @RequestParam(value = "assetIds", required = false) List<Base64UrlEncodedIdentifier> assetIds,@Min(1)@Parameter(in = ParameterIn.QUERY, description = "The maximum number of elements in the response array" ,schema=@Schema(allowableValues={ "1" }, minimum="1"
78-
)) @Valid @RequestParam(value = "limit", required = false) Integer limit,@Parameter(in = ParameterIn.QUERY, description = "A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue" ,schema=@Schema()) @Valid @RequestParam(value = "cursor", required = false) String cursor) {
77+
public ResponseEntity<PagedResult> getAllAssetAdministrationShellIdsByAssetLink(@Parameter(in = ParameterIn.QUERY, description = "A list of specific Asset identifiers. Each Asset identifier is a base64-url-encoded [SpecificAssetId](https://api.swaggerhub.com/domains/Plattform_i40/Part1-MetaModel-Schemas/V3.0.1#/components/schemas/SpecificAssetId)" ,schema=@Schema()) @Valid @RequestParam(value = "assetIds", required = false) List<Base64UrlEncodedIdentifier> assetIds,@Min(1)@Parameter(in = ParameterIn.QUERY, description = "The maximum number of elements in the response array" ,schema=@Schema(allowableValues={ "1" }, minimum="1"
78+
)) @Valid @RequestParam(value = "limit", required = false) Integer limit,@Parameter(in = ParameterIn.QUERY, description = "A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue" ,schema=@Schema()) @Valid @RequestParam(value = "cursor", required = false) String cursor) {
7979

80-
if (limit == null)
80+
if (limit == null)
8181
limit = 100;
8282

8383
if (cursor == null)
@@ -99,19 +99,19 @@ public ResponseEntity<PagedResult> getAllAssetAdministrationShellIdsByAssetLink(
9999
paginatedAasIds.setPagingMetadata(new PagedResultPagingMetadata().cursor(filteredResult.getCursor()));
100100

101101
return new ResponseEntity<PagedResult>(paginatedAasIds, HttpStatus.OK);
102-
}
102+
}
103+
104+
public ResponseEntity<List<SpecificAssetId>> getAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier) {
105+
List<SpecificAssetId> assetLinks = aasDiscoveryService.getAllAssetLinksById(aasIdentifier.getIdentifier());
103106

104-
public ResponseEntity<List<SpecificAssetId>> getAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier) {
105-
List<SpecificAssetId> assetLinks = aasDiscoveryService.getAllAssetLinksById(aasIdentifier.getIdentifier());
106-
107-
return new ResponseEntity<>(assetLinks, HttpStatus.OK);
108-
}
107+
return new ResponseEntity<>(assetLinks, HttpStatus.OK);
108+
}
109109

110-
public ResponseEntity<List<SpecificAssetId>> postAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier,@Parameter(in = ParameterIn.DEFAULT, description = "A list of specific Asset identifiers", required=true, schema=@Schema()) @Valid @RequestBody List<SpecificAssetId> body) {
110+
public ResponseEntity<List<SpecificAssetId>> postAllAssetLinksById(@Parameter(in = ParameterIn.PATH, description = "The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)", required=true, schema=@Schema()) @PathVariable("aasIdentifier") Base64UrlEncodedIdentifier aasIdentifier,@Parameter(in = ParameterIn.DEFAULT, description = "A list of specific Asset identifiers", required=true, schema=@Schema()) @Valid @RequestBody List<SpecificAssetId> body) {
111111
List<SpecificAssetId> assetIDs = aasDiscoveryService.createAllAssetLinksById(aasIdentifier.getIdentifier(), body);
112-
113-
return new ResponseEntity<List<SpecificAssetId>>(assetIDs, HttpStatus.CREATED);
114-
}
112+
113+
return new ResponseEntity<List<SpecificAssetId>>(assetIDs, HttpStatus.CREATED);
114+
}
115115

116116
private List<AssetLink> getDecodedAssetLinks(List<Base64UrlEncodedIdentifier> assetIds) throws JsonProcessingException {
117117
List<AssetLink> result = new ArrayList<>();
@@ -122,11 +122,11 @@ private List<AssetLink> getDecodedAssetLinks(List<Base64UrlEncodedIdentifier> as
122122
for (Base64UrlEncodedIdentifier base64UrlEncodedIdentifier : assetIds) {
123123

124124
var decodedString = base64UrlEncodedIdentifier.getIdentifier();
125-
result.add(objectMapper.readValue(decodedString, AssetLink.class));
125+
result.add(objectMapper.readValue(decodedString, AssetLink.class));
126126

127127
}
128-
128+
129129
return result;
130130
}
131131

132-
}
132+
}

basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-http/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/http/documentation/AasDiscoveryServiceApiDocumentationConfiguration.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
/*******************************************************************************
22
* Copyright (C) 2023 the Eclipse BaSyx Authors
3-
*
3+
*
44
* Permission is hereby granted, free of charge, to any person obtaining
55
* a copy of this software and associated documentation files (the
66
* "Software"), to deal in the Software without restriction, including
77
* without limitation the rights to use, copy, modify, merge, publish,
88
* distribute, sublicense, and/or sell copies of the Software, and to
99
* permit persons to whom the Software is furnished to do so, subject to
1010
* the following conditions:
11-
*
11+
*
1212
* The above copyright notice and this permission notice shall be
1313
* included in all copies or substantial portions of the Software.
14-
*
14+
*
1515
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1616
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1717
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1818
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1919
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2020
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2121
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
*
22+
*
2323
* SPDX-License-Identifier: MIT
2424
******************************************************************************/
2525

@@ -33,7 +33,7 @@
3333

3434
/**
3535
* API documentation configuration for {@link AasDiscoveryService}
36-
*
36+
*
3737
* @author danish
3838
*
3939
*/
@@ -51,4 +51,5 @@ protected Info apiInfo() {
5151
.contact(apiContact())
5252
.license(apiLicence());
5353
}
54-
}
54+
55+
}

basyx.aasregistry/basyx.aasregistry-client-native/src/main/java/org/eclipse/digitaltwin/basyx/aasregistry/main/client/factory/AasDescriptorFactory.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,51 @@
11
/*******************************************************************************
22
* Copyright (C) 2023 the Eclipse BaSyx Authors
3-
*
3+
*
44
* Permission is hereby granted, free of charge, to any person obtaining
55
* a copy of this software and associated documentation files (the
66
* "Software"), to deal in the Software without restriction, including
77
* without limitation the rights to use, copy, modify, merge, publish,
88
* distribute, sublicense, and/or sell copies of the Software, and to
99
* permit persons to whom the Software is furnished to do so, subject to
1010
* the following conditions:
11-
*
11+
*
1212
* The above copyright notice and this permission notice shall be
1313
* included in all copies or substantial portions of the Software.
14-
*
14+
*
1515
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1616
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1717
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1818
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1919
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2020
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2121
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
*
22+
*
2323
* SPDX-License-Identifier: MIT
2424
******************************************************************************/
2525

2626
package org.eclipse.digitaltwin.basyx.aasregistry.main.client.factory;
2727

28-
import org.eclipse.digitaltwin.aas4j.v3.model.*;
28+
import java.net.MalformedURLException;
29+
import java.net.URL;
30+
import java.util.ArrayList;
31+
import java.util.List;
32+
33+
import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation;
34+
import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell;
35+
import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation;
36+
import org.eclipse.digitaltwin.aas4j.v3.model.Extension;
37+
import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType;
38+
import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType;
2939
import org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor;
3040
import org.eclipse.digitaltwin.basyx.aasregistry.client.model.Endpoint;
3141
import org.eclipse.digitaltwin.basyx.aasregistry.client.model.ProtocolInformation;
3242
import org.eclipse.digitaltwin.basyx.aasregistry.main.client.mapper.AttributeMapper;
3343
import org.eclipse.digitaltwin.basyx.core.RepositoryUrlHelper;
3444
import org.eclipse.digitaltwin.basyx.http.Base64UrlEncodedIdentifier;
3545

36-
import java.net.MalformedURLException;
37-
import java.net.URL;
38-
import java.util.ArrayList;
39-
import java.util.List;
40-
4146
/**
4247
* Factory for creating the {@link AssetAdministrationShellDescriptor}
43-
*
48+
*
4449
* @author danish, zielstor
4550
*/
4651
public class AasDescriptorFactory {
@@ -58,7 +63,7 @@ public AasDescriptorFactory(List<String> aasRepositoryBaseURLs, AttributeMapper
5863

5964
/**
6065
* Creates {@link AssetAdministrationShellDescriptor}
61-
*
66+
*
6267
* @return the created AssetAdministrationShellDescriptor
6368
*/
6469
public AssetAdministrationShellDescriptor create(AssetAdministrationShell shell) {
@@ -198,4 +203,4 @@ private static List<String> createAasRepositoryUrls(List<String> aasRepositoryBa
198203
}
199204
return toReturn;
200205
}
201-
}
206+
}

basyx.aasregistry/basyx.aasregistry-plugins/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<artifactId>basyx.aasregistry-plugins</artifactId>
99
<name>BaSyx AAS Registry Plugins</name>
1010
<description>BaSyx AAS Registry Plugins</description>
11-
11+
1212
<packaging>maven-plugin</packaging>
1313
<properties></properties>
1414
<dependencies>
@@ -39,7 +39,6 @@
3939
<dependency>
4040
<groupId>org.projectlombok</groupId>
4141
<artifactId>lombok</artifactId>
42-
<version>1.18.38</version>
4342
<optional>true</optional>
4443
</dependency>
4544
<dependency>
@@ -48,4 +47,4 @@
4847
<scope>test</scope>
4948
</dependency>
5049
</dependencies>
51-
</project>
50+
</project>

basyx.aasregistry/basyx.aasregistry-service-inmemory-storage/pom.xml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
65
<modelVersion>4.0.0</modelVersion>
7-
86
<parent>
97
<groupId>org.eclipse.digitaltwin.basyx</groupId>
108
<artifactId>basyx.aasregistry</artifactId>
119
<version>${revision}</version>
10+
1211
</parent>
1312

1413
<artifactId>basyx.aasregistry-service-inmemory-storage</artifactId>
@@ -39,30 +38,7 @@
3938
<dependency>
4039
<groupId>org.projectlombok</groupId>
4140
<artifactId>lombok</artifactId>
42-
<version>1.18.38</version>
4341
<optional>true</optional>
4442
</dependency>
4543
</dependencies>
46-
47-
<build>
48-
<plugins>
49-
<plugin>
50-
<groupId>org.apache.maven.plugins</groupId>
51-
<artifactId>maven-compiler-plugin</artifactId>
52-
<configuration>
53-
<annotationProcessorPaths>
54-
<path>
55-
<groupId>org.projectlombok</groupId>
56-
<artifactId>lombok</artifactId>
57-
<version>1.18.38</version>
58-
</path>
59-
</annotationProcessorPaths>
60-
<compilerArgs>
61-
<arg>-parameters</arg>
62-
</compilerArgs>
63-
</configuration>
64-
</plugin>
65-
</plugins>
66-
</build>
67-
68-
</project>
44+
</project>

basyx.aasregistry/basyx.aasregistry-service-kafka-events/pom.xml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
65
<modelVersion>4.0.0</modelVersion>
7-
86
<parent>
97
<groupId>org.eclipse.digitaltwin.basyx</groupId>
108
<artifactId>basyx.aasregistry</artifactId>
119
<version>${revision}</version>
10+
1211
</parent>
1312

1413
<artifactId>basyx.aasregistry-service-kafka-events</artifactId>
@@ -33,11 +32,9 @@
3332
<dependency>
3433
<groupId>org.projectlombok</groupId>
3534
<artifactId>lombok</artifactId>
36-
<version>1.18.38</version>
3735
<optional>true</optional>
3836
</dependency>
3937
</dependencies>
40-
4138
<dependencyManagement>
4239
<dependencies>
4340
<dependency>
@@ -49,26 +46,4 @@
4946
</dependency>
5047
</dependencies>
5148
</dependencyManagement>
52-
53-
<build>
54-
<plugins>
55-
<plugin>
56-
<groupId>org.apache.maven.plugins</groupId>
57-
<artifactId>maven-compiler-plugin</artifactId>
58-
<configuration>
59-
<annotationProcessorPaths>
60-
<path>
61-
<groupId>org.projectlombok</groupId>
62-
<artifactId>lombok</artifactId>
63-
<version>1.18.38</version>
64-
</path>
65-
</annotationProcessorPaths>
66-
<compilerArgs>
67-
<arg>-parameters</arg>
68-
</compilerArgs>
69-
</configuration>
70-
</plugin>
71-
</plugins>
72-
</build>
73-
74-
</project>
49+
</project>

0 commit comments

Comments
 (0)