Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OCPP-J/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dependencies {
compile project(':common')
compile 'com.google.code.gson:gson:2.8.9'
compile 'org.java-websocket:Java-WebSocket:1.5.3'
compile 'org.java-websocket:Java-WebSocket:1.6.0'
testCompile 'junit:junit:4.13.2'
testCompile 'org.mockito:mockito-core:4.11.0'
testCompile 'org.hamcrest:hamcrest-core:1.3'
Expand Down
2 changes: 1 addition & 1 deletion OCPP-J/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.4</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class JSONConfiguration {
public static final String PASSWORD_PARAMETER = "PASSWORD";
public static final String CONNECT_NON_BLOCKING_PARAMETER = "CONNECT_NON_BLOCKING";
public static final String CONNECT_TIMEOUT_IN_MS_PARAMETER = "CONNECT_TIMEOUT_IN_MS";
public static final String WEBSOCKET_COMPRESSION_SUPPORT = "WEBSOCKET_COMPRESSION_SUPPORT";
public static final String WEBSOCKET_WORKER_COUNT = "WEBSOCKET_WORKER_COUNT";
public static final String HTTP_HEALTH_CHECK_ENABLED = "HTTP_HEALTH_CHECK_ENABLED";
public static final String OCPPJ_CP_MIN_PASSWORD_LENGTH = "OCPPJ_CP_MIN_PASSWORD_LENGTH";
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v1_6-example/json-client-implementation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.3</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v1_6-example/json_server_example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.3</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v1_6/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dependencies {
compile project(':common')
compile project(':OCPP-J')
compile 'org.java-websocket:Java-WebSocket:1.5.3'
compile 'org.java-websocket:Java-WebSocket:1.6.0'
compile group: 'javax.xml.soap', name: 'javax.xml.soap-api', version: '1.4.0'

testCompile 'junit:junit:4.13.2'
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v1_6/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.4</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
compile project(':OCPP-J')
compile project(':v1_6')
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile 'org.java-websocket:Java-WebSocket:1.5.3'
compile 'org.java-websocket:Java-WebSocket:1.6.0'
testCompile 'junit:junit:4.13.2'
testCompile 'org.mockito:mockito-core:4.11.0'
testCompile 'org.hamcrest:hamcrest-core:1.3'
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.4</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@
import eu.chargetime.ocpp.wss.WssSocketBuilder;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletionStage;
import java.util.zip.Deflater;
import javax.annotation.Nullable;
import javax.net.ssl.SSLContext;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.extensions.IExtension;
import org.java_websocket.extensions.permessage_deflate.PerMessageDeflateExtension;
import org.java_websocket.protocols.IProtocol;
import org.java_websocket.protocols.Protocol;
import org.slf4j.Logger;
Expand Down Expand Up @@ -88,11 +90,20 @@ public MultiProtocolJSONClient(
List<ProtocolVersion> protocolVersions, String identity, JSONConfiguration configuration) {
this.identity = identity;
featureRepository = new MultiProtocolFeatureRepository(protocolVersions);
List<IExtension> inputExtensions = new ArrayList<>();
if (configuration.getParameter(JSONConfiguration.WEBSOCKET_COMPRESSION_SUPPORT, false)) {
PerMessageDeflateExtension perMessageDeflateExtension =
new PerMessageDeflateExtension(Deflater.BEST_COMPRESSION);
perMessageDeflateExtension.setThreshold(0);
perMessageDeflateExtension.setServerNoContextTakeover(false);
perMessageDeflateExtension.setClientNoContextTakeover(false);
inputExtensions.add(perMessageDeflateExtension);
}
List<IProtocol> inputProtocols = new ArrayList<>(protocolVersions.size());
for (ProtocolVersion protocolVersion : protocolVersions) {
inputProtocols.add(new Protocol(protocolVersion.getSubProtocolName()));
}
Draft draft = new Draft_6455(Collections.emptyList(), inputProtocols);
Draft draft = new Draft_6455(inputExtensions, inputProtocols);
transmitter = new MultiProtocolWebSocketTransmitter(featureRepository, configuration, draft);
JSONCommunicator communicator = new JSONCommunicator(transmitter, false);
ISessionFactory sessionFactory = new MultiProtocolSessionFactory(featureRepository);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ of this software and associated documentation files (the "Software"), to deal
import eu.chargetime.ocpp.wss.WssFactoryBuilder;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletionStage;
import java.util.zip.Deflater;
import javax.net.ssl.SSLContext;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.extensions.IExtension;
import org.java_websocket.extensions.permessage_deflate.PerMessageDeflateExtension;
import org.java_websocket.protocols.IProtocol;
import org.java_websocket.protocols.Protocol;
import org.slf4j.Logger;
Expand All @@ -67,11 +69,20 @@ public MultiProtocolJSONServer(
featureRepository = new MultiProtocolFeatureRepository(protocolVersions);
MultiProtocolSessionFactory sessionFactory = new MultiProtocolSessionFactory(featureRepository);

List<IExtension> extensions = new ArrayList<>();
if (configuration.getParameter(JSONConfiguration.WEBSOCKET_COMPRESSION_SUPPORT, true)) {
PerMessageDeflateExtension perMessageDeflateExtension =
new PerMessageDeflateExtension(Deflater.BEST_COMPRESSION);
perMessageDeflateExtension.setThreshold(0);
perMessageDeflateExtension.setServerNoContextTakeover(false);
perMessageDeflateExtension.setClientNoContextTakeover(false);
extensions.add(perMessageDeflateExtension);
}
List<IProtocol> protocols = new ArrayList<>(protocolVersions.size());
for (ProtocolVersion protocolVersion : protocolVersions) {
protocols.add(new Protocol(protocolVersion.getSubProtocolName()));
}
Draft draft = new Draft_6455(Collections.emptyList(), protocols);
Draft draft = new Draft_6455(extensions, protocols);

if (configuration.getParameter(JSONConfiguration.HTTP_HEALTH_CHECK_ENABLED, true)) {
logger.info("JSONServer with HttpHealthCheckDraft");
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v2_0/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dependencies {
compile project(':common')
compile project(':OCPP-J')
compile 'org.java-websocket:Java-WebSocket:1.5.3'
compile 'org.java-websocket:Java-WebSocket:1.6.0'
testCompile 'junit:junit:4.13.2'
testCompile 'org.mockito:mockito-core:4.11.0'
testCompile 'org.hamcrest:hamcrest-core:1.3'
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v2_0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.4</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Loading