diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 9ae5a4e6..0102128f 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -21,19 +21,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache Docker Register uses: actions/cache@v3 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - name: Set up Docker Buildx id: buildx @@ -43,6 +37,7 @@ jobs: with: distribution: 'zulu' java-version: '17' + cache: 'maven' - name: Create custom Maven Settings.xml uses: whelk-io/maven-settings-xml-action@v21 diff --git a/.github/workflows/release-project.yml b/.github/workflows/release-project.yml index c44b607a..a8422e7e 100644 --- a/.github/workflows/release-project.yml +++ b/.github/workflows/release-project.yml @@ -16,19 +16,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache Docker Register uses: actions/cache@v3 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - name: Extract tag name id: extract_tagname @@ -41,6 +35,7 @@ jobs: with: distribution: 'zulu' java-version: '17' + cache: 'maven' - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index aff58480..b89fda98 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: REUSE Compliance Check uses: fsfe/reuse-action@v2 diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index c0364192..a2141b7f 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -40,7 +40,7 @@ jobs: full_name: ${{ github.event.repository.full_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: ${{ github.event.workflow_run.head_repository.full_name }} ref: ${{ github.event.workflow_run.head_branch }} @@ -59,6 +59,7 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages uses: actions/cache@v3 with: @@ -71,7 +72,6 @@ jobs: with: distribution: 'zulu' java-version: '17' - - name: Set Common Sonar Variables id: sonar_env run: | diff --git a/.github/workflows/sonarcloud-build.yml b/.github/workflows/sonarcloud-build.yml index 58e78fcd..7228a740 100644 --- a/.github/workflows/sonarcloud-build.yml +++ b/.github/workflows/sonarcloud-build.yml @@ -26,7 +26,7 @@ jobs: if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/README.md b/README.md index 7a2caa06..24f65332 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,8 @@ parts of this repository can also be used separately in your own component to ma Service Layer can be used as Java component to manage them. For more information about the architecture go to [documentation](doc/compas-scl-data-service.md). -There are currently two database implementations available. +There is currently one database implementations available. -- For more development information about the BaseX Implementation go to [BaseX](doc/basex.md). (Profile activated by - default.) - For more development information about the PostgreSQL Implementation go to [PostgreSQL](doc/postgresql.md). > **Note:** When switching between implementation it's a good practise to first execute a maven clean to remove diff --git a/app/pom.xml b/app/pom.xml index 1f637c31..dcb9525e 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -31,10 +31,6 @@ SPDX-License-Identifier: Apache-2.0 org.lfenergy.compas.scl.data repository - - org.lfenergy.compas.scl.data - repository-basex - org.lfenergy.compas.scl.data repository-postgresql @@ -171,28 +167,8 @@ SPDX-License-Identifier: Apache-2.0 generate-code-tests - - build-basex - - build - - - - prod-basex - basex-quarkus-app - src/main/docker/Dockerfile-basex.jvm - - src/main/docker/Dockerfile-basex.native - - ${project.version}-basex - latest-basex - - - - build-postgresql @@ -285,23 +261,6 @@ SPDX-License-Identifier: Apache-2.0 maven-failsafe-plugin ${surefire-plugin.version} - - integration-test-basex - - integration-test - verify - - - - - ${project.build.directory}/basex-quarkus-app/${project.build.finalName}-runner - - org.jboss.logmanager.LogManager - - ${maven.home} - - - diff --git a/app/src/main/docker/Dockerfile-basex.jvm b/app/src/main/docker/Dockerfile-basex.jvm deleted file mode 100644 index fd96b2d0..00000000 --- a/app/src/main/docker/Dockerfile-basex.jvm +++ /dev/null @@ -1,56 +0,0 @@ -#### -# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode -# -# Before building the container image run: -# -# ./mvnw package -# -# Then, build the image with: -# -# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/app-jvm . -# -# Then run the container using: -# -# docker run -i --rm -p 8080:8080 quarkus/app-jvm -# -# If you want to include the debug port into your docker image -# you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5005 -# -# Then run the container using : -# -# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm -# -### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-860 - -ARG JAVA_PACKAGE=java-17-openjdk-headless -ARG RUN_JAVA_VERSION=1.3.8 -ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' -# Install java and the run-java script -# Also set up permissions for user `1001` -RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ - && microdnf update \ - && microdnf clean all \ - && mkdir /deployments \ - && chown 1001 /deployments \ - && chmod "g+rwX" /deployments \ - && chown 1001:root /deployments \ - && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \ - && chown 1001 /deployments/run-java.sh \ - && chmod 540 /deployments/run-java.sh \ - && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/conf/security/java.security - -# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. -ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" -ENV JAVA_MAX_MEM_RATIO="70" -# We make four distinct layers so if there are application changes the library layers can be re-used -COPY --chown=1001 target/basex-quarkus-app/lib/ /deployments/lib/ -COPY --chown=1001 target/basex-quarkus-app/*.jar /deployments/ -COPY --chown=1001 target/basex-quarkus-app/app/ /deployments/app/ -COPY --chown=1001 target/basex-quarkus-app/quarkus/ /deployments/quarkus/ - -EXPOSE 8080 -USER 1001 - -ENTRYPOINT [ "/deployments/run-java.sh" ] - diff --git a/app/src/main/docker/Dockerfile-basex.native b/app/src/main/docker/Dockerfile-basex.native deleted file mode 100644 index 128860fd..00000000 --- a/app/src/main/docker/Dockerfile-basex.native +++ /dev/null @@ -1,27 +0,0 @@ -#### -# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode -# -# Before building the container image run: -# -# ./mvnw package -Pnative -# -# Then, build the image with: -# -# docker build -f src/main/docker/Dockerfile.native -t quarkus/app . -# -# Then run the container using: -# -# docker run -i --rm -p 8080:8080 quarkus/app -# -### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-860 -WORKDIR /work/ -RUN chown 1001 /work \ - && chmod "g+rwX" /work \ - && chown 1001:root /work -COPY --chown=1001:root target/basex-quarkus-app/*-runner /work/application - -EXPOSE 8080 -USER 1001 - -CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/CompasSclDataServiceConfiguration.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/CompasSclDataServiceConfiguration.java index 2054f037..2452ac21 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/CompasSclDataServiceConfiguration.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/CompasSclDataServiceConfiguration.java @@ -7,8 +7,8 @@ import org.lfenergy.compas.core.commons.ElementConverter; import org.lfenergy.compas.scl.data.util.SclDataModelMarshaller; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; /** * Create Beans from other dependencies that are used in the application. diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandler.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandler.java index efee3683..6abad8a2 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandler.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandler.java @@ -6,9 +6,9 @@ import org.lfenergy.compas.core.commons.model.ErrorResponse; import org.lfenergy.compas.scl.data.exception.CompasNoDataFoundException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; @Provider public class CompasNoDataFoundExceptionHandler implements ExceptionMapper { diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/LivenessHealthCheck.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/LivenessHealthCheck.java index df39ebcf..cc5b64d1 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/LivenessHealthCheck.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/LivenessHealthCheck.java @@ -7,7 +7,7 @@ import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Liveness; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; @Liveness @ApplicationScoped diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/ReadinessHealthCheck.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/ReadinessHealthCheck.java index c75b474f..f082bfed 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/ReadinessHealthCheck.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/ReadinessHealthCheck.java @@ -7,7 +7,7 @@ import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.Readiness; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; @Readiness @ApplicationScoped diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java index ba63918a..19240f7a 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java @@ -14,12 +14,12 @@ import org.lfenergy.compas.scl.data.rest.v1.model.UserInfoResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.util.Arrays; import java.util.Comparator; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResource.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResource.java index 5bad7160..fba0497c 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResource.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResource.java @@ -15,11 +15,11 @@ import org.lfenergy.compas.scl.data.service.CompasSclDataService; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; -import javax.validation.Valid; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.validation.Valid; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; import java.util.UUID; import static org.lfenergy.compas.scl.data.rest.Constants.*; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateRequest.java index 117b35d5..d191d3e4 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateRequest.java @@ -7,11 +7,11 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.lfenergy.compas.core.commons.constraint.FilenameValid; -import javax.validation.constraints.NotBlank; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.validation.constraints.NotBlank; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateResponse.java index b7593a22..7c0d0440 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateResponse.java @@ -5,10 +5,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckRequest.java index 32827e8e..a0da8141 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckRequest.java @@ -7,10 +7,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.lfenergy.compas.core.commons.constraint.FilenameValid; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckResponse.java index 0cb1ba22..2a33ace9 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/DuplicateNameCheckResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/GetResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/GetResponse.java index 89042351..b3fe29f9 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/GetResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/GetResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/ListResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/ListResponse.java index d1a8ed99..890c1f03 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/ListResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/ListResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.lfenergy.compas.scl.data.model.Item; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/Type.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/Type.java index 44c12072..6760a790 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/Type.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/Type.java @@ -5,9 +5,9 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/TypeListResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/TypeListResponse.java index 5d34e192..ecd6cd3a 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/TypeListResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/TypeListResponse.java @@ -5,10 +5,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateRequest.java index f64bc37c..ffcddac3 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateRequest.java @@ -7,12 +7,12 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.lfenergy.compas.scl.data.model.ChangeSetType; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateResponse.java index a30a3e39..91a6d318 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UpdateResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UserInfoResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UserInfoResponse.java index 7047e35c..fff6d999 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UserInfoResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/UserInfoResponse.java @@ -5,10 +5,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/VersionsResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/VersionsResponse.java index 251f57e1..aec8acdb 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/VersionsResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/VersionsResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.lfenergy.compas.scl.data.model.HistoryItem; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import java.util.List; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/package-info.java b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/package-info.java index 08a82499..3250e301 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/package-info.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/package-info.java @@ -4,7 +4,7 @@ @XmlSchema(xmlns = {@XmlNs(prefix = "sds", namespaceURI = SCL_DATA_SERVICE_V1_NS_URI)}) package org.lfenergy.compas.scl.data.rest.v1.model; -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlSchema; +import jakarta.xml.bind.annotation.XmlNs; +import jakarta.xml.bind.annotation.XmlSchema; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandler.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandler.java index 2528e203..b4e46cd8 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandler.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandler.java @@ -14,8 +14,8 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetWsResponse; import org.lfenergy.compas.scl.data.websocket.v1.model.UpdateWsResponse; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; /** * Event Handler used to execute the validation asynchronized. diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequest.java index 2582a2ee..3665ba5e 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequest.java @@ -5,7 +5,7 @@ import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.Session; +import jakarta.websocket.Session; public class CreateEventRequest { private final Session session; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequest.java index ea3d4e8b..089a4778 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequest.java @@ -5,7 +5,7 @@ import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.Session; +import jakarta.websocket.Session; import java.util.UUID; public class GetEventRequest { diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequest.java index 1675f37a..ec3f96e6 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequest.java @@ -6,7 +6,7 @@ import org.lfenergy.compas.scl.data.model.Version; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.Session; +import jakarta.websocket.Session; import java.util.UUID; public class GetVersionEventRequest { diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequest.java index 7442950a..5b81d808 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequest.java @@ -6,7 +6,7 @@ import org.lfenergy.compas.scl.data.model.ChangeSetType; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.Session; +import jakarta.websocket.Session; import java.util.UUID; public class UpdateEventRequest { diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpoint.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpoint.java index 8962d88c..baae5857 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpoint.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpoint.java @@ -16,12 +16,12 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.CreateWsRequest; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.validation.Valid; -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.validation.Valid; +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import static org.lfenergy.compas.core.websocket.WebsocketSupport.handleException; import static org.lfenergy.compas.scl.data.rest.Constants.TYPE_PATH_PARAM; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpoint.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpoint.java index 2d66f1bc..68bf896f 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpoint.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpoint.java @@ -14,12 +14,12 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetWsRequest; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.validation.Valid; -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.validation.Valid; +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import static org.lfenergy.compas.core.websocket.WebsocketSupport.handleException; import static org.lfenergy.compas.scl.data.rest.Constants.TYPE_PATH_PARAM; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpoint.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpoint.java index 866941fa..ecafcdec 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpoint.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpoint.java @@ -15,12 +15,12 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetVersionWsRequest; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.validation.Valid; -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.validation.Valid; +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import static org.lfenergy.compas.core.websocket.WebsocketSupport.handleException; import static org.lfenergy.compas.scl.data.rest.Constants.TYPE_PATH_PARAM; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpoint.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpoint.java index d54dfc77..6d9e2449 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpoint.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpoint.java @@ -16,12 +16,12 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.UpdateWsRequest; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.validation.Valid; -import javax.websocket.*; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.validation.Valid; +import jakarta.websocket.*; +import jakarta.websocket.server.PathParam; +import jakarta.websocket.server.ServerEndpoint; import static org.lfenergy.compas.core.websocket.WebsocketSupport.handleException; import static org.lfenergy.compas.scl.data.rest.Constants.TYPE_PATH_PARAM; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsRequest.java index 3748261b..ca3de064 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsRequest.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsResponse.java index 7a330bc3..513dd2d1 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/CreateWsResponse.java @@ -5,10 +5,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetVersionWsRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetVersionWsRequest.java index e050ce6f..42b9dd92 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetVersionWsRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetVersionWsRequest.java @@ -6,9 +6,9 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.xml.bind.annotation.*; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.xml.bind.annotation.*; import java.util.UUID; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsRequest.java index 764807e4..20137500 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsRequest.java @@ -6,8 +6,8 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.validation.constraints.NotNull; -import javax.xml.bind.annotation.*; +import jakarta.validation.constraints.NotNull; +import jakarta.xml.bind.annotation.*; import java.util.UUID; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsResponse.java index 50c51a4d..441738a8 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/GetWsResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsRequest.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsRequest.java index b3b42769..de0123a1 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsRequest.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsRequest.java @@ -6,8 +6,8 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.validation.constraints.NotNull; -import javax.xml.bind.annotation.*; +import jakarta.validation.constraints.NotNull; +import jakarta.xml.bind.annotation.*; import java.util.UUID; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsResponse.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsResponse.java index 8e67b561..061630b5 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsResponse.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/UpdateWsResponse.java @@ -6,10 +6,10 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/package-info.java b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/package-info.java index 68f35f72..a22f4060 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/package-info.java +++ b/app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/model/package-info.java @@ -4,7 +4,7 @@ @XmlSchema(xmlns = {@XmlNs(prefix = "sds", namespaceURI = SCL_DATA_SERVICE_V1_NS_URI)}) package org.lfenergy.compas.scl.data.websocket.v1.model; -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlSchema; +import jakarta.xml.bind.annotation.XmlNs; +import jakarta.xml.bind.annotation.XmlSchema; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/app/src/main/resources/application-dev-basex.properties b/app/src/main/resources/application-dev-basex.properties deleted file mode 100644 index 7bb9b600..00000000 --- a/app/src/main/resources/application-dev-basex.properties +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -# Development BaseX configuration. -quarkus.http.port = 9090 -quarkus.http.cors = true - -# Dev Logging -quarkus.log.level = DEBUG -quarkus.log.category."org.lfenergy.compas.scl.data".level = DEBUG - -# Dev extra permissions -quarkus.http.auth.permission.develop-quarkus-services.paths = /compas-scl-data-service/q/swagger-ui/*,/compas-scl-data-service/index.html -quarkus.http.auth.permission.develop-quarkus-services.policy = permit - -# Exclude the other repository implementations from being scanned -quarkus.arc.exclude-dependency.postgresql-repository.group-id = org.lfenergy.compas.scl.data -quarkus.arc.exclude-dependency.postgresql-repository.artifact-id = repository-postgresql - -# Datasource configuration for BaseX (none) -quarkus.datasource.jdbc = false -quarkus.datasource.devservices.enabled = false - -# Flyway configuration for BaseX (none) -quarkus.flyway.migrate-at-start = false - -# BaseX configuration -basex.host = localhost -basex.port = 1984 -basex.username = admin -basex.password = admin diff --git a/app/src/main/resources/application-dev-postgresql.properties b/app/src/main/resources/application-dev-postgresql.properties index 8d2e80a7..b526c75b 100644 --- a/app/src/main/resources/application-dev-postgresql.properties +++ b/app/src/main/resources/application-dev-postgresql.properties @@ -14,10 +14,6 @@ quarkus.log.category."org.lfenergy.compas.scl.data".level = DEBUG quarkus.http.auth.permission.develop-quarkus-services.paths = /compas-scl-data-service/q/swagger-ui/*,/compas-scl-data-service/index.html quarkus.http.auth.permission.develop-quarkus-services.policy = permit -# Exclude the other repository implementations from being scanned -quarkus.arc.exclude-dependency.basex-repository.group-id = org.lfenergy.compas.scl.data -quarkus.arc.exclude-dependency.basex-repository.artifact-id = repository-basex - # Datasource configuration for PostgreSQL quarkus.datasource.devservices.enabled = false quarkus.datasource.db-kind = postgresql diff --git a/app/src/main/resources/application-prod-basex.properties b/app/src/main/resources/application-prod-basex.properties deleted file mode 100644 index 0d81f53f..00000000 --- a/app/src/main/resources/application-prod-basex.properties +++ /dev/null @@ -1,25 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -# Production BaseX configuration. - -# Exclude the other repository implementations from being scanned -quarkus.arc.exclude-dependency.postgresql-repository.group-id = org.lfenergy.compas.scl.data -quarkus.arc.exclude-dependency.postgresql-repository.artifact-id = repository-postgresql - -# Add scanning these dependencies for scanning, also used by native compilation. -quarkus.index-dependency.basex-repository.group-id = org.lfenergy.compas.scl.data -quarkus.index-dependency.basex-repository.artifact-id = repository-basex - -# Datasource configuration for BaseX (none) -quarkus.datasource.jdbc = false - -# Flyway configuration for BaseX (none) -quarkus.flyway.migrate-at-start = false - -# BaseX configuration -basex.host = localhost -basex.port = 1984 -basex.username = admin -basex.password = admin diff --git a/app/src/main/resources/application-prod-postgresql.properties b/app/src/main/resources/application-prod-postgresql.properties index 79642385..ba6516ac 100644 --- a/app/src/main/resources/application-prod-postgresql.properties +++ b/app/src/main/resources/application-prod-postgresql.properties @@ -4,10 +4,6 @@ # Production PostgreSQL configuration. -# Exclude the other repository implementations from being scanned -quarkus.arc.exclude-dependency.basex-repository.group-id = org.lfenergy.compas.scl.data -quarkus.arc.exclude-dependency.basex-repository.artifact-id = repository-basex - # Add scanning these dependencies for scanning, also used by native compilation. quarkus.index-dependency.postgresql-repository.group-id = org.lfenergy.compas.scl.data quarkus.index-dependency.postgresql-repository.artifact-id = repository-postgresql diff --git a/app/src/main/resources/application-test.properties b/app/src/main/resources/application-test.properties index 0ddb127d..1dfce47a 100644 --- a/app/src/main/resources/application-test.properties +++ b/app/src/main/resources/application-test.properties @@ -4,10 +4,6 @@ # Test configuration. -# Exclude the other repository implementations from being scanned -quarkus.arc.exclude-dependency.basex-repository.group-id = org.lfenergy.compas.scl.data -quarkus.arc.exclude-dependency.basex-repository.artifact-id = repository-basex - # Datasource configuration for PostgreSQL quarkus.datasource.devservices.enabled = true quarkus.datasource.db-kind = postgresql diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandlerTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandlerTest.java index 40179946..5febb27d 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandlerTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandlerTest.java @@ -7,7 +7,7 @@ import org.lfenergy.compas.core.commons.model.ErrorResponse; import org.lfenergy.compas.scl.data.exception.CompasNoDataFoundException; -import static javax.ws.rs.core.Response.Status.NOT_FOUND; +import static jakarta.ws.rs.core.Response.Status.NOT_FOUND; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandlerTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandlerTest.java index 39f9192d..d937f833 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandlerTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/CompasSclDataEventHandlerTest.java @@ -24,8 +24,8 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -import javax.websocket.RemoteEndpoint; -import javax.websocket.Session; +import jakarta.websocket.RemoteEndpoint; +import jakarta.websocket.Session; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequestTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequestTest.java index 0c250f5c..60300868 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequestTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/CreateEventRequestTest.java @@ -11,7 +11,7 @@ import org.lfenergy.compas.scl.extensions.model.SclFileType; import org.mockito.Mockito; -import javax.websocket.Session; +import jakarta.websocket.Session; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequestTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequestTest.java index e9240bcd..461d72ce 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequestTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetEventRequestTest.java @@ -11,7 +11,7 @@ import org.lfenergy.compas.scl.extensions.model.SclFileType; import org.mockito.Mockito; -import javax.websocket.Session; +import jakarta.websocket.Session; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequestTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequestTest.java index 1e2a9a29..0ca96c0a 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequestTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/GetVersionEventRequestTest.java @@ -12,7 +12,7 @@ import org.lfenergy.compas.scl.extensions.model.SclFileType; import org.mockito.Mockito; -import javax.websocket.Session; +import jakarta.websocket.Session; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequestTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequestTest.java index ada45ffc..9c5fa4f4 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequestTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/event/model/UpdateEventRequestTest.java @@ -12,7 +12,7 @@ import org.lfenergy.compas.scl.extensions.model.SclFileType; import org.mockito.Mockito; -import javax.websocket.Session; +import jakarta.websocket.Session; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointAsReaderTestSupport.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointAsReaderTestSupport.java index 58722723..0869d846 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointAsReaderTestSupport.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointAsReaderTestSupport.java @@ -7,8 +7,8 @@ import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException; import io.quarkus.test.security.TestSecurity; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; import java.io.InterruptedIOException; import java.net.URI; import java.util.concurrent.ExecutionException; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointTestSupport.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointTestSupport.java index 6a4ad521..f8efb7f2 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointTestSupport.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/AbstractServerEndpointTestSupport.java @@ -7,10 +7,10 @@ import org.lfenergy.compas.core.commons.model.ErrorResponse; import org.lfenergy.compas.core.websocket.ErrorResponseDecoder; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.io.IOException; import java.net.URI; import java.util.concurrent.LinkedBlockingDeque; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpointAsEditorTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpointAsEditorTest.java index eabfa8e1..5727c067 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpointAsEditorTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpointAsEditorTest.java @@ -14,10 +14,10 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.CreateWsResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.net.URI; import static org.mockito.Mockito.verify; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsEditorTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsEditorTest.java index 101d3ff1..2c32f6f4 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsEditorTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsEditorTest.java @@ -14,10 +14,10 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetWsResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.net.URI; import java.util.UUID; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsReaderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsReaderTest.java index fa63b88a..6e8741f3 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsReaderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpointAsReaderTest.java @@ -14,10 +14,10 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetWsResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.net.URI; import java.util.UUID; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsEditorTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsEditorTest.java index 41da1179..40abfce0 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsEditorTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsEditorTest.java @@ -15,10 +15,10 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetWsResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.net.URI; import java.util.UUID; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsReaderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsReaderTest.java index 23037003..bd7e05fe 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsReaderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpointAsReaderTest.java @@ -15,10 +15,10 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.GetWsResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.net.URI; import java.util.UUID; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpointAsEditorTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpointAsEditorTest.java index 04c397f1..b726081e 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpointAsEditorTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpointAsEditorTest.java @@ -15,10 +15,10 @@ import org.lfenergy.compas.scl.data.websocket.v1.model.UpdateWsResponse; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.OnMessage; -import javax.websocket.Session; +import jakarta.websocket.ClientEndpoint; +import jakarta.websocket.ContainerProvider; +import jakarta.websocket.OnMessage; +import jakarta.websocket.Session; import java.net.URI; import java.util.UUID; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsRequestDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsRequestDecoderTest.java index f0253a10..25224a43 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsRequestDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsRequestDecoderTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.lfenergy.compas.core.commons.exception.CompasException; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import static org.junit.jupiter.api.Assertions.*; import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.WEBSOCKET_DECODER_ERROR_CODE; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsResponseDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsResponseDecoderTest.java index 3d2e26d5..a1183a44 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsResponseDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/CreateWsResponseDecoderTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.lfenergy.compas.core.commons.exception.CompasException; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import static org.junit.jupiter.api.Assertions.*; import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.WEBSOCKET_DECODER_ERROR_CODE; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetVersionWsRequestDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetVersionWsRequestDecoderTest.java index 11d957d8..3e685989 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetVersionWsRequestDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetVersionWsRequestDecoderTest.java @@ -9,7 +9,7 @@ import org.lfenergy.compas.core.commons.exception.CompasException; import org.lfenergy.compas.scl.data.model.Version; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import java.util.UUID; import static org.junit.jupiter.api.Assertions.*; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsRequestDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsRequestDecoderTest.java index 58fcd263..716e8678 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsRequestDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsRequestDecoderTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.lfenergy.compas.core.commons.exception.CompasException; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import java.util.UUID; import static org.junit.jupiter.api.Assertions.*; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsResponseDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsResponseDecoderTest.java index fe1deb4d..3833e563 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsResponseDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/GetWsResponseDecoderTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.lfenergy.compas.core.commons.exception.CompasException; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import static org.junit.jupiter.api.Assertions.*; import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.WEBSOCKET_DECODER_ERROR_CODE; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsRequestDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsRequestDecoderTest.java index 4beb9d89..b9e8b2b4 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsRequestDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsRequestDecoderTest.java @@ -9,7 +9,7 @@ import org.lfenergy.compas.core.commons.exception.CompasException; import org.lfenergy.compas.scl.data.model.ChangeSetType; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import java.util.UUID; import static org.junit.jupiter.api.Assertions.*; diff --git a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsResponseDecoderTest.java b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsResponseDecoderTest.java index 55ca2a67..0768c1e2 100644 --- a/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsResponseDecoderTest.java +++ b/app/src/test/java/org/lfenergy/compas/scl/data/websocket/v1/decoder/UpdateWsResponseDecoderTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.lfenergy.compas.core.commons.exception.CompasException; -import javax.xml.bind.UnmarshalException; +import jakarta.xml.bind.UnmarshalException; import static org.junit.jupiter.api.Assertions.*; import static org.lfenergy.compas.core.commons.exception.CompasErrorCode.WEBSOCKET_DECODER_ERROR_CODE; diff --git a/doc/basex.md b/doc/basex.md deleted file mode 100644 index d60aa557..00000000 --- a/doc/basex.md +++ /dev/null @@ -1,108 +0,0 @@ - - -# BaseX Implementation - -## BaseX Environment variables - -Below environment variable(s) can be used to configure the connection to BaseX, if BaseX Server is used. - -| Environment variable | Java Property | Description | Example | -| -------------------------------- | ------------------------- | --------------------------------------------- | ---------------- | -| BASEX_HOST | basex.host | Name of the Host where BaseX runs. | localhost | -| BASEX_PORT | basex.port | Port on the Host on which BaseX runs. | 1984 | -| BASEX_USERNAME | basex.username | Username under which the application logs in. | admin | -| BASEX_PASSWORD | basex.password | Password of the username used above. | admin | - -## Development - -### Building the application - -You can use Maven to build the application and see if all tests are working using: - -```shell script -./mvnw clean verify -``` - -This should normally be enough to also run the application, but there were cases that we need to build using: - -```shell script -./mvnw clean install -``` - -This to make the local modules available for the app module to run the application. - -### Running the application in dev mode - -You can run your application in dev mode that enables live coding using: - -```shell script -./mvnw -DskipTests=true -Dquarkus.profile=dev-basex package io.quarkus:quarkus-maven-plugin::dev -``` - -#### Application depends on a running BaseX instance - -Check [basexhttp on DockerHub](https://hub.docker.com/r/basex/basexhttp) for a running BaseX docker container. This is -needed when running the SCL Data Service locally. Not needed to run the tests. - -```shell -mkdir -p /data -sudo chown -R 1984:1984 /data - -docker run --rm --name compas_basex \ - -p 1984:1984 \ - -v /data:/srv/basex/data \ - -d basex/basexhttp:latest -``` - -> **Note:** Replace with a directory on your local machine, for instance "~/basex". -> All data will be stored in this directory under "data". This way data isn't lost after stopping the docker container. - -#### Application depends on a running KeyCloak instance - -Beside a BaseX Database there is also a KeyCloak instance need to be running on port 8089 by default. -See [README.md](../README.md#security) for default values, if custom keycloak is used. - -There is a preconfigured keycloak instance available in -the [CoMPAS Deployment Repository](https://github.com/com-pas/compas-deployment). This repository can be cloned and -when going to this directory the following command can be executed to create a local Docker Image with configuration. - -```shell -cd /compas/keycloak -docker build -t compas_keycloak . -``` - -There is now a Docker Image `compas_keycloak` created that can be started using the following command - -```shell -docker run --rm --name compas_keycloak \ - -p 8089:8080 - -d compas_keycloak:latest -``` - -### Creating a Docker image with native executable - -The releases created in the repository will create a docker image with a native executable. If you're running a Linux -system it's possible to create and run the executable locally. You can create a Docker image with native executable -using: - -```shell script -./mvnw package -Pnative-image -``` - -You can then execute your native executable with: `./app/target/basex-quarkus-app/app-local-SNAPSHOT-runner` - -### Creating a Docker image with JVM executable - -There is also a profile to create a Docker Image which runs the application using a JVM. You can create a Docker Image -with JVM executable using: - -```shell script -./mvnw package -Pjvm-image -``` - -The JVM Image can also (temporary) be created by the release action if there are problems creating or running the -native executable. diff --git a/doc/compas-scl-data-service.md b/doc/compas-scl-data-service.md index 760246ac..ab23204a 100644 --- a/doc/compas-scl-data-service.md +++ b/doc/compas-scl-data-service.md @@ -55,15 +55,6 @@ The Service class contains some logic regarding versions and private elements. - delete: Remove (all versions) of the SCL from the storage. Or if the version is passed that specific version of the SCL. -### BaseX - -There a some BaseX specific choices made in storing the SCL. - -- For every type of SCL a separate database is created. This is quite easy done in BaseX. - ![Databases](images/CoMPAS-SclDataService-Databases.png) -- In these databases the SCL will be stored as "\/\/\/\/scl.xml". - This way it will be easy to store the different version and find the latest version. - ### PostgreSQL There a some PostgreSQL choices made in storing the SCL. diff --git a/pom.xml b/pom.xml index 9af304c6..b20596e5 100644 --- a/pom.xml +++ b/pom.xml @@ -23,18 +23,16 @@ SPDX-License-Identifier: Apache-2.0 3.1.0 3.2.0 - 0.12.0 - 2.16.6.Final + 0.16.0 + 3.4.1 - 2.3.8 - 3.1 + 3.1.1 2.20.0 0.9.1 repository - repository-basex repository-postgresql service app @@ -59,8 +57,8 @@ SPDX-License-Identifier: Apache-2.0 - io.quarkus - quarkus-universe-bom + io.quarkus.platform + quarkus-bom ${quarkus.platform.version} pom import @@ -76,11 +74,6 @@ SPDX-License-Identifier: Apache-2.0 repository ${project.version} - - org.lfenergy.compas.scl.data - repository-basex - ${project.version} - org.lfenergy.compas.scl.data repository-postgresql @@ -108,12 +101,6 @@ SPDX-License-Identifier: Apache-2.0 ${compas.core.version} - - com.sun.xml.bind - jaxb-impl - ${jaxb-impl.version} - - org.eclipse.microprofile.openapi microprofile-openapi-api @@ -278,7 +265,7 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs diff --git a/repository-basex/pom.xml b/repository-basex/pom.xml deleted file mode 100644 index c6452608..00000000 --- a/repository-basex/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - 4.0.0 - - org.lfenergy.compas.scl.data - compas-scl-data-service - local-SNAPSHOT - - - repository-basex - jar - - - 9.2.4 - - - - - org.lfenergy.compas.scl.data - repository - - - - commons-io - commons-io - - - - org.eclipse.microprofile.config - microprofile-config-api - - - com.sun.xml.bind - jaxb-impl - provided - - - - org.apache.logging.log4j - log4j-api - - - org.apache.logging.log4j - log4j-core - provided - - - - - org.lfenergy.compas.scl.data - repository - test-jar - test - - - org.basex - basex - ${basex.version} - test - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.mockito - mockito-junit-jupiter - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - - - - org.jboss.jandex - jandex-maven-plugin - - - - diff --git a/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/client/BaseXClient.java b/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/client/BaseXClient.java deleted file mode 100644 index 2d8d6734..00000000 --- a/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/client/BaseXClient.java +++ /dev/null @@ -1,462 +0,0 @@ -// SPDX-FileCopyrightText: 2020 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 - -package org.lfenergy.compas.scl.data.basex.client; - -import org.lfenergy.compas.scl.data.exception.CompasSclDataServiceException; - -import java.io.*; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; - -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.lfenergy.compas.scl.data.exception.CompasSclDataServiceErrorCode.BASEX_CLIENT_CREATION_ERROR_CODE; - -/** - * Java client for BaseX. - * Works with BaseX 7.0 and later - *

- * Documentation: https://docs.basex.org/wiki/Clients - *

- * (C) BaseX Team 2005-20, BSD License - */ -public class BaseXClient implements Closeable { - - /** - * Output stream. - */ - private final OutputStream out; - /** - * Input stream (buffered). - */ - private final BufferedInputStream in; - - /** - * Socket. - */ - private final Socket socket; - /** - * Command info. - */ - private String info; - - /** - * Constructor. - * - * @param host server name - * @param port server port - * @param username username - * @param password password - * @throws IOException Exception - */ - public BaseXClient(final String host, final int port, final String username, - final String password) throws IOException { - - socket = new Socket(); - socket.setTcpNoDelay(true); - socket.connect(new InetSocketAddress(host, port), 5000); - in = new BufferedInputStream(socket.getInputStream()); - out = socket.getOutputStream(); - - // receive server response - final String[] response = receive().split(":"); - final String code; - final String nonce; - if (response.length > 1) { - // support for digest authentication - code = username + ':' + response[0] + ':' + password; - nonce = response[1]; - } else { - // support for cram-md5 (Version < 8.0) - code = password; - nonce = response[0]; - } - - send(username); - send(md5(md5(code) + nonce)); - - // receive success flag - if (!ok()) throw new IOException("Access denied."); - } - - /** - * Executes a command and serializes the result to an output stream. - * - * @param command command - * @param output output stream - * @throws IOException Exception - */ - public void execute(final String command, final OutputStream output) throws IOException { - // send {Command}0 - send(command); - receive(in, output); - info = receive(); - if (!ok()) throw new IOException(info); - } - - /** - * Executes a command and returns the result. - * - * @param command command - * @return result - * @throws IOException Exception - */ - public String execute(final String command) throws IOException { - final var os = new ByteArrayOutputStream(); - execute(command, os); - return os.toString(UTF_8); - } - - /** - * Executes a XQuery Command and returns the result. - * - * @param xqueryCommand command - * @return result - * @throws IOException Exception - */ - public String executeXQuery(final String xqueryCommand) throws IOException { - return execute("xquery " + xqueryCommand); - - } - - /** - * Creates a query object. - * - * @param query query string - * @return query - * @throws IOException Exception - */ - public Query query(final String query) throws IOException { - return new Query(query); - } - - /** - * Creates a database. - * - * @param name name of database - * @param input xml input - * @throws IOException I/O exception - */ - public void create(final String name, final InputStream input) throws IOException { - send(8, name, input); - } - - /** - * Adds a document to a database. - * - * @param path path to resource - * @param input xml input - * @throws IOException I/O exception - */ - public void add(final String path, final InputStream input) throws IOException { - send(9, path, input); - } - - /** - * Replaces a document in a database. - * - * @param path path to resource - * @param input xml input - * @throws IOException I/O exception - */ - public void replace(final String path, final InputStream input) throws IOException { - send(12, path, input); - } - - /** - * Stores a binary resource in a database. - * - * @param path path to resource - * @param input xml input - * @throws IOException I/O exception - */ - public void store(final String path, final InputStream input) throws IOException { - send(13, path, input); - } - - /** - * Closes the session. - * - * @throws IOException Exception - */ - @Override - public void close() throws IOException { - send("exit"); - out.flush(); - socket.close(); - } - - /** - * Checks the next success flag. - * - * @return value of check - * @throws IOException Exception - */ - private boolean ok() throws IOException { - out.flush(); - return in.read() == 0; - } - - /** - * Returns the next received string. - * - * @return String result or info - * @throws IOException I/O exception - */ - private String receive() throws IOException { - final var os = new ByteArrayOutputStream(); - receive(in, os); - return os.toString(UTF_8); - } - - /** - * Sends a string to the server. - * - * @param string string to be sent - * @throws IOException I/O exception - */ - private void send(final String string) throws IOException { - out.write((string + '\0').getBytes(UTF_8)); - } - - /** - * Receives a string and writes it to the specified output stream. - * - * @param input input stream - * @param output output stream - * @throws IOException I/O exception - */ - private static void receive(final InputStream input, final OutputStream output) - throws IOException { - for (int b; (b = input.read()) > 0; ) { - // read next byte if 0xFF is received - output.write(b == 0xFF ? input.read() : b); - } - } - - /** - * Sends a command, argument, and input. - * - * @param code command code - * @param path name, or path to resource - * @param input xml input - * @throws IOException I/O exception - */ - private void send(final int code, final String path, final InputStream input) throws IOException { - out.write(code); - send(path); - send(input); - } - - /** - * Sends an input stream to the server. - * - * @param input xml input - * @throws IOException I/O exception - */ - private void send(final InputStream input) throws IOException { - final var bis = new BufferedInputStream(input); - final var bos = new BufferedOutputStream(out); - for (int b; (b = bis.read()) != -1; ) { - // 0x00 and 0xFF will be prefixed by 0xFF - if (b == 0x00 || b == 0xFF) bos.write(0xFF); - bos.write(b); - } - bos.write(0); - bos.flush(); - info = receive(); - if (!ok()) throw new IOException(info); - } - - /** - * Returns an MD5 hash. - * - * @param pw String - * @return String - */ - private static String md5(final String pw) { - final var sb = new StringBuilder(); - try { - // BaseX uses MD5 hashing, so we can change this for now. - final var md = MessageDigest.getInstance("MD5"); // NOSONAR - md.update(pw.getBytes()); - for (final byte b : md.digest()) { - final var s = Integer.toHexString(b & 0xFF); - if (s.length() == 1) sb.append('0'); - sb.append(s); - } - } catch (final NoSuchAlgorithmException exp) { - throw new CompasSclDataServiceException(BASEX_CLIENT_CREATION_ERROR_CODE, "Unknwn Algorithm", exp); - } - return sb.toString(); - } - - /** - * Inner class for iterative query execution. - */ - public class Query implements Closeable { - /** - * Query id. - */ - private final String id; - /** - * Cached results. - */ - private ArrayList cache; - /** - * Cache pointer. - */ - private int pos; - - /** - * Standard constructor. - * - * @param query query string - * @throws IOException I/O exception - */ - Query(final String query) throws IOException { - id = exec(0, query); - } - - /** - * Binds a value to an external variable. - * - * @param name name of variable - * @param value value - * @throws IOException I/O exception - */ - public void bind(final String name, final String value) throws IOException { - bind(name, value, ""); - } - - /** - * Binds a value with the specified type to an external variable. - * - * @param name name of variable - * @param value value - * @param type type (can be an empty string) - * @throws IOException I/O exception - */ - public void bind(final String name, final String value, final String type) throws IOException { - cache = null; - exec(3, id + '\0' + name + '\0' + value + '\0' + type); - } - - /** - * Binds a value to the context item. - * - * @param value value - * @throws IOException I/O exception - */ - public void context(final String value) throws IOException { - context(value, ""); - } - - /** - * Binds a value with the specified type to the context item. - * - * @param value value - * @param type type (can be an empty string) - * @throws IOException I/O exception - */ - public void context(final String value, final String type) throws IOException { - cache = null; - exec(14, id + '\0' + value + '\0' + type); - } - - /** - * Checks for the next item. - * - * @return result of check - * @throws IOException I/O exception - */ - public boolean more() throws IOException { - if (cache == null) { - out.write(4); - send(id); - cache = new ArrayList<>(); - final var os = new ByteArrayOutputStream(); - while (in.read() > 0) { - receive(in, os); - cache.add(os.toByteArray()); - os.reset(); - } - if (!ok()) throw new IOException(receive()); - pos = 0; - } - if (pos < cache.size()) return true; - cache = null; - return false; - } - - /** - * Returns the next item. - * - * @return item string - * @throws IOException I/O Exception - */ - public String next() throws IOException { - return more() ? new String(cache.set(pos++, null), UTF_8) : null; - } - - /** - * Returns the whole result of the query. - * - * @return query result - * @throws IOException I/O Exception - */ - public String execute() throws IOException { - return exec(5, id); - } - - /** - * Returns query info in a string. - * - * @return query info - * @throws IOException I/O exception - */ - public String info() throws IOException { - return exec(6, id); - } - - /** - * Returns serialization parameters in a string. - * - * @return query info - * @throws IOException I/O exception - */ - public String options() throws IOException { - return exec(7, id); - } - - /** - * Closes the query. - * - * @throws IOException I/O exception - */ - @Override - public void close() throws IOException { - exec(2, id); - } - - /** - * Executes the specified command. - * - * @param code command code - * @param arg argument - * @return resulting string - * @throws IOException I/O exception - */ - private String exec(final int code, final String arg) throws IOException { - out.write(code); - send(arg); - final String s = receive(); - if (!ok()) throw new IOException(receive()); - return s; - } - } -} \ No newline at end of file diff --git a/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/client/BaseXClientFactory.java b/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/client/BaseXClientFactory.java deleted file mode 100644 index 5d97fa53..00000000 --- a/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/client/BaseXClientFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.data.basex.client; - -import org.eclipse.microprofile.config.inject.ConfigProperty; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import java.io.IOException; - -@ApplicationScoped -public class BaseXClientFactory { - private final String baseXHost; - private final Integer baseXPort; - private final String baseXUsername; - private final String baseXPassword; - - @Inject - public BaseXClientFactory(@ConfigProperty(name = "basex.host") String baseXHost, - @ConfigProperty(name = "basex.port") Integer baseXPort, - @ConfigProperty(name = "basex.username") String baseXUsername, - @ConfigProperty(name = "basex.password") String baseXPassword) { - this.baseXHost = baseXHost; - this.baseXPort = baseXPort; - this.baseXUsername = baseXUsername; - this.baseXPassword = baseXPassword; - } - - public BaseXClient createClient() throws IOException { - return new BaseXClient(baseXHost, baseXPort, baseXUsername, baseXPassword); - } -} diff --git a/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepository.java b/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepository.java deleted file mode 100644 index 65f52043..00000000 --- a/repository-basex/src/main/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepository.java +++ /dev/null @@ -1,329 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.data.basex.repository; - -import org.apache.commons.io.input.ReaderInputStream; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.lfenergy.compas.scl.data.basex.client.BaseXClient; -import org.lfenergy.compas.scl.data.basex.client.BaseXClientFactory; -import org.lfenergy.compas.scl.data.exception.CompasNoDataFoundException; -import org.lfenergy.compas.scl.data.exception.CompasSclDataServiceException; -import org.lfenergy.compas.scl.data.model.HistoryItem; -import org.lfenergy.compas.scl.data.model.Item; -import org.lfenergy.compas.scl.data.model.SclMetaInfo; -import org.lfenergy.compas.scl.data.model.Version; -import org.lfenergy.compas.scl.data.repository.CompasSclDataRepository; -import org.lfenergy.compas.scl.data.util.SclDataModelMarshaller; -import org.lfenergy.compas.scl.extensions.model.SclFileType; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.transaction.Transactional; -import java.io.IOException; -import java.io.StringReader; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -import static javax.transaction.Transactional.TxType.REQUIRED; -import static javax.transaction.Transactional.TxType.SUPPORTS; -import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; -import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_NS_URI; -import static org.lfenergy.compas.scl.data.exception.CompasSclDataServiceErrorCode.BASEX_COMMAND_ERROR_CODE; -import static org.lfenergy.compas.scl.data.exception.CompasSclDataServiceErrorCode.BASEX_QUERY_ERROR_CODE; -import static org.lfenergy.compas.scl.extensions.commons.CompasExtensionsConstants.COMPAS_EXTENSION_NS_URI; -import static org.lfenergy.compas.scl.extensions.commons.CompasExtensionsConstants.COMPAS_SCL_EXTENSION_TYPE; - -/** - * This implementation of the repository will store the SCL XML Files in BaseX, this is a XML Database. - * For more information see https://basex.org/. - *

- * For every type of SCL a separate database is created in which the SCL XML Files are stored. - * Every entry is stored under <ID>/<Major version>/<Minor version>/<Patch version>/scl.xml. - * This combination is always unique and easy to use. - */ -@ApplicationScoped -public class CompasSclDataBaseXRepository implements CompasSclDataRepository { - private static final Logger LOGGER = LogManager.getLogger(CompasSclDataBaseXRepository.class); - - private static final String DECLARE_NS_AND_VARS = """ - declare namespace scl = "%s"; - declare namespace compas = "%s"; - - declare variable $compasSclExtensionType := '%s'; - declare variable $compasDataServiceNamespace := '%s'; - """.formatted(SCL_NS_URI, COMPAS_EXTENSION_NS_URI, COMPAS_SCL_EXTENSION_TYPE, SCL_DATA_SERVICE_V1_NS_URI); - - // This find method always searches for the latest version. Retrieve all versions using db:list-details function. - // Sort the result descending, this way the last version is the first. - private static final String DECLARE_LATEST_VERSION_FUNC = """ - declare function local:latest-version($db as xs:string, $id as xs:string) as document-node()? { - let $doc := - (for $resource in db:open($db, $id) - let $parts := tokenize($resource/scl:SCL/scl:Header/@version, '\\.') - let $majorVersion := xs:int($parts[1]) - let $minorVersion := xs:int($parts[2]) - let $patchVersion := xs:int($parts[3]) - order by $majorVersion descending, $minorVersion descending, $patchVersion descending - return $resource - )[1] - return $doc - }; - """; - - // Retrieve the Labels as XML Label elements from the XML. The result can be returned by the List functions. - private static final String DECLARE_LABELS_FUNC = """ - declare function local:createLabelsResponse($latestScl as document-node()) as xs:string* { - let $labels := distinct-values($latestScl/scl:SCL/scl:Private[@type=$compasSclExtensionType]/compas:Labels/compas:Label) - for $label in $labels - return ' ' - }; - """; - - private final BaseXClientFactory baseXClientFactory; - private final SclDataModelMarshaller sclDataMarshaller; - - @Inject - public CompasSclDataBaseXRepository(BaseXClientFactory baseXClientFactory, - SclDataModelMarshaller sclDataMarshaller) { - this.baseXClientFactory = baseXClientFactory; - this.sclDataMarshaller = sclDataMarshaller; - - var command = """ - declare variable $db := '%s'; - if (not(db:exists($db))) - then - db:create($db) - """; - // At startup create all needed databases. - Arrays.stream(SclFileType.values()).forEach(type -> - executeCommand(client -> { - client.executeXQuery(command.formatted(type)); - return true; - })); - } - - @Override - @Transactional(SUPPORTS) - public List list(SclFileType type) { - return executeQuery(type, """ - %s - %s - %s - declare variable $db := '%s'; - for $resource in db:open($db) - let $id := $resource/scl:SCL/scl:Header/@id - group by $id - let $latestScl := local:latest-version($db, $id) - let $version := $latestScl/scl:SCL/scl:Header/@version - let $name := ($latestScl/scl:SCL/scl:Private[@type=$compasSclExtensionType]/compas:SclName)[1] - let $labels := fn:string-join(local:createLabelsResponse($latestScl)) - order by fn:lower-case($name) - return '' - || ' ' || $id || '' - || ' ' || $name || '' - || ' ' || $version || '' - || $labels - || '' - """.formatted(DECLARE_NS_AND_VARS, DECLARE_LATEST_VERSION_FUNC, DECLARE_LABELS_FUNC, type) - , - sclDataMarshaller::unmarshalItem); - } - - @Override - @Transactional(SUPPORTS) - public List listVersionsByUUID(SclFileType type, UUID id) { - return executeQuery(type, """ - %s - declare variable $db := '%s'; - declare variable $id := '%s'; - for $resource in db:open($db, $id) - let $version := $resource/scl:SCL/scl:Header/@version - let $name := $resource/scl:SCL/scl:Private[@type=$compasSclExtensionType]/compas:SclName - let $header := ($resource/scl:SCL/scl:Header/scl:History/scl:Hitem[(not(@revision) or @revision="") and @version=$version])[1] - let $parts := tokenize($version, '\\.') - let $majorVersion := xs:int($parts[1]) - let $minorVersion := xs:int($parts[2]) - let $patchVersion := xs:int($parts[3]) - order by $majorVersion, $minorVersion, $patchVersion - return '' - || ' ' || $id || '' - || ' ' || $name || '' - || ' ' || $version || '' - || ' ' || $header/@who || '' - || ' ' || $header/@when || '' - || ' ' || $header/@what || '' - || '' - """.formatted(DECLARE_NS_AND_VARS, type, id), - sclDataMarshaller::unmarshalHistoryItem); - } - - @Override - @Transactional(SUPPORTS) - public String findByUUID(SclFileType type, UUID id) { - // This find method always searches for the latest version and returns this. - var result = executeQuery(type, """ - %s - %s - declare variable $db := '%s'; - declare variable $id := '%s'; - local:latest-version($db, $id) - """.formatted(DECLARE_NS_AND_VARS, DECLARE_LATEST_VERSION_FUNC, type, id) - ); - - if (result.isEmpty()) { - var message = String.format("No record found for type '%s' with ID '%s'", type, id); - throw new CompasNoDataFoundException(message); - } - return result.get(0); - } - - @Override - @Transactional(SUPPORTS) - public String findByUUID(SclFileType type, UUID id, Version version) { - // This find method searches for a specific version. - var result = executeQuery(type, """ - declare variable $db := '%s'; - declare variable $path := '%s'; - db:open($db, $path) - """.formatted(type, createDocumentPath(id, version)) - ); - - if (result.isEmpty()) { - var message = String.format("No record found for type '%s' with ID '%s' and version '%s'", type, id, version); - throw new CompasNoDataFoundException(message); - } - return result.get(0); - } - - @Override - @Transactional(SUPPORTS) - public boolean hasDuplicateSclName(SclFileType type, String name) { - return false; - } - - @Override - @Transactional(SUPPORTS) - public SclMetaInfo findMetaInfoByUUID(SclFileType type, UUID id) { - // This find method always searches for the latest version. - // Extracts the needed information from the document and returns this. - var metaInfo = executeQuery(type, """ - %s - %s - declare variable $db := '%s'; - declare variable $id := '%s'; - let $resource := local:latest-version($db, $id) - return if ($resource) - then ( - let $version := $resource/scl:SCL/scl:Header/@version - let $name := $resource/scl:SCL/scl:Private[@type=$compasSclExtensionType]/compas:SclName - return '' - || ' ' || $id || '' - || ' ' || $name || '' - || ' ' || $version || '' - || '' - ) - """.formatted(DECLARE_NS_AND_VARS, DECLARE_LATEST_VERSION_FUNC, type, id), - sclDataMarshaller::unmarshalSclMetaInfo); - - if (metaInfo.isEmpty()) { - var message = String.format("No meta info found for type '%s' with ID '%s'", type, id); - throw new CompasNoDataFoundException(message); - } - return metaInfo.get(0); - } - - @Override - @Transactional(REQUIRED) - public void create(SclFileType type, UUID id, String name, String scl, Version version, String who, List labels) { - // Who is ignored in the BaseX implementation. - var inputStream = new ReaderInputStream(new StringReader(scl), StandardCharsets.UTF_8); - executeCommand(client -> { - openDatabase(client, type); - client.add(createDocumentPath(id, version) + "/scl.xml", inputStream); - closeDatabase(client); - return true; - }); - } - - @Override - @Transactional(REQUIRED) - public void delete(SclFileType type, UUID id) { - executeCommand(client -> { - client.executeXQuery("db:delete('%s', '%s')".formatted(type, id)); - return true; - }); - } - - @Override - @Transactional(REQUIRED) - public void delete(SclFileType type, UUID id, Version version) { - executeCommand(client -> { - client.executeXQuery("db:delete('%s', '%s')".formatted(type, createDocumentPath(id, version))); - return true; - }); - } - - private String createDocumentPath(UUID uuid, Version version) { - return uuid - + "/" + version.getMajorVersion() - + "/" + version.getMinorVersion() - + "/" + version.getPatchVersion(); - } - - private List executeQuery(SclFileType type, String query) { - // When the Document (as String) is just returned without mapping. - return executeQuery(type, query, xmlString -> xmlString); - } - - private List executeQuery(SclFileType type, String query, ResultRowMapper mapper) { - return executeCommand(client -> { - try { - var response = new ArrayList(); - openDatabase(client, type); - LOGGER.debug("Executing Query:\n{}", query); - try (var queryToRun = client.query(query)) { - while (queryToRun.more()) { - response.add(mapper.map(queryToRun.next())); - } - } - closeDatabase(client); - return response; - } catch (IOException exception) { - final var exceptionMessage = exception.getLocalizedMessage(); - LOGGER.error("executeQuery: {}", exceptionMessage, exception); - throw new CompasSclDataServiceException(BASEX_QUERY_ERROR_CODE, "Error executing query!"); - } - }); - } - - private void openDatabase(BaseXClient client, SclFileType type) throws IOException { - client.execute("OPEN %s".formatted(type)); - } - - private void closeDatabase(BaseXClient client) throws IOException { - client.execute("CLOSE"); - } - - private R executeCommand(ClientExecutor command) { - try (var client = baseXClientFactory.createClient()) { - return command.execute(client); - } catch (IOException exception) { - final var exceptionMessage = exception.getLocalizedMessage(); - LOGGER.error("executeCommand: {}", exceptionMessage, exception); - throw new CompasSclDataServiceException(BASEX_COMMAND_ERROR_CODE, "Error executing command!"); - } - } - - private interface ClientExecutor { - R execute(BaseXClient client) throws IOException; - } - - private interface ResultRowMapper { - R map(String row); - } -} diff --git a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXClientFactoryTest.java b/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXClientFactoryTest.java deleted file mode 100644 index 143f1cee..00000000 --- a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXClientFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.data.basex.client; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; - -import java.io.IOException; - -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.lfenergy.compas.scl.data.basex.client.BaseXServerUtil.createClientFactory; - -@ExtendWith({BaseXServerJUnitExtension.class}) -class BaseXClientFactoryTest { - private static BaseXClientFactory factory; - - @BeforeAll - static void beforeAll() { - factory = createClientFactory(BaseXServerJUnitExtension.getPortNumber()); - } - - @Test - void createClient_WhenCalled_ThenReturnClient() throws IOException { - assertNotNull(factory.createClient()); - } -} \ No newline at end of file diff --git a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXServerJUnitExtension.java b/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXServerJUnitExtension.java deleted file mode 100644 index e4a1e789..00000000 --- a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXServerJUnitExtension.java +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.data.basex.client; - -import org.basex.BaseXServer; -import org.junit.jupiter.api.extension.BeforeAllCallback; -import org.junit.jupiter.api.extension.ExtensionContext; - -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL; -import static org.lfenergy.compas.scl.data.basex.client.BaseXServerUtil.createServer; -import static org.lfenergy.compas.scl.data.basex.client.BaseXServerUtil.getFreePortNumber; - -/** - * JUnit extension to start a BaseX Server. This server should only be started and stopped once for all - * JUnit Tests. - */ -public class BaseXServerJUnitExtension implements BeforeAllCallback, ExtensionContext.Store.CloseableResource { - private static BaseXServer server; - private static int portNumber; - - // Gate keeper to prevent multiple Threads within the same routine - private final static Lock lock = new ReentrantLock(); - - @Override - public void beforeAll(final ExtensionContext context) throws Exception { - // lock the access so only one Thread has access to it - lock.lock(); - if (server == null) { - portNumber = getFreePortNumber(); - server = createServer(portNumber); - - // The following line registers a callback hook when the root test context is shut down - context.getRoot().getStore(GLOBAL).put("BaseXServerJUnitExtension", this); - } - // free the access - lock.unlock(); - } - - @Override - public void close() { - server.stop(); - } - - public static int getPortNumber() { - return portNumber; - } -} \ No newline at end of file diff --git a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXServerUtil.java b/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXServerUtil.java deleted file mode 100644 index 8fd7376d..00000000 --- a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/client/BaseXServerUtil.java +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.data.basex.client; - -import org.basex.BaseXServer; - -import java.io.IOException; -import java.net.ServerSocket; - -public final class BaseXServerUtil { - private BaseXServerUtil() { - } - - public static int getFreePortNumber() throws IOException { - try (ServerSocket serverSocket = new ServerSocket(0)) { - if (serverSocket.getLocalPort() > 0) { - return serverSocket.getLocalPort(); - } - } - throw new IOException("Port is not available"); - } - - public static BaseXServer createServer(int portNumber) throws IOException { - System.setProperty("org.basex.path", "target/basex"); - return new BaseXServer("-p" + portNumber); - } - - public static BaseXClientFactory createClientFactory(int portNumber) { - return new BaseXClientFactory("localhost", portNumber, "admin", "admin"); - } -} diff --git a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepositoryTest.java b/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepositoryTest.java deleted file mode 100644 index 693cc194..00000000 --- a/repository-basex/src/test/java/org/lfenergy/compas/scl/data/basex/repository/CompasSclDataBaseXRepositoryTest.java +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.data.basex.repository; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.lfenergy.compas.scl.data.basex.client.BaseXClientFactory; -import org.lfenergy.compas.scl.data.basex.client.BaseXServerJUnitExtension; -import org.lfenergy.compas.scl.data.repository.AbstractCompasSclDataRepositoryTest; -import org.lfenergy.compas.scl.data.repository.CompasSclDataRepository; -import org.lfenergy.compas.scl.data.util.SclDataModelMarshaller; -import org.lfenergy.compas.scl.extensions.model.SclFileType; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.io.IOException; -import java.util.Arrays; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.lfenergy.compas.scl.data.basex.client.BaseXServerUtil.createClientFactory; - -@ExtendWith({MockitoExtension.class, BaseXServerJUnitExtension.class}) -class CompasSclDataBaseXRepositoryTest extends AbstractCompasSclDataRepositoryTest { - private static final Logger LOGGER = LogManager.getLogger(CompasSclDataBaseXRepositoryTest.class); - - private static BaseXClientFactory factory; - private CompasSclDataBaseXRepository repository; - - @Override - protected CompasSclDataRepository getRepository() { - return repository; - } - - @BeforeAll - static void beforeAll() { - factory = createClientFactory(BaseXServerJUnitExtension.getPortNumber()); - - // To make it possible to re-run the test over and over (in your IDE), - // Create all the database, because this will cause to old ones to be removed. - Arrays.stream(SclFileType.values()) - .forEach(type -> { - try { - factory.createClient().executeXQuery("db:create('" + type + "')"); - } catch (IOException exp) { - LOGGER.warn("Error re-creating database {}", type, exp); - } - }); - } - - @BeforeEach - void beforeEach() { - repository = new CompasSclDataBaseXRepository(factory, new SclDataModelMarshaller()); - } - - /* - * TODO: Method beneath needs to be removed and the one from CompasSclDataPostgreSQLRepositoryTest be used - * when hasDuplicateSclName has been implemented by CompasSclDataBaseXRepository. */ - @Test - void hasDuplicateSclName_WhenUsingSclNameThatHasBeenUsedYet_ThenDuplicateIsFound() { - // Will always return false for now, because there is no correct implementation for BaseX - assertFalse(getRepository().hasDuplicateSclName(TYPE, NAME_1)); - } -} diff --git a/repository-basex/src/test/resources/log4j2.xml b/repository-basex/src/test/resources/log4j2.xml deleted file mode 100644 index 3b41fa7f..00000000 --- a/repository-basex/src/test/resources/log4j2.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/repository-postgresql/pom.xml b/repository-postgresql/pom.xml index f531369f..47b0a2cf 100644 --- a/repository-postgresql/pom.xml +++ b/repository-postgresql/pom.xml @@ -60,7 +60,7 @@ SPDX-License-Identifier: Apache-2.0 com.opentable.components otj-pg-embedded - 1.0.1 + 1.0.2 test diff --git a/repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java b/repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java index bf1a937f..c127de02 100644 --- a/repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java +++ b/repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgresql/CompasSclDataPostgreSQLRepository.java @@ -13,10 +13,10 @@ import org.lfenergy.compas.scl.data.repository.CompasSclDataRepository; import org.lfenergy.compas.scl.extensions.model.SclFileType; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import javax.sql.DataSource; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.sql.Array; import java.sql.Connection; import java.sql.ResultSet; @@ -26,8 +26,8 @@ import java.util.List; import java.util.UUID; -import static javax.transaction.Transactional.TxType.REQUIRED; -import static javax.transaction.Transactional.TxType.SUPPORTS; +import static jakarta.transaction.Transactional.TxType.REQUIRED; +import static jakarta.transaction.Transactional.TxType.SUPPORTS; import static org.lfenergy.compas.scl.data.exception.CompasSclDataServiceErrorCode.*; @ApplicationScoped diff --git a/repository-postgresql/src/test/java/org/lfenergy/compas/scl/data/repository/postgresql/PostgreSQLServerJUnitExtension.java b/repository-postgresql/src/test/java/org/lfenergy/compas/scl/data/repository/postgresql/PostgreSQLServerJUnitExtension.java index be51c4a1..a773e10d 100644 --- a/repository-postgresql/src/test/java/org/lfenergy/compas/scl/data/repository/postgresql/PostgreSQLServerJUnitExtension.java +++ b/repository-postgresql/src/test/java/org/lfenergy/compas/scl/data/repository/postgresql/PostgreSQLServerJUnitExtension.java @@ -18,7 +18,7 @@ import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL; /** - * JUnit extension to start a BaseX Server. This server should only be started and stopped once for all + * JUnit extension to start a Postgresql Server. This server should only be started and stopped once for all * JUnit Tests. */ public class PostgreSQLServerJUnitExtension implements BeforeAllCallback, ExtensionContext.Store.CloseableResource { diff --git a/repository/pom.xml b/repository/pom.xml index 7919d8df..382a9886 100644 --- a/repository/pom.xml +++ b/repository/pom.xml @@ -32,9 +32,10 @@ SPDX-License-Identifier: Apache-2.0 jakarta.xml.bind-api - com.sun.xml.bind - jaxb-impl + org.glassfish.jaxb + jaxb-runtime provided + 4.0.2 diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/exception/CompasSclDataServiceErrorCode.java b/repository/src/main/java/org/lfenergy/compas/scl/data/exception/CompasSclDataServiceErrorCode.java index fc648e3e..19fca817 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/exception/CompasSclDataServiceErrorCode.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/exception/CompasSclDataServiceErrorCode.java @@ -17,10 +17,6 @@ public class CompasSclDataServiceErrorCode { public static final String INVALID_LABEL_ERROR_CODE = "SDS-0008"; public static final String TOO_MANY_LABEL_ERROR_CODE = "SDS-0009"; - public static final String BASEX_CLIENT_CREATION_ERROR_CODE = "SDS-1000"; - public static final String BASEX_QUERY_ERROR_CODE = "SDS-1001"; - public static final String BASEX_COMMAND_ERROR_CODE = "SDS-1002"; - public static final String POSTGRES_SELECT_ERROR_CODE = "SDS-2000"; public static final String POSTGRES_INSERT_ERROR_CODE = "SDS-2001"; public static final String POSTGRES_DELETE_ERROR_CODE = "SDS-2002"; diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/model/AbstractItem.java b/repository/src/main/java/org/lfenergy/compas/scl/data/model/AbstractItem.java index d95f901e..2e83973a 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/model/AbstractItem.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/model/AbstractItem.java @@ -5,9 +5,9 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/model/HistoryItem.java b/repository/src/main/java/org/lfenergy/compas/scl/data/model/HistoryItem.java index 49ff814f..ef3b3ec3 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/model/HistoryItem.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/model/HistoryItem.java @@ -5,9 +5,9 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI; diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/model/Item.java b/repository/src/main/java/org/lfenergy/compas/scl/data/model/Item.java index 32bed0b6..eac23d90 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/model/Item.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/model/Item.java @@ -5,9 +5,9 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; import java.util.ArrayList; import java.util.List; diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/model/ObjectFactory.java b/repository/src/main/java/org/lfenergy/compas/scl/data/model/ObjectFactory.java index 6a87ae89..2fe181ba 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/model/ObjectFactory.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/model/ObjectFactory.java @@ -3,9 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 package org.lfenergy.compas.scl.data.model; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.annotation.XmlElementDecl; +import jakarta.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; @XmlRegistry diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/model/SclMetaInfo.java b/repository/src/main/java/org/lfenergy/compas/scl/data/model/SclMetaInfo.java index fbbadf33..bc508489 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/model/SclMetaInfo.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/model/SclMetaInfo.java @@ -5,8 +5,8 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; @Schema(description = "Meta Info found in the database with all basic information about a SCL.") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclDataModelMarshaller.java b/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclDataModelMarshaller.java index 57c3a721..9cf05973 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclDataModelMarshaller.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclDataModelMarshaller.java @@ -10,9 +10,9 @@ import org.lfenergy.compas.scl.data.model.Item; import org.lfenergy.compas.scl.data.model.SclMetaInfo; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import javax.xml.transform.stream.StreamSource; import java.io.StringReader; diff --git a/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclElementProcessor.java b/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclElementProcessor.java index 88d6db2c..6111dbf4 100644 --- a/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclElementProcessor.java +++ b/repository/src/main/java/org/lfenergy/compas/scl/data/util/SclElementProcessor.java @@ -8,7 +8,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; diff --git a/service/src/main/java/org/lfenergy/compas/scl/data/service/CompasSclDataService.java b/service/src/main/java/org/lfenergy/compas/scl/data/service/CompasSclDataService.java index b0f5bfd7..0c1ab397 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/data/service/CompasSclDataService.java +++ b/service/src/main/java/org/lfenergy/compas/scl/data/service/CompasSclDataService.java @@ -17,9 +17,9 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.transaction.Transactional; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.transaction.Transactional; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.nio.charset.StandardCharsets; @@ -28,8 +28,8 @@ import java.util.UUID; import java.util.stream.Collectors; -import static javax.transaction.Transactional.TxType.REQUIRED; -import static javax.transaction.Transactional.TxType.SUPPORTS; +import static jakarta.transaction.Transactional.TxType.REQUIRED; +import static jakarta.transaction.Transactional.TxType.SUPPORTS; import static org.lfenergy.compas.scl.data.SclDataServiceConstants.*; import static org.lfenergy.compas.scl.data.exception.CompasSclDataServiceErrorCode.*; import static org.lfenergy.compas.scl.extensions.commons.CompasExtensionsConstants.*;