Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3c60720
refactor: change backend arch for the cdRepo
MateusMolina Feb 6, 2025
490d6ef
tests: fix remaining mongodb rel. tests from cdrepo
MateusMolina Feb 6, 2025
6ffae44
Merge branch 'main' of github.com:mateusmolina-iese/basyx-java-server…
MateusMolina Feb 12, 2025
d38c7c5
fix: issue with conflicting mappingMongoEntities
MateusMolina Feb 12, 2025
092aebe
refactor: rename collection fields for MongoDb Configs
MateusMolina Feb 12, 2025
dfd324c
refactor: cdrepo: update MongoDB test configuration and clean up redu…
MateusMolina Feb 12, 2025
85a5056
tests: aasrepo: refactor mongodb tests to follow same pattern as cdrepo
MateusMolina Feb 12, 2025
b1fbf32
refactor: aasrepo: improve creation logic of CrudAasRepository
MateusMolina Feb 12, 2025
16a1ec4
refactor: aasxfileserver: implement new arch
MateusMolina Feb 12, 2025
1af4a36
refactor: aasxfileserver: add file repository dependency
MateusMolina Feb 13, 2025
a913a54
tests: aasxfileserver: fix for MongoDb tests
MateusMolina Feb 13, 2025
7e6cfdd
refactor: aasxfileserver: replace package ID generation with UUID
MateusMolina Feb 13, 2025
e1e7957
refactor: aasdiscoveryservice: impl new arch
MateusMolina Feb 13, 2025
adcbb9d
refactor: aasdiscoveryservice: rename SimpleAasDiscoveryFactory to Cr…
MateusMolina Feb 13, 2025
87a5aba
Merge branch 'main' of https://github.com/eclipse-basyx/basyx-java-se…
MateusMolina Feb 13, 2025
6c53368
tests: aasdiscoveryservice: fix failing component test
MateusMolina Feb 13, 2025
931f789
refactor: smrepo: impl new arch
MateusMolina Feb 13, 2025
f382730
refactor: smrepo: rename SimpleSubmodelRepositoryFactory to CrudSubmo…
MateusMolina Feb 13, 2025
6fe0208
refactor: smrepo: remove wrongly packaged classes
MateusMolina Feb 13, 2025
2d7f7f2
refactor: smrepo: add submodelOperations for submodelBackend
MateusMolina Feb 13, 2025
f38d2d0
fix: inconsistency load order for BasyxMongoMappingContext
MateusMolina Feb 14, 2025
55ac8b5
feat: smservice: implement MongoDbSubmodelOperations
MateusMolina Feb 17, 2025
b361095
refactor: smservice: add SubmodelFileOperations interface and integra…
MateusMolina Feb 17, 2025
1aea7be
fix: smrepo: failing tests
MateusMolina Feb 17, 2025
5746d3f
fix: aasservice: getSubmodelReferences pagination handling
MateusMolina Feb 18, 2025
7b7747b
wip: refactor: smservice: create smservice-backend; move SubmodelBack…
MateusMolina Feb 18, 2025
933bb0b
refactor: smservice: introduce SingleSubmodelBackend and update servi…
MateusMolina Feb 18, 2025
220f35a
feat: smservice: add general CrudSubmodelService and adapt -backend-m…
MateusMolina Feb 18, 2025
04e6f5d
Merge branch 'main' into feat/refactor-other-repos-arch
MateusMolina Feb 19, 2025
e027f87
wip: refactor: smrepo/service: change fragment injection strategy
MateusMolina Feb 19, 2025
105c06c
wip: refactor: smrepo/service: simplify SubmodelBackend
MateusMolina Feb 20, 2025
1aebc5b
Merge branch 'main' into feat/refactor-other-repos-arch
MateusMolina Feb 20, 2025
b838bad
refactor: smservice: update invokeOperation method to handle invokabl…
MateusMolina Feb 20, 2025
44a0da6
refactor: smrepository: update CrudSubmodelRepository to use Submodel…
MateusMolina Feb 20, 2025
d5df214
refactor: improve naming consistency across modules
MateusMolina Feb 20, 2025
7b9fcde
refactor: aasrepo/service: to follow the same implementation strategy…
MateusMolina Feb 21, 2025
fa32ea9
fix: aasrepo: incorrect pars calls
MateusMolina Feb 24, 2025
ca3ba42
refactor: consistency fixes
MateusMolina Feb 24, 2025
7b09eff
Merge branch 'main' into feat/refactor-other-repos-arch
MateusMolina Feb 24, 2025
7803b37
chore: add missing license headers; bump year
MateusMolina Feb 24, 2025
b0a74fd
docs: improve Javadoc comments for AAS and Submodel operations
MateusMolina Feb 24, 2025
cb1f7a3
tests: add MongoDB configuration and test setup for AAS service
MateusMolina Feb 25, 2025
ffe92f8
tests: add missing assertTrue import
MateusMolina Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2024 the Eclipse BaSyx Authors
* Copyright (C) 2025 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 @@ -25,28 +25,23 @@

package org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.inmemory;

import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.AasDiscoveryBackendProvider;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.AasDiscoveryDocument;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.AasDiscoveryDocumentBackend;
import org.eclipse.digitaltwin.basyx.common.backend.inmemory.core.InMemoryCrudRepository;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

/**
* InMemory backend for the AasDiscoveryDocument based on InMemoryCrudRepository
*
* InMemory backend provider for the AAS Discovery
*
* @author zielstor, fried
* @author mateusmolina
*/
@ConditionalOnExpression("'${basyx.backend}'.equals('InMemory')")
@Component
public class AasDiscoveryInMemoryBackendProvider implements AasDiscoveryBackendProvider {

private CrudRepository<AasDiscoveryDocument, String> repository = new InMemoryCrudRepository<AasDiscoveryDocument>(AasDiscoveryDocument::getShellIdentifier);
public class InMemoryAasDiscoveryDocumentBackend extends InMemoryCrudRepository<AasDiscoveryDocument> implements AasDiscoveryDocumentBackend {

@Override
public CrudRepository<AasDiscoveryDocument, String> getCrudRepository() {
return repository;
public InMemoryAasDiscoveryDocumentBackend() {
super(AasDiscoveryDocument::getShellIdentifier);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2023 the Eclipse BaSyx Authors
* Copyright (C) 2025 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 @@ -25,7 +25,7 @@

package org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.inmemory;

import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.SimpleAasDiscoveryFactory;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.CrudAasDiscoveryFactory;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryServiceSuite;

Expand All @@ -39,7 +39,7 @@ public class TestInMemoryAasDiscoveryService extends AasDiscoveryServiceSuite {

@Override
protected AasDiscoveryService getAasDiscoveryService() {
return new SimpleAasDiscoveryFactory(new AasDiscoveryInMemoryBackendProvider()).create();
return new CrudAasDiscoveryFactory(new InMemoryAasDiscoveryDocumentBackend()).create();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasdiscoveryservice-backend</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (C) 2023 the Eclipse BaSyx Authors
*
* Copyright (C) 2025 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
Expand All @@ -19,33 +19,37 @@
* 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.submodelrepository;

import org.eclipse.digitaltwin.basyx.core.filerepository.FileRepository;
import org.eclipse.digitaltwin.basyx.submodelservice.InMemorySubmodelServiceFactory;
import org.eclipse.digitaltwin.basyx.submodelservice.SubmodelServiceFactory;
package org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend;

import org.eclipse.digitaltwin.basyx.common.mongocore.MappingEntry;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

/**
* Provides a InMemorySubmodelServiceFactory for usage in the MongoDB Submodel
* Repository backend.<br>
* <br>
* This is needed to ensure that the SubmodelServiceFeatures are processed
* correctly when utilizing MongoDb
*
* @author jungjan
* Provides the MongoDB configuration for the {@link AasDiscoveryDocumentBackend}
*
* @author mateusmolina
*
*/
@Configuration
@ConditionalOnExpression("'${basyx.backend}'.equals('MongoDB')")
public class MongoDBSubmodelRepositoryConfiguration {
@EnableMongoRepositories(basePackages = "org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend")
public class MongoDBAasDiscoveryDocumentBackendConfiguration {

static final String COLLECTION_NAME_FIELD = "basyx.aasdiscoveryservice.mongodb.collectionName";
static final String DEFAULT_COLLECTION_NAME = "aasdiscovery-service";

@Bean
public SubmodelServiceFactory getInMemorySubmodelServiceFactory(FileRepository fileRepository) {
return new InMemorySubmodelServiceFactory(fileRepository);
MappingEntry aasDiscoveryDocumentMappingEntry(@Value("${" + COLLECTION_NAME_FIELD + ":" + DEFAULT_COLLECTION_NAME + "}") String collectionName) {
return MappingEntry.of(collectionName, AasDiscoveryDocument.class);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2024 the Eclipse BaSyx Authors
* Copyright (C) 2025 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 @@ -25,15 +25,10 @@

package org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.mongodb;

import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.backend.SimpleAasDiscoveryFactory;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryService;
import org.eclipse.digitaltwin.basyx.common.mongocore.BasyxMongoMappingContext;
import org.eclipse.digitaltwin.basyx.aasdiscoveryservice.core.AasDiscoveryServiceFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;

import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;

/**
* Configuration for tests
Expand All @@ -44,22 +39,11 @@
@Configuration
public class DummyDiscoveryServiceConfig {

public final static String COLLECTION = "discoveryServicePersistencyTestCollection";
public final static String DB = "BaSyxTestDb";

@Bean
public AasDiscoveryService createAasDiscoveryService(MongoTemplate template) {
return new SimpleAasDiscoveryFactory(
new AasDiscoveryMongoDBBackendProvider(new BasyxMongoMappingContext(), COLLECTION, template)).create();
}
static final String TEST_COLLECTION = "discoveryServiceTestCollection";

@Bean
public MongoTemplate createMongoTemplate() {
String connectionURL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/";

MongoClient client = MongoClients.create(connectionURL);

return new MongoTemplate(client, DB);
AasDiscoveryService aasDiscoveryService(AasDiscoveryServiceFactory factory) {
return factory.create();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (C) 2024 the Eclipse BaSyx Authors
* Copyright (C) 2025 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 Down Expand Up @@ -51,7 +51,7 @@ public static void initComponent() {
@Before
public void clearTemplate() {
MongoTemplate mongoTemplate = applicationContext.getBean(MongoTemplate.class);
MongoDBUtilities.clearCollection(mongoTemplate, DummyDiscoveryServiceConfig.COLLECTION);
MongoDBUtilities.clearCollection(mongoTemplate, DummyDiscoveryServiceConfig.TEST_COLLECTION);
}

@Override
Expand Down
Loading
Loading