From c231307f3f6e754a82aef0c57202e9d4e9add402 Mon Sep 17 00:00:00 2001 From: Mohammad Ghazanfar Ali Danish Date: Tue, 5 Nov 2024 14:36:49 +0100 Subject: [PATCH] Refactors codes and add license headers Signed-off-by: Mohammad Ghazanfar Ali Danish --- .../mongodb/AasMongoDBBackendProvider.java | 2 +- .../TestAasMongoDBFilterResolution.java | 30 +++++++++++++++++++ .../basyx.aasrepository-backend/pom.xml | 4 --- .../mongocore/MongoDBCrudRepository.java | 25 ++++++++++++++++ 4 files changed, 56 insertions(+), 5 deletions(-) diff --git a/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/AasMongoDBBackendProvider.java b/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/AasMongoDBBackendProvider.java index b055f4e6e..986df6549 100644 --- a/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/AasMongoDBBackendProvider.java +++ b/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/AasMongoDBBackendProvider.java @@ -61,7 +61,7 @@ public AasMongoDBBackendProvider(BasyxMongoMappingContext mappingContext, @Value this.mappingContext = mappingContext; this.template = template; -// configureIndices(this.template); + configureIndices(this.template); mappingContext.addEntityMapping(AssetAdministrationShell.class, collectionName); } diff --git a/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/TestAasMongoDBFilterResolution.java b/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/TestAasMongoDBFilterResolution.java index 8c2b9e90b..f98078263 100644 --- a/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/TestAasMongoDBFilterResolution.java +++ b/basyx.aasrepository/basyx.aasrepository-backend-mongodb/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/backend/mongodb/TestAasMongoDBFilterResolution.java @@ -1,3 +1,28 @@ +/******************************************************************************* + * 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.aasrepository.backend.mongodb; import static org.junit.Assert.*; @@ -18,6 +43,11 @@ import org.springframework.data.mongodb.core.aggregation.AggregationOperation; import org.springframework.data.mongodb.core.aggregation.MatchOperation; +/** + * Tests {@link AasMongoDBFilterResolution} + * + * @author danish + */ public class TestAasMongoDBFilterResolution { private AasMongoDBFilterResolution filterResolution; diff --git a/basyx.aasrepository/basyx.aasrepository-backend/pom.xml b/basyx.aasrepository/basyx.aasrepository-backend/pom.xml index 598ee779a..5936dd14a 100644 --- a/basyx.aasrepository/basyx.aasrepository-backend/pom.xml +++ b/basyx.aasrepository/basyx.aasrepository-backend/pom.xml @@ -19,10 +19,6 @@ org.eclipse.digitaltwin.basyx basyx.aasrepository-core - - org.eclipse.digitaltwin.basyx - basyx.mongodbcore - org.springframework.data spring-data-commons diff --git a/basyx.common/basyx.mongocore/src/main/java/org/eclipse/digitaltwin/basyx/common/mongocore/MongoDBCrudRepository.java b/basyx.common/basyx.mongocore/src/main/java/org/eclipse/digitaltwin/basyx/common/mongocore/MongoDBCrudRepository.java index f25d4ccb1..c04b8203a 100644 --- a/basyx.common/basyx.mongocore/src/main/java/org/eclipse/digitaltwin/basyx/common/mongocore/MongoDBCrudRepository.java +++ b/basyx.common/basyx.mongocore/src/main/java/org/eclipse/digitaltwin/basyx/common/mongocore/MongoDBCrudRepository.java @@ -1,3 +1,28 @@ +/******************************************************************************* + * 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.common.mongocore; import java.util.LinkedList;