Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 19 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
<modules>
<module>steve</module>
<module>steve-api</module>
<module>steve-bom</module>
<module>steve-core</module>
<module>steve-jooq</module>
<module>steve-ocpp</module>
<module>steve-ocpp-1-x</module>
<module>steve-ocpp-2-x</module>
<module>steve-ocpp-transport-soap</module>
<module>steve-ocpp-transport-websocket</module>
<module>steve-ui-jsp</module>
<module>steve-db/steve-jooq</module>
<module>steve-ocpp/steve-ocpp-1-x</module>
<module>steve-ocpp/steve-ocpp-2-x</module>
<module>steve-ocpp/steve-ocpp-commons</module>
<module>steve-ocpp/steve-ocpp-transport-soap</module>
<module>steve-ocpp/steve-ocpp-transport-websocket</module>
<module>steve-ui/steve-ui-jsp</module>
</modules>

<properties>
Expand Down Expand Up @@ -62,7 +63,7 @@
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp</artifactId>
<artifactId>steve-ocpp-commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -227,13 +228,22 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${plugin.license-maven.version}</version>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.46.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${plugin.license-maven.version}</version>
<configuration>
<licenseSets>
<licenseSet>
Expand Down
75 changes: 75 additions & 0 deletions steve-bom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-parent</artifactId>
<version>3.8.0-SNAPSHOT</version>
</parent>

<artifactId>steve-bom</artifactId>
<packaging>pom</packaging>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-jooq</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp-commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp-1-x</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp-2-x</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp-transport-soap</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp-transport-websocket</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ui-jsp</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.time.Duration;

/**
* @author Sevket Goekay <sevketgokay@gmail.com>
* @since 19.08.2014
Expand Down Expand Up @@ -84,5 +86,13 @@ public static class Ocpp {
private boolean autoRegisterUnknownStations;
private @Nullable String chargeBoxIdValidationRegex;
private String wsSessionSelectStrategy;
private Ws ws = new Ws();

@Data
public static class Ws {
private @Nullable Integer maxTextMessageSize;
private @Nullable Duration idleTimeout;
private String[] allowedOriginPatterns;
}
Comment on lines +89 to +106
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Verify WebSocket configuration migration completeness.

The new Ws nested class consolidates WebSocket-related properties under steve.ocpp.ws. According to the AI summary, OcppWebSocketConfiguration was removed.

Ensure all WebSocket configuration from the removed class has been migrated to these properties and verify that the consuming code has been updated accordingly.


🏁 Script executed:

#!/bin/bash
# Verify that OcppWebSocketConfiguration has been removed and check for any remaining references

# Check if OcppWebSocketConfiguration still exists
echo "=== Checking if OcppWebSocketConfiguration exists ==="
fd -t f -e java OcppWebSocketConfiguration

# Search for references to the old configuration class
echo "=== Searching for references to OcppWebSocketConfiguration ==="
rg -n "OcppWebSocketConfiguration" --type java

# Search for usages of the new Ws configuration
echo "=== Searching for usages of new Ws properties ==="
rg -n "\.ws\.(maxTextMessageSize|idleTimeout|allowedOriginPatterns)" --type java -A2 -B2

Length of output: 1047


Migrate OcppWebSocketConfiguration to use SteveProperties.Ws
Update steve-ocpp-transport-websocket/src/main/java/de/rwth/idsg/steve/config/OcppWebSocketConfiguration.java to pull maxTextMessageSize, idleTimeout and allowedOriginPatterns from SteveProperties.Ws instead of using its own DEFAULT_MAX_MSG_SIZE; adjust ConcurrentWebSocketHandler and AbstractWebSocketEndpoint imports and buffer size logic accordingly.

🤖 Prompt for AI Agents
In
steve-ocpp-transport-websocket/src/main/java/de/rwth/idsg/steve/config/OcppWebSocketConfiguration.java
(replace usage of DEFAULT_MAX_MSG_SIZE), change the configuration to read
maxTextMessageSize, idleTimeout and allowedOriginPatterns from
SteveProperties.Ws: inject SteveProperties, fetch ws = steveProperties.getWs(),
and use ws.getAllowedOriginPatterns() for CORS setup, ws.getIdleTimeout() for
session/handshake timeouts (convert Duration to milliseconds as needed), and
ws.getMaxTextMessageSize() as the buffer/handler max message size (falling back
to the previous constant only if ws.getMaxTextMessageSize() is null). Also
update imports to use the project's ConcurrentWebSocketHandler and
AbstractWebSocketEndpoint classes, and ensure the buffer sizing logic uses the
configured maxTextMessageSize (or default) consistently when constructing
handlers/endpoints.

}
}
6 changes: 1 addition & 5 deletions steve-jooq/pom.xml → steve-db/steve-jooq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-parent</artifactId>
<version>3.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>steve-jooq</artifactId>
Expand Down Expand Up @@ -60,11 +61,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion steve-ocpp-1-x/pom.xml → steve-ocpp/steve-ocpp-1-x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-parent</artifactId>
<version>3.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>steve-ocpp-1-x</artifactId>

<dependencies>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp</artifactId>
<artifactId>steve-ocpp-commons</artifactId>
</dependency>
</dependencies>

Expand Down
3 changes: 2 additions & 1 deletion steve-ocpp-2-x/pom.xml → steve-ocpp/steve-ocpp-2-x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-parent</artifactId>
<version>3.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>steve-ocpp-2-x</artifactId>

<dependencies>
<dependency>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve-ocpp</artifactId>
<artifactId>steve-ocpp-commons</artifactId>
</dependency>
</dependencies>

Expand Down
Loading
Loading