-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add submodel registry implementation (#39)
* Reference new JsonPatch Based maven plugin this plugin is a simpler approach to extend yaml or json files using jsonpatch * Add extension search and combinedWith aggregation of queries if extensionName is set in a search query, the path must point to the extension value - the extensionName is compared in addition using an equals test - we use combinedWith in the search query to aggregate queries - for all paths outside of a sm all queries must match - for paths pointing to a submodelDescriptor property, there needs to be at least one sm that matches all these queries in order that the hole request matches for that shell * Remove return value of path visitor The return value is not needed in most cases and not reliable considered * Add extension indeces Speeds up searching by extension name and value * Define source folders in POM in some projects we use src/generated/lava or src/main/lombok as source folders we define them now not in the .classpath but also in POM * Add client documentation for aggregate and extension search * Use fixed version for json patch * Remove unused empty file * Add submodel registry implementation * Add submodel registry to parent aggregator * Add and readme and fix readme files * Enable kafak logs and increase connection timeout for tests
- Loading branch information
Showing
147 changed files
with
9,966 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Basyx Submodel Registry | ||
|
||
This is a Java-based implementation of the Submodel Registry server and client based on the corresponding [Open-API specification](ttps://app.swaggerhub.com/apis/Plattform_i40/SubmodelRegistryServiceSpecification/V3.0.1_SSP-001) of the German Plattform Industrie 4.0. | ||
|
||
[basyx.submodelregistry-client-native](basyx.submodelregistry-client-native/README.md) can be used to interact with the backend to register or unregister descriptors and submodels or perform search operations. | ||
|
||
[basyx.submodelregistry-service](basyx.submodelregistry-service/README.md) provides the application server to access the submodel descriptor storage and offers an API for REST-based communication. | ||
|
||
[basyx.submodelregistry-service-basemodel](basyx.submodelregistry-service-basemodel/README.md) provides a base model implementation that should be used if you do not need specific model annotations for your storage. It is used for the in-memory storage implementation and you need to add it explicitly as dependency for your server deployment as it is defined as 'provided' dependency in the [basyx.submodelregistry-service](basyx.submodelregistry-service/README.md) POM. | ||
|
||
[basyx.submodelregistry-service-basetests](basyx.submodelregistry-service-basetests/README.md) provides helper classes and abstract test classes that can be extended in storage tests or integration tests. The abstract test classes already define test methods so that you will get a good test coverage without writing any additional test cases. | ||
|
||
[basyx.submodelregistry-service-mongodb-storage](basyx.submodelregistry-service-mongodb-storage/README.md) provides a registry-storage implementation based on mongoDB that could be used as storage for [submodelregistry-service](basyx.submodelregistry-service/README.md). It comes with java-based model classes, annotated with mongoDB annotations. | ||
|
||
[basyx.submodelregistry-service-inmemory-storage](basyx.submodelregistry-service-inmemory-storage/README.md) provides a non-persistent registry-storage implementation where instances are stored in hash maps. It can be used as storage for [submodelregistry-service](basyx.submodelregistry-service/README.md). | ||
|
||
[basyx.submodelregistry-service-kafka-events](basyx.submodelregistry-service-kafka-events/README.md) extends basyx.submodelregistry-service with a registry-event-sink implementation that delivers shell descriptor and submodel registration events using Apache Kafka. The default provided by submodelregistry-service just logs the events. | ||
|
||
[basyx.submodelregistry-service-release-kafka-mongodb](basyx.submodelregistry-service-release-kafka-mongodb/README.md) is used to combine the server artifacts to a release image that uses [Apache Kafka](https://kafka.apache.org/) as event sink and [MongoDB](https://www.mongodb.com/) as storage. | ||
|
||
[basyx.submodelregistry-service-release-kafka-mem](basyx.submodelregistry-service-release-kafka-mem/README.md) is used to combine the server artifacts to a release image that uses Apache Kafka as event sink and an in-memory storage. | ||
|
||
[basyx.submodelregistry-service-release-log-mongodb](basyx.submodelregistry-service-release-log-mongodb/README.md) is used to combine the server artifacts to a release image that logs registry events and uses MongoDB as data storage. | ||
|
||
[basyx.submodelregistry-service-release-log-mem](basyx.submodelregistry-service-release-log-mem/README.md) is used to combine the server artifacts to a release image that logs registry events and an in-memory storage. | ||
|
||
A docker-compose file that illustrates the setup can be found in the [docker-compose](docker-compose/docker-compose.yml) folder. | ||
|
||
|
||
# Important | ||
|
||
The REST API and the client implementation will not be modified - if not a SNAPSHOT version - until a new major version is released or an update of the openAPI definition. All server-side classes and the plugins are not intended to be used as programming library. They could be updated or removed then a new minor version is released. | ||
|
||
# Build Resources | ||
|
||
To build the images run these commands from this folder or for the parent project pom: | ||
|
||
Install maven generate jars: | ||
|
||
``` shell | ||
mvn clean install | ||
``` | ||
|
||
In order to build the docker images, you need to specify *docker.username* and *docker.password* properties (here without running tests): | ||
|
||
``` shell | ||
MAVEN_OPS='-Xmx2048 -Xms1024' mvn clean install -DskipTests -Ddocker.username=eclipsebasyx -Ddocker.password="" | ||
``` | ||
|
||
You can now check your images from command-line and push the images: | ||
``` shell | ||
docker images ... | ||
``` | ||
Or you can directly push them from maven. | ||
|
||
``` shell | ||
MAVEN_OPS='-Xmx2048 -Xms1024' mvn deploy -Ddocker.registry=docker.io -Ddocker.username=eclipsebasyx -Ddocker.password=pwd | ||
``` | ||
In addition, maven deploy will also deploy your maven artifacts, so you can do everything in one step. | ||
|
||
Have a look at the *docker-compose* sub-folder to see how the created images could be referenced in docker-compose files. | ||
|
||
Consider updating the [image name pattern](pom.xml#L16) if you want a different image name. |
11 changes: 11 additions & 0 deletions
11
basyx.submodelregistry/basyx.submodelregistry-client-native/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Basyx Submodel Registry Client Native | ||
|
||
This is the generated java openAPI client (based on native java with jackson parsing) that can be used to communicate with the submodel registry server. | ||
|
||
To use the client in your maven projects define the following dependency: | ||
```xml | ||
<dependency> | ||
<groupId>org.eclipse.digitaltwin.basyx.submodelregistry</groupId> | ||
<artifactId>basyx.submodelregistry-client-native</artifactId> | ||
</dependency> | ||
``` |
Empty file.
130 changes: 130 additions & 0 deletions
130
basyx.submodelregistry/basyx.submodelregistry-client-native/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.digitaltwin.basyx</groupId> | ||
<artifactId>basyx.submodelregistry</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<artifactId>basyx.submodelregistry-client-native</artifactId> | ||
|
||
<packaging>jar</packaging> | ||
<properties> | ||
<openapi.result.folder>${project.basedir}/${openapi.folder.name}</openapi.result.folder> | ||
<openapi.result.file>${openapi.result.folder}/${openapi.name}</openapi.result.file> | ||
</properties> | ||
<build> | ||
<sourceDirectory>${generated.folder}/java</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<configuration> | ||
<filesets> | ||
<fileset> | ||
<directory>${project.basedir}/${generated.folder}</directory> | ||
<excludes> | ||
<exclude>**/.gitkeep</exclude> | ||
</excludes> | ||
<followSymlinks>false</followSymlinks> | ||
</fileset> | ||
<fileset> | ||
<directory>${openapi.result.folder}</directory> | ||
<excludes> | ||
<exclude>**/.gitkeep</exclude> | ||
</excludes> | ||
<followSymlinks>false</followSymlinks> | ||
</fileset> | ||
</filesets> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>de.dfki.cos.basys.common</groupId> | ||
<artifactId>jsonpatch-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>jsonpatch-maven-plugin</goal> | ||
</goals> | ||
<configuration> | ||
<input>${project.basedir}/../${openapi.folder.name}/${openapi.base.name}</input> | ||
<patch>${project.basedir}/../${openapi.folder.name}/${patch.base-extensions.name}</patch> | ||
<output>${openapi.result.file}</output> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>openapi-generator-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<generatorName>java</generatorName> | ||
<library>native</library> | ||
<inputSpec>${openapi.result.file}</inputSpec> | ||
<output>${project.basedir}/${generated.folder}</output> | ||
<apiPackage>org.eclipse.digitaltwin.basyx.submodelregistry.client.api</apiPackage> | ||
<invokerPackage>org.eclipse.digitaltwin.basyx.submodelregistry.client</invokerPackage> | ||
<modelPackage>org.eclipse.digitaltwin.basyx.submodelregistry.client.model</modelPackage> | ||
<generateModels>true</generateModels> | ||
<generateApis>true</generateApis> | ||
<generateApiTests>false</generateApiTests> | ||
<generateModelDocumentation>false</generateModelDocumentation> | ||
<generateApiDocumentation>false</generateApiDocumentation> | ||
<generateSupportingFiles>true</generateSupportingFiles> | ||
<templateDirectory>${project.basedir}/templates</templateDirectory> | ||
<supportingFilesToGenerate>AbstractOpenApiSchema.java,ServerConfiguration.java,ServerVariable.java,Configuration.java,JSON.java,ApiException.java,ApiResponse.java,ApiClient.java,Pair.java,RFC3339DateFormat.java</supportingFilesToGenerate> | ||
<configOptions> | ||
<java8>true</java8> | ||
<dateLibrary>java8</dateLibrary> | ||
<sourceFolder>java</sourceFolder> | ||
</configOptions> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>3.9.0</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>jackson-databind-nullable</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.annotation</groupId> | ||
<artifactId>javax.annotation-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.findbugs</groupId> | ||
<artifactId>jsr305</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Oops, something went wrong.