Skip to content

Commit

Permalink
Merge pull request #221 from mdanish98/update/aas-disc
Browse files Browse the repository at this point in the history
Resolves conflicts with main for update/aas-discovery branch
  • Loading branch information
FrankSchnicke authored Feb 20, 2024
2 parents a9a6367 + 5241e0e commit 47cbc1c
Show file tree
Hide file tree
Showing 316 changed files with 12,143 additions and 3,422 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven_run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Start environment
run: docker compose up -d --wait
- name: Install BaSyx
run: mvn clean install
run: mvn clean install -Ddocker.namespace=test
- name: Stop environment
if: always()
run: docker compose down
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ In addition to the [general documentation](https://github.com/eclipse-basyx/basy
Furthermore, we are providing easy to use [examples](examples) that can be leveraged for setting up your own AAS infrastructure.
The future roadmap of BaSyx is described [here](https://github.com/eclipse-basyx/basyx-java-server-sdk/blob/main/docs/Roadmap.md).

## Snapshot Releases
We're distributing our SNAPSHOT releases via Maven Central. For using them, add the following part to your project's POM:

```
<repository>
<id>sonatype.snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
```

## Contributing

If you would like to contribute, please notice the [contribution guidelines](CONTRIBUTING.md). The overall process is described in the [Eclipse wiki](https://wiki.eclipse.org/BaSyx_/_Developer_/_Contributing).
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>model</artifactId>
<artifactId>aas4j-model</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>dataformat-json</artifactId>
<artifactId>aas4j-dataformat-json</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
package org.eclipse.digitaltwin.basyx.aasdiscoveryservice.http;

import java.util.List;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
Expand All @@ -35,10 +37,10 @@
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import org.eclipse.digitaltwin.aas4j.v3.model.Result;
import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.http.pagination.InlineResponse200;
import org.eclipse.digitaltwin.basyx.http.Base64UrlEncodedIdentifier;
import org.eclipse.digitaltwin.basyx.http.model.Result;
import org.eclipse.digitaltwin.basyx.http.pagination.PagedResult;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
Expand All @@ -47,10 +49,10 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import jakarta.annotation.Generated;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import java.util.List;

@Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2023-10-10T10:16:17.046754509Z[GMT]")
@Validated
Expand Down
12 changes: 7 additions & 5 deletions basyx.aasenvironment/basyx.aasenvironment-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
</parent>

<artifactId>basyx.aasenvironment-core</artifactId>
<name>BaSyx AAS Environment Core</name>
<description>BaSyx AAS Environment Core</description>

<dependencies>
<dependency>
Expand Down Expand Up @@ -68,23 +70,23 @@

<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>dataformat-json</artifactId>
<artifactId>aas4j-dataformat-json</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>dataformat-xml</artifactId>
<artifactId>aas4j-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>dataformat-aasx</artifactId>
<artifactId>aas4j-dataformat-aasx</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>dataformat-core</artifactId>
<artifactId>aas4j-dataformat-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.aas4j</groupId>
<artifactId>model</artifactId>
<artifactId>aas4j-model</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException;

/**
* Specifies the overall AasEnvironment serialization API
* Specifies the overall AasEnvironment API
*
* @author zhangzai, danish
*
*/
public interface AasEnvironmentSerialization {
public interface AasEnvironment {

/**
* Generate serialization from given aas and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright (C) 2024 the Eclipse BaSyx Authors
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* SPDX-License-Identifier: MIT
******************************************************************************/
package org.eclipse.digitaltwin.basyx.aasenvironment;

/**
* Interface for a factory creating an {@link AasEnvironment}
*
* @author schnicke, danish
*
*/
public interface AasEnvironmentFactory {

/**
* Creates a new {@link AasEnvironment}
*
* @return
*/
public AasEnvironment create();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*******************************************************************************
* Copyright (C) 2024 the Eclipse BaSyx Authors
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* SPDX-License-Identifier: MIT
******************************************************************************/

package org.eclipse.digitaltwin.basyx.aasenvironment;

import org.eclipse.digitaltwin.basyx.aasenvironment.base.DefaultAASEnvironment;
import org.eclipse.digitaltwin.basyx.aasrepository.AasRepository;
import org.eclipse.digitaltwin.basyx.conceptdescriptionrepository.ConceptDescriptionRepository;
import org.eclipse.digitaltwin.basyx.submodelrepository.SubmodelRepository;
import org.springframework.stereotype.Component;

/**
* Default {@link AasEnvironment} factory that creates an {@link AasEnvironment}
*
* @author danish
*
*/
@Component
public class DefaultAasEnvironmentFactory implements AasEnvironmentFactory {

private AasRepository aasRepository;
private SubmodelRepository submodelRepository;
private ConceptDescriptionRepository conceptDescriptionRepository;

public DefaultAasEnvironmentFactory(AasRepository aasRepository, SubmodelRepository submodelRepository, ConceptDescriptionRepository conceptDescriptionRepository) {
this.aasRepository = aasRepository;
this.submodelRepository = submodelRepository;
this.conceptDescriptionRepository = conceptDescriptionRepository;
}

@Override
public AasEnvironment create() {
return new DefaultAASEnvironment(aasRepository, submodelRepository, conceptDescriptionRepository);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private String getSerializedShells(List<AssetAdministrationShell> originalShells

private List<AssetAdministrationShell> getDeserializedShells(String serializedShells) {
try {
return jsonDeserializer.readReferables(serializedShells, AssetAdministrationShell.class);
return jsonDeserializer.readList(serializedShells, AssetAdministrationShell.class);
} catch (DeserializationException e) {
e.printStackTrace();
throw new RuntimeException("Unable to deserialize the AASs");
Expand All @@ -111,7 +111,7 @@ private String getSerializedSubmodels(List<Submodel> originalSubmodels) {

private List<Submodel> getDeserializedSubmodels(String serializedSubmodels) {
try {
return jsonDeserializer.readReferables(serializedSubmodels, Submodel.class);
return jsonDeserializer.readList(serializedSubmodels, Submodel.class);
} catch (DeserializationException e) {
e.printStackTrace();
throw new RuntimeException("Unable to deserialize the Submodels");
Expand All @@ -129,7 +129,7 @@ private String getSerializedCDs(List<ConceptDescription> originalCDs) {

private List<ConceptDescription> getDeserializedCDs(String serializedCDs) {
try {
return jsonDeserializer.readReferables(serializedCDs, ConceptDescription.class);
return jsonDeserializer.readList(serializedCDs, ConceptDescription.class);
} catch (DeserializationException e) {
e.printStackTrace();
throw new RuntimeException("Unable to deserialize the Concept descriptions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.eclipse.digitaltwin.aas4j.v3.model.Environment;
import org.eclipse.digitaltwin.aas4j.v3.model.Submodel;
import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment;
import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironmentSerialization;
import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironment;
import org.eclipse.digitaltwin.basyx.aasenvironment.ConceptDescriptionIdCollector;
import org.eclipse.digitaltwin.basyx.aasenvironment.MetamodelCloneCreator;
import org.eclipse.digitaltwin.basyx.aasrepository.AasRepository;
Expand All @@ -51,13 +51,13 @@
import org.slf4j.LoggerFactory;

/**
* Default implementation of {@link AasEnvironmentSerialization}
* Default implementation of {@link AasEnvironment}
*
* @author zhangzai, danish
*/
public class DefaultAASEnvironmentSerialization implements AasEnvironmentSerialization {
public class DefaultAASEnvironment implements AasEnvironment {

private static Logger logger = LoggerFactory.getLogger(DefaultAASEnvironmentSerialization.class);
private static Logger logger = LoggerFactory.getLogger(DefaultAASEnvironment.class);

private AasRepository aasRepository;
private SubmodelRepository submodelRepository;
Expand All @@ -67,7 +67,7 @@ public class DefaultAASEnvironmentSerialization implements AasEnvironmentSeriali
private AASXSerializer aasxSerializer = new AASXSerializer();
private MetamodelCloneCreator cloneCreator = new MetamodelCloneCreator();

public DefaultAASEnvironmentSerialization(AasRepository aasRepository, SubmodelRepository submodelRepository, ConceptDescriptionRepository conceptDescriptionRepository) {
public DefaultAASEnvironment(AasRepository aasRepository, SubmodelRepository submodelRepository, ConceptDescriptionRepository conceptDescriptionRepository) {
this.aasRepository = aasRepository;
this.submodelRepository = submodelRepository;
this.conceptDescriptionRepository = conceptDescriptionRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*******************************************************************************
* Copyright (C) 2024 the Eclipse BaSyx Authors
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* SPDX-License-Identifier: MIT
******************************************************************************/
package org.eclipse.digitaltwin.basyx.aasenvironment.feature;

import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironment;
import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironmentFactory;
import org.eclipse.digitaltwin.basyx.core.BaSyxFeature;

/**
* Base interface for all features for the {@link AasEnvironment}
*
* @author schnicke, danish
*
*/
public interface AasEnvironmentFeature extends BaSyxFeature<AasEnvironmentFactory> {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2023 DFKI GmbH (https://www.dfki.de/en/web)
* Copyright (C) 2024 the Eclipse BaSyx Authors
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
Expand All @@ -22,26 +22,29 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/
package org.eclipse.digitaltwin.basyx.aasregistry.service.configuration;

import org.eclipse.digitaltwin.basyx.aasregistry.model.AssetKind;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
package org.eclipse.digitaltwin.basyx.aasenvironment.feature;

import java.util.List;

@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToEnumConverter());
import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironmentFactory;
import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironment;
import org.eclipse.digitaltwin.basyx.core.DecoratedFactory;

/**
* Factory for {@link AasEnvironment} decoration
*
* @author schnicke, danish
*
*/
public class DecoratedAasEnvironmentFactory extends DecoratedFactory<AasEnvironmentFactory, AasEnvironmentFeature> implements AasEnvironmentFactory {

public DecoratedAasEnvironmentFactory(AasEnvironmentFactory toDecorate, List<AasEnvironmentFeature> features) {
super(toDecorate, features);
}

public static class StringToEnumConverter implements Converter<String, AssetKind> {
@Override
public AssetKind convert(String source) {
return AssetKind.fromValue(source);
}
@Override
public AasEnvironment create() {
return getDecorated().create();
}
}
Loading

0 comments on commit 47cbc1c

Please sign in to comment.