From 5651f1933d043cf532be4b111387974ee7f37f1c Mon Sep 17 00:00:00 2001 From: Aliou DIAITE Date: Wed, 11 Oct 2023 10:28:02 +0200 Subject: [PATCH] feat(#336): remove sct-data module and update documents Signed-off-by: Aliou DIAITE --- docs/QUICK_START.md | 1 - docs/compas-sct.md | 38 ------------- pom.xml | 1 - sct-data/pom.xml | 55 ------------------- .../lfenergy/compas/sct/data/model/IScd.java | 14 ----- .../repository/CompasDataAccessException.java | 16 ------ .../data/repository/IScdCrudRepository.java | 20 ------- .../CompasDataAccessExceptionTest.java | 23 -------- 8 files changed, 168 deletions(-) delete mode 100644 sct-data/pom.xml delete mode 100644 sct-data/src/main/java/org/lfenergy/compas/sct/data/model/IScd.java delete mode 100644 sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessException.java delete mode 100644 sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/IScdCrudRepository.java delete mode 100644 sct-data/src/test/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessExceptionTest.java diff --git a/docs/QUICK_START.md b/docs/QUICK_START.md index 8a441541f..5228af057 100644 --- a/docs/QUICK_START.md +++ b/docs/QUICK_START.md @@ -30,7 +30,6 @@ Actually there are 4 packages available: - compas-sct - sct-commons - sct-app -- sct-data #### 2. Usage diff --git a/docs/compas-sct.md b/docs/compas-sct.md index d6b979443..d2848deba 100644 --- a/docs/compas-sct.md +++ b/docs/compas-sct.md @@ -17,7 +17,6 @@ The below package diagram shows different part of the tool architecture. Hence, we can distinguish four major parts: * **[sct-commons](#SCT-COMMONS)** : a library that contents shared functionalities for the bound SCL object. -* **[sct-data](#SCT-DATA)** : It holds data models and database connectivity services. * **[sct-app](#SCT-APPLICATION)** : *TODO*. ## SCT COMMONS @@ -96,43 +95,6 @@ should always return `true`: [...] } -## SCT DATA -Data models and connectivity to database are defined here. Data access layer is an abstract layer that defined connectivity -interfaces. This layer manages a database with single table (SQL-Like database) or single collection (NoSQL-Like database). -The concrete data access layers are implemented in specific packages. A data model can implement the following interface - -``` -public interface IScd { - ID getId(); - byte[] getRawXml(); - ID getHeaderId(); - String getHeaderRevision(); - String getHeaderVersion(); - String filename(); -} -``` - -* ### SQL-Like Database -An implementation of the sct-data connectivity interface with custom data models. This allows the application to work with sql-like database. -The libraries ares use for SQL-Like databases, those that support XML type (PostgreSql, Oracle, etc) - -* ### NoSQL-Like Database -Like SQL-like part, this package contains the sct-data connector interfaces implementation for NoSQL-Like databases (BaseX, existDB, etc ) -that support XML processing. - -This can also be a local repository connector (file system). For example, with meta-data headerID, headerVersion, headerRevision and filename -one can implement the connector to have the below output (with the constraint of having a single file in /pathTo/headerId/headerVersion/headerRevision): - -``` - myRepo - ├─── - │ ├─── - │ │ └─── - │ │ | ├─── - │ │ └─── - │ │ ├─── -``` - ## SCT APPLICATION **TODO** > In progress diff --git a/pom.xml b/pom.xml index 65e41b5df..b31c36062 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,6 @@ sct-commons sct-coverage - sct-data sct-app diff --git a/sct-data/pom.xml b/sct-data/pom.xml deleted file mode 100644 index 27a1fbcf7..000000000 --- a/sct-data/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - 4.0.0 - - - org.lfenergy.compas - compas-sct - local-SNAPSHOT - - - sct-data - local-SNAPSHOT - SCT-DATA - - - ${basedir}/${aggregate.report.dir} - true - - - - - org.projectlombok - lombok - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.assertj - assertj-core - test - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - diff --git a/sct-data/src/main/java/org/lfenergy/compas/sct/data/model/IScd.java b/sct-data/src/main/java/org/lfenergy/compas/sct/data/model/IScd.java deleted file mode 100644 index 6d68c4b56..000000000 --- a/sct-data/src/main/java/org/lfenergy/compas/sct/data/model/IScd.java +++ /dev/null @@ -1,14 +0,0 @@ - -// SPDX-FileCopyrightText: 2021 RTE FRANCE -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.sct.data.model; - -public interface IScd { - ID getId(); - byte[] getRawXml(); - ID getHeaderId(); - String getHeaderRevision(); - String getHeaderVersion(); -} diff --git a/sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessException.java b/sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessException.java deleted file mode 100644 index ab5f396db..000000000 --- a/sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessException.java +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: 2021 RTE FRANCE -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.sct.data.repository; - -public class CompasDataAccessException extends RuntimeException { - - public CompasDataAccessException(String message, Throwable cause) { - super(message, cause); - } - - public CompasDataAccessException(String message) { - super(message); - } -} diff --git a/sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/IScdCrudRepository.java b/sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/IScdCrudRepository.java deleted file mode 100644 index fd45cd614..000000000 --- a/sct-data/src/main/java/org/lfenergy/compas/sct/data/repository/IScdCrudRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: 2021 RTE FRANCE -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.sct.data.repository; - - -import org.lfenergy.compas.sct.data.model.IScd; - -import java.util.Optional; - -public interface IScdCrudRepository { - T save(T s) throws CompasDataAccessException; - T update(T s) throws CompasDataAccessException; - Optional findById(ID id); - boolean existsById(ID id) ; - boolean existsByHeaderId(ID id) ; - long count() ; - void deleteById(ID id) throws CompasDataAccessException; -} diff --git a/sct-data/src/test/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessExceptionTest.java b/sct-data/src/test/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessExceptionTest.java deleted file mode 100644 index 853e7e973..000000000 --- a/sct-data/src/test/java/org/lfenergy/compas/sct/data/repository/CompasDataAccessExceptionTest.java +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: 2021 RTE FRANCE -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.sct.data.repository; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class CompasDataAccessExceptionTest { - - @Test - void constructor_whenCalled_shouldFillValues(){ - // When - CompasDataAccessException compasDataAccessException = new CompasDataAccessException("msg",new RuntimeException()); - // Then - assertThat(compasDataAccessException.getLocalizedMessage()).isEqualTo("msg"); - assertThat(compasDataAccessException.getCause()).isNotNull(); - assertThat(compasDataAccessException.getCause().getClass()).isEqualTo(RuntimeException.class); - } - -} \ No newline at end of file