Skip to content

Commit c8104f6

Browse files
Merge pull request #20 from eclipse-basyx/release/1.0.2
Release/1.0.2
2 parents dc8aaa7 + e2de216 commit c8104f6

File tree

27 files changed

+705
-93
lines changed

27 files changed

+705
-93
lines changed

basyx.components/basyx.components.docker/basyx.components.AASServer/pom.xml

Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?xml version="1.0"?>
22
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>org.eclipse.basyx</groupId>
7-
<artifactId>basyx.components.docker</artifactId>
8-
<version>1.0.1</version>
9-
</parent>
10-
11-
<artifactId>basyx.components.AASServer</artifactId>
12-
<name>AAS Server</name>
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.eclipse.basyx</groupId>
8+
<artifactId>basyx.components.docker</artifactId>
9+
<version>1.0.2</version>
10+
</parent>
11+
12+
<artifactId>basyx.components.AASServer</artifactId>
13+
<name>AAS Server</name>
1314

1415
<properties>
1516
<!--
@@ -25,11 +26,46 @@
2526
<!-- Plugin configuration is done in parent project(s) -->
2627
<build>
2728
<plugins>
29+
<plugin>
30+
<groupId>org.apache.maven.plugins</groupId>
31+
<artifactId>maven-compiler-plugin</artifactId>
32+
</plugin>
33+
2834
<!-- Attach sources to jar file -->
2935
<plugin>
3036
<groupId>org.apache.maven.plugins</groupId>
3137
<artifactId>maven-source-plugin</artifactId>
3238
</plugin>
39+
40+
<!-- Generate separate jar for tests and exclude logback.xml from generated jars -->
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-jar-plugin</artifactId>
44+
</plugin>
45+
46+
<!-- Run unit tests (Test*.java, *Test.java, *Tests.java and *TestCase.java excluding HTTP and TCP tests) -->
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-surefire-plugin</artifactId>
50+
</plugin>
51+
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-javadoc-plugin</artifactId>
55+
<version>3.2.0</version>
56+
<configuration>
57+
<source>8</source>
58+
</configuration>
59+
<executions>
60+
<execution>
61+
<goals>
62+
<goal>jar</goal>
63+
</goals>
64+
<id>generate-javadoc</id>
65+
<phase>package</phase>
66+
</execution>
67+
</executions>
68+
</plugin>
3369
</plugins>
3470
</build>
3571

@@ -61,7 +97,13 @@
6197
<artifactId>poi-ooxml</artifactId>
6298
<version>4.1.2</version>
6399
</dependency>
64-
100+
101+
<dependency>
102+
<groupId>org.eclipse.basyx</groupId>
103+
<artifactId>basyx.components.registry</artifactId>
104+
<version>1.0.3</version>
105+
<scope>test</scope>
106+
</dependency>
65107
</dependencies>
66108

67109
<profiles>
@@ -105,5 +147,24 @@
105147
</plugins>
106148
</build>
107149
</profile>
150+
151+
<profile>
152+
<id>MavenCentral</id>
153+
<build>
154+
<plugins>
155+
<!-- Upload to maven central -->
156+
<plugin>
157+
<groupId>org.sonatype.plugins</groupId>
158+
<artifactId>nexus-staging-maven-plugin</artifactId>
159+
</plugin>
160+
161+
<!-- Signing the artifacts -->
162+
<plugin>
163+
<groupId>org.apache.maven.plugins</groupId>
164+
<artifactId>maven-gpg-plugin</artifactId>
165+
</plugin>
166+
</plugins>
167+
</build>
168+
</profile>
108169
</profiles>
109-
</project>
170+
</project>

basyx.components/basyx.components.docker/basyx.components.AASServer/src/main/java/org/eclipse/basyx/components/aas/AASServerComponent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ private IAASAggregator loadMongoDBAggregator() {
340340
} else {
341341
config = this.mongoDBConfig;
342342
}
343-
MongoDBAASAggregator aggregator = new MongoDBAASAggregator(config);
344-
aggregator.setRegistry(registry);
343+
MongoDBAASAggregator aggregator = new MongoDBAASAggregator(config, registry);
345344
return aggregator;
346345
}
347346
}

basyx.components/basyx.components.docker/basyx.components.AASServer/src/main/java/org/eclipse/basyx/components/aas/executable/AASServerExecutable.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222

2323
/**
2424
* Starts an HTTP server that is able to receive AAS and submodels pushed from
25-
* remote <br />
25+
* remote <br>
2626
* They are made available at
2727
* <i>localhost:4000/aasServer/shells/${aasId}/aas</i>. Submodels are available
2828
* at
29-
* <i>localhost:4000/aasServer/shells/${aasId}/submodels/${submodelId}/submodel</i><br
30-
* />
29+
* <i>localhost:4000/aasServer/shells/${aasId}/submodels/${submodelId}/submodel</i><br>
3130
*
3231
* @author schnicke, espen
3332
*/

basyx.components/basyx.components.docker/basyx.components.AASServer/src/main/java/org/eclipse/basyx/components/aas/mongodb/MongoDBAASAPI.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class MongoDBAASAPI implements IAASAPI {
4949
/**
5050
* Receives the path of the configuration.properties file in it's constructor.
5151
*
52-
* @param configFilePath
52+
* @param config
5353
*/
5454
public MongoDBAASAPI(BaSyxMongoDBConfiguration config, String aasId) {
5555
this.setConfiguration(config);
@@ -84,7 +84,7 @@ public void setConfiguration(BaSyxMongoDBConfiguration config) {
8484
* Sets the aas id, so that this API points to the aas with aasId. Can be changed
8585
* to point to a different aas in the database.
8686
*
87-
* @param smId
87+
* @param aasId
8888
*/
8989
public void setAASId(String aasId) {
9090
this.aasId = aasId;
@@ -94,7 +94,7 @@ public void setAASId(String aasId) {
9494
* Depending on whether the model is already in the db, this method inserts or replaces the existing data.
9595
* The new aas id for this API is taken from the given aas.
9696
*
97-
* @param sm
97+
* @param aas
9898
*/
9999
public void setAAS(AssetAdministrationShell aas) {
100100
String id = aas.getIdentification().getId();
@@ -157,6 +157,8 @@ public void removeSubmodel(String id) {
157157
break;
158158
}
159159
}
160+
aas.setSubmodelReferences(smReferences);
161+
160162
// Update db entry
161163
mongoOps.findAndReplace(hasId, aas, collection);
162164
}

basyx.components/basyx.components.docker/basyx.components.AASServer/src/main/java/org/eclipse/basyx/components/aas/mongodb/MongoDBAASAggregator.java

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111

1212
import static org.springframework.data.mongodb.core.query.Criteria.where;
1313
import static org.springframework.data.mongodb.core.query.Query.query;
14-
1514
import java.util.ArrayList;
1615
import java.util.Collection;
1716
import java.util.HashMap;
1817
import java.util.List;
1918
import java.util.Map;
2019
import java.util.stream.Collectors;
21-
2220
import org.eclipse.basyx.aas.aggregator.AASAggregator;
2321
import org.eclipse.basyx.aas.aggregator.api.IAASAggregator;
2422
import org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell;
@@ -49,7 +47,6 @@
4947
import org.springframework.data.mongodb.core.MongoOperations;
5048
import org.springframework.data.mongodb.core.MongoTemplate;
5149
import org.springframework.data.mongodb.core.query.Query;
52-
5350
import com.mongodb.client.MongoClient;
5451
import com.mongodb.client.MongoClients;
5552

@@ -89,33 +86,82 @@ public class MongoDBAASAggregator implements IAASAggregator {
8986
/**
9087
* Receives the path of the configuration.properties file in it's constructor.
9188
*
92-
* @param configFilePath
89+
* @param config
9390
*/
9491
public MongoDBAASAggregator(BaSyxMongoDBConfiguration config) {
9592
this.setConfiguration(config);
9693
init();
9794
}
98-
95+
96+
/**
97+
* Receives the path of the configuration.properties file and the registry in it's constructor.
98+
*
99+
* @param config
100+
* @param registry
101+
*/
102+
public MongoDBAASAggregator(BaSyxMongoDBConfiguration config, IAASRegistry registry) {
103+
this.setConfiguration(config);
104+
this.registry = registry;
105+
init();
106+
}
107+
108+
/**
109+
* Sets the IAASRegistry instance.
110+
*
111+
* @deprecated This method is deprecated due to a bug.
112+
* Use constructors {@link #MongoDBAASAggregator(IAASRegistry)
113+
* or #MongoDBAASAggregator(BaSyxMongoDBConfiguration, IAASRegistry)
114+
* or #MongoDBAASAggregator(String, IAASRegistry) }
115+
* to set the IAASRegistry instance.
116+
*
117+
* @param registry Asset Adminstration Shell's Registry
118+
*/
119+
@Deprecated
99120
public void setRegistry(IAASRegistry registry) {
100121
this.registry = registry;
101122
}
102123

103124
/**
104125
* Receives the path of the .properties file in it's constructor from a resource.
126+
*
127+
* @param resourceConfigPath Path of the configuration file
105128
*/
106129
public MongoDBAASAggregator(String resourceConfigPath) {
107130
config = new BaSyxMongoDBConfiguration();
108131
config.loadFromResource(resourceConfigPath);
109132
this.setConfiguration(config);
110133
init();
111134
}
135+
136+
/**
137+
* Receives the path of the .properties file from a resource and the registry in it's constructor.
138+
*
139+
* @param resourceConfigPath Path of the configuration file
140+
* @param registry
141+
*/
142+
public MongoDBAASAggregator(String resourceConfigPath, IAASRegistry registry) {
143+
config = new BaSyxMongoDBConfiguration();
144+
config.loadFromResource(resourceConfigPath);
145+
this.setConfiguration(config);
146+
this.registry = registry;
147+
init();
148+
}
112149

113150
/**
114151
* Constructor using default connections
115152
*/
116153
public MongoDBAASAggregator() {
117154
this(DEFAULT_CONFIG_PATH);
118155
}
156+
157+
/**
158+
* Constructor using default connections with registry as a parameter
159+
*
160+
* @param registry
161+
*/
162+
public MongoDBAASAggregator(IAASRegistry registry) {
163+
this(DEFAULT_CONFIG_PATH, registry);
164+
}
119165

120166
/**
121167
* Sets the db configuration for this Aggregator.

basyx.components/basyx.components.docker/basyx.components.AASServer/src/main/java/org/eclipse/basyx/components/aas/mongodb/MongoDBSubmodelAPI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class MongoDBSubmodelAPI implements ISubmodelAPI {
6161
/**
6262
* Receives the path of the configuration.properties file in it's constructor.
6363
*
64-
* @param configFilePath
64+
* @param config
6565
*/
6666
public MongoDBSubmodelAPI(BaSyxMongoDBConfiguration config, String smId) {
6767
this.setConfiguration(config);

0 commit comments

Comments
 (0)