Skip to content

Commit 62639a8

Browse files
author
Dennis Labordus
authored
Merge pull request #288 from com-pas/upgrade-websocket
Using new websocket version of validation
2 parents dc95956 + f1e60b4 commit 62639a8

File tree

8 files changed

+14
-10
lines changed

8 files changed

+14
-10
lines changed

.github/workflows/build-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
5252
- name: Build with Maven (Pull Request)
5353
if: ${{ github.event_name == 'pull_request' }}
54-
run: ./mvnw -s custom_maven_settings.xml -B -Pjvm-image clean verify
54+
run: ./mvnw -s custom_maven_settings.xml -B -Pnative-image clean verify
5555
- name: Build with Maven (Push)
5656
if: ${{ github.event_name == 'push' }}
5757
run: ./mvnw -s custom_maven_settings.xml -B clean verify

.github/workflows/release-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ jobs:
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
- name: Deploy with Maven to GitHub Packages and Docker Hub
63-
run: ./mvnw -B -s custom_maven_settings.xml -Pjvm-image,release clean deploy
63+
run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy
6464
env:
6565
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclCreateServerEndpoint.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import javax.enterprise.context.ApplicationScoped;
2020
import javax.inject.Inject;
21+
import javax.validation.Valid;
2122
import javax.websocket.*;
2223
import javax.websocket.server.PathParam;
2324
import javax.websocket.server.ServerEndpoint;
@@ -52,7 +53,9 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
5253
}
5354

5455
@OnMessage
55-
public void onCreateMessage(Session session, CreateWsRequest request, @PathParam(TYPE_PATH_PARAM) String type) {
56+
public void onCreateMessage(Session session,
57+
@Valid CreateWsRequest request,
58+
@PathParam(TYPE_PATH_PARAM) String type) {
5659
LOGGER.info("Message (create) from session {} for type {}.", session.getId(), type);
5760

5861
String who = jsonWebToken.getClaim(userInfoProperties.who());

app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetServerEndpoint.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import javax.enterprise.context.ApplicationScoped;
1818
import javax.inject.Inject;
19+
import javax.validation.Valid;
1920
import javax.websocket.*;
2021
import javax.websocket.server.PathParam;
2122
import javax.websocket.server.ServerEndpoint;
@@ -45,7 +46,7 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
4546

4647
@OnMessage
4748
public void onGetMessage(Session session,
48-
GetWsRequest request,
49+
@Valid GetWsRequest request,
4950
@PathParam(TYPE_PATH_PARAM) String type) {
5051
LOGGER.info("Message (get) from session {} for type {}.", session.getId(), type);
5152

app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclGetVersionServerEndpoint.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import javax.enterprise.context.ApplicationScoped;
1919
import javax.inject.Inject;
20+
import javax.validation.Valid;
2021
import javax.websocket.*;
2122
import javax.websocket.server.PathParam;
2223
import javax.websocket.server.ServerEndpoint;
@@ -46,7 +47,7 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
4647

4748
@OnMessage
4849
public void onGetVersionMessage(Session session,
49-
GetVersionWsRequest request,
50+
@Valid GetVersionWsRequest request,
5051
@PathParam(TYPE_PATH_PARAM) String type) {
5152
LOGGER.info("Message from session {} for type {}.", session.getId(), type);
5253

app/src/main/java/org/lfenergy/compas/scl/data/websocket/v1/CompasSclUpdateServerEndpoint.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import javax.enterprise.context.ApplicationScoped;
2020
import javax.inject.Inject;
21+
import javax.validation.Valid;
2122
import javax.websocket.*;
2223
import javax.websocket.server.PathParam;
2324
import javax.websocket.server.ServerEndpoint;
@@ -52,7 +53,8 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
5253
}
5354

5455
@OnMessage
55-
public void onUpdateMessage(Session session, UpdateWsRequest request,
56+
public void onUpdateMessage(Session session,
57+
@Valid UpdateWsRequest request,
5658
@PathParam(TYPE_PATH_PARAM) String type) {
5759
LOGGER.info("Message (update) from session {} for type {}.", session.getId(), type);
5860

app/src/main/resources/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ quarkus.log.level = INFO
1616
quarkus.log.category."org.lfenergy.compas.scl.data".level = INFO
1717

1818
# Add scanning these dependencies for scanning, also used by native compilation.
19-
quarkus.index-dependency.hibernate-validator.group-id=org.hibernate.validator
20-
quarkus.index-dependency.hibernate-validator.artifact-id=hibernate-validator
21-
2219
quarkus.index-dependency.websocket-commons.group-id = org.lfenergy.compas.core
2320
quarkus.index-dependency.websocket-commons.artifact-id = websocket-commons
2421

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SPDX-License-Identifier: Apache-2.0
2323
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
2424
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
2525

26-
<compas.core.version>0.11.0</compas.core.version>
26+
<compas.core.version>0.12.0</compas.core.version>
2727

2828
<quarkus.platform.version>2.14.1.Final</quarkus.platform.version>
2929
<jaxb-impl.version>2.3.7</jaxb-impl.version>

0 commit comments

Comments
 (0)