Skip to content

Commit 82d9799

Browse files
Merge pull request #10 from JavaIsJavaScript/revert-9-master
Revert " update dependencies & refactor"
2 parents 7378e8a + b72c870 commit 82d9799

17 files changed

+71
-91
lines changed

pom.xml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
<java.version>1.8</java.version>
3131
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3232

33-
<jooq.version>3.10.6</jooq.version>
34-
<cxf.version>3.2.4</cxf.version>
35-
<spring.version>5.0.4.RELEASE</spring.version>
36-
<spring.security.version>5.0.3.RELEASE</spring.security.version>
33+
<jooq.version>3.10.1</jooq.version>
34+
<cxf.version>3.2.0</cxf.version>
35+
<spring.version>5.0.0.RELEASE</spring.version>
36+
<spring.security.version>4.2.3.RELEASE</spring.security.version>
3737
<mysql.jdbc.version>8.0.8-dmr</mysql.jdbc.version>
38-
<jetty.version>9.4.9.v20180320</jetty.version>
39-
<lombok.version>1.16.20</lombok.version>
40-
<jackson.version>2.9.5</jackson.version>
38+
<jetty.version>9.4.7.v20170914</jetty.version>
39+
<lombok.version>1.16.18</lombok.version>
40+
<jackson.version>2.9.2</jackson.version>
4141

4242
<!-- In Mysql: schema == database (http://dev.mysql.com/doc/refman/5.6/en/glossary.html#glos_schema) -->
4343
<jdbcUrl>jdbc:mysql://${db.ip}:${db.port}/${db.schema}?useSSL=true&amp;serverTimezone=UTC</jdbcUrl>
@@ -245,7 +245,7 @@
245245
<extraarg>-xjc-Xfluent-api</extraarg>
246246
<extraarg>-xjc-Xinheritance</extraarg>
247247
<extraarg>-xjc-Xannotate</extraarg>
248-
<!--<extraarg>-verbose</extraarg>-->
248+
<extraarg>-verbose</extraarg>
249249
<extraarg>-exsh</extraarg>
250250
<extraarg>true</extraarg>
251251
</extraargs>
@@ -417,7 +417,7 @@
417417
<dependency>
418418
<groupId>org.apache.logging.log4j</groupId>
419419
<artifactId>log4j-bom</artifactId>
420-
<version>2.11.0</version>
420+
<version>2.9.1</version>
421421
<scope>import</scope>
422422
<type>pom</type>
423423
</dependency>
@@ -429,7 +429,7 @@
429429
<dependency>
430430
<groupId>com.sun.mail</groupId>
431431
<artifactId>javax.mail</artifactId>
432-
<version>1.6.1</version>
432+
<version>1.6.0</version>
433433
</dependency>
434434
<dependency>
435435
<groupId>org.projectlombok</groupId>
@@ -443,9 +443,9 @@
443443
<version>2.9.9</version>
444444
</dependency>
445445
<dependency>
446-
<groupId>org.hibernate.validator</groupId>
446+
<groupId>org.hibernate</groupId>
447447
<artifactId>hibernate-validator</artifactId>
448-
<version>6.0.9.Final</version>
448+
<version>6.0.3.Final</version>
449449
</dependency>
450450
<dependency>
451451
<groupId>com.google.guava</groupId>
@@ -533,7 +533,7 @@
533533
<dependency>
534534
<groupId>com.lmax</groupId>
535535
<artifactId>disruptor</artifactId>
536-
<version>3.4.1</version>
536+
<version>3.3.7</version>
537537
</dependency>
538538

539539
<!-- CXF -->
@@ -572,11 +572,6 @@
572572
<artifactId>cxf-rt-transports-http-hc</artifactId>
573573
<version>${cxf.version}</version>
574574
</dependency>
575-
<dependency>
576-
<groupId>org.apache.cxf</groupId>
577-
<artifactId>cxf-rt-features-logging</artifactId>
578-
<version>${cxf.version}</version>
579-
</dependency>
580575

581576
<!-- Jetty related dependencies -->
582577
<dependency>
@@ -635,7 +630,7 @@
635630
<dependency>
636631
<groupId>com.zaxxer</groupId>
637632
<artifactId>HikariCP</artifactId>
638-
<version>2.7.8</version>
633+
<version>2.7.2</version>
639634
</dependency>
640635
<dependency>
641636
<groupId>org.jooq</groupId>

src/main/java/de/rwth/idsg/steve/config/OcppConfiguration.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package de.rwth.idsg.steve.config;
22

3-
import de.rwth.idsg.steve.ocpp.soap.LoggingFeatureProxy;
43
import de.rwth.idsg.steve.ocpp.soap.MediatorInInterceptor;
54
import de.rwth.idsg.steve.ocpp.soap.MessageIdInterceptor;
65
import de.rwth.idsg.steve.ocpp.ws.custom.AlwaysLastStrategy;
@@ -10,7 +9,7 @@
109
import org.apache.cxf.bus.spring.SpringBus;
1110
import org.apache.cxf.common.logging.LogUtils;
1211
import org.apache.cxf.common.logging.Slf4jLogger;
13-
import org.apache.cxf.feature.Feature;
12+
import org.apache.cxf.feature.LoggingFeature;
1413
import org.apache.cxf.interceptor.Interceptor;
1514
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
1615
import org.apache.cxf.message.Message;
@@ -21,8 +20,6 @@
2120
import org.springframework.context.annotation.Configuration;
2221

2322
import javax.annotation.PostConstruct;
24-
import java.util.Collection;
25-
import java.util.Collections;
2623
import java.util.List;
2724

2825
import static de.rwth.idsg.steve.SteveConfiguration.CONFIG;
@@ -56,18 +53,24 @@ public void init() {
5653
List<Interceptor<? extends Message>> interceptors = asList(new MessageIdInterceptor(), fromAddressInterceptor);
5754

5855
// Just a dummy service to route incoming messages to the appropriate service version
59-
createOcppService(ocpp12Server, CONFIG.getRouterEndpointPath(), route, Collections.emptyList());
56+
createOcppService(ocpp12Server, CONFIG.getRouterEndpointPath(), route);
6057

61-
Collection<Feature> logging = Collections.singletonList(LoggingFeatureProxy.INSTANCE.get());
62-
63-
createOcppService(ocpp12Server, "/CentralSystemServiceOCPP12", interceptors, logging);
64-
createOcppService(ocpp15Server, "/CentralSystemServiceOCPP15", interceptors, logging);
65-
createOcppService(ocpp16Server, "/CentralSystemServiceOCPP16", interceptors, logging);
58+
createOcppService(ocpp12Server, "/CentralSystemServiceOCPP12", interceptors);
59+
createOcppService(ocpp15Server, "/CentralSystemServiceOCPP15", interceptors);
60+
createOcppService(ocpp16Server, "/CentralSystemServiceOCPP16", interceptors);
6661
}
6762

63+
/**
64+
* Help by: http://stackoverflow.com/a/31988136
65+
*
66+
* logFeature.initialize(springBus) is not needed, because during the init of bus it will call f.initialize(this)
67+
* in {@link org.apache.cxf.bus.extension.ExtensionManagerBus#initializeFeatures()} anyway
68+
*/
6869
@Bean(name = Bus.DEFAULT_BUS_ID, destroyMethod = "shutdown")
6970
public SpringBus springBus() {
70-
return new SpringBus();
71+
SpringBus bus = new SpringBus();
72+
bus.getFeatures().add(new LoggingFeature()); // Log incoming/outgoing messages
73+
return bus;
7174
}
7275

7376
@Bean
@@ -83,13 +86,11 @@ public WsSessionSelectStrategy sessionSelectStrategy() {
8386
}
8487

8588
private void createOcppService(Object serviceBean, String address,
86-
List<Interceptor<? extends Message>> interceptors,
87-
Collection<? extends Feature> features) {
89+
List<Interceptor<? extends Message>> interceptors) {
8890
JaxWsServerFactoryBean f = new JaxWsServerFactoryBean();
8991
f.setBus(springBus());
9092
f.setServiceBean(serviceBean);
9193
f.setAddress(address);
92-
f.getFeatures().addAll(features);
9394
f.getInInterceptors().addAll(interceptors);
9495
f.create();
9596
}

src/main/java/de/rwth/idsg/steve/config/WebSocketConfiguration.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
import org.eclipse.jetty.websocket.api.WebSocketBehavior;
1414
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
1515
import org.springframework.beans.factory.annotation.Autowired;
16+
import org.springframework.context.annotation.Bean;
1617
import org.springframework.context.annotation.Configuration;
18+
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
19+
import org.springframework.web.servlet.HandlerMapping;
1720
import org.springframework.web.socket.config.annotation.EnableWebSocket;
21+
import org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry;
1822
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
1923
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
2024
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
@@ -72,4 +76,27 @@ public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
7276
private List<AbstractWebSocketEndpoint> getEndpoints() {
7377
return Lists.newArrayList(ocpp16WebSocketEndpoint, ocpp15WebSocketEndpoint, ocpp12WebSocketEndpoint);
7478
}
79+
80+
// -------------------------------------------------------------------------
81+
// We don't need no SockJS fallback. But, nevertheless, Spring initializes
82+
// a scheduler for it, to be used in the implementation
83+
// AbstractWebSocketHandlerRegistration.withSockJS(). We don't call
84+
// WebSocketHandlerRegistry.withSockJS() above to add SockJS support,
85+
// so the scheduler is useless.
86+
//
87+
// Hereby, we override the default beans provided by
88+
// org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport
89+
// -------------------------------------------------------------------------
90+
91+
@Bean
92+
public HandlerMapping webSocketHandlerMapping() {
93+
ServletWebSocketHandlerRegistry registry = new ServletWebSocketHandlerRegistry();
94+
registerWebSocketHandlers(registry);
95+
return registry.getHandlerMapping();
96+
}
97+
98+
@Bean
99+
public ThreadPoolTaskScheduler defaultSockJsTaskScheduler() {
100+
return null;
101+
}
75102
}

src/main/java/de/rwth/idsg/steve/ocpp/soap/ClientProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ private ClientProvider() { }
2525
public static JaxWsProxyFactoryBean getBean(String endpointAddress) {
2626
JaxWsProxyFactoryBean f = new JaxWsProxyFactoryBean();
2727
f.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
28-
f.getFeatures().add(LoggingFeatureProxy.INSTANCE.get());
2928
f.getFeatures().add(new WSAddressingFeature());
3029
f.setAddress(endpointAddress);
3130
return f;

src/main/java/de/rwth/idsg/steve/ocpp/soap/LoggingFeatureProxy.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/main/java/de/rwth/idsg/steve/web/dto/ChargePointBatchInsertForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import de.rwth.idsg.steve.web.validation.ChargeBoxId;
44
import lombok.Getter;
55
import lombok.Setter;
6+
import org.hibernate.validator.constraints.NotEmpty;
67

7-
import javax.validation.constraints.NotEmpty;
88
import java.util.List;
99

1010
/**

src/main/java/de/rwth/idsg/steve/web/dto/ChargePointForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import de.rwth.idsg.steve.web.validation.ChargeBoxId;
44
import lombok.Getter;
55
import lombok.Setter;
6+
import org.hibernate.validator.constraints.NotBlank;
67
import org.hibernate.validator.constraints.Range;
78

8-
import javax.validation.constraints.NotBlank;
99
import java.math.BigDecimal;
1010

1111
/**

src/main/java/de/rwth/idsg/steve/web/dto/OcppTagBatchInsertForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import de.rwth.idsg.steve.web.validation.IdTag;
44
import lombok.Getter;
55
import lombok.Setter;
6+
import org.hibernate.validator.constraints.NotEmpty;
67

7-
import javax.validation.constraints.NotEmpty;
88
import java.util.List;
99

1010
/**

src/main/java/de/rwth/idsg/steve/web/dto/OcppTagForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import de.rwth.idsg.steve.web.validation.IdTag;
44
import lombok.Getter;
55
import lombok.Setter;
6+
import org.hibernate.validator.constraints.NotEmpty;
67
import org.joda.time.LocalDateTime;
78

89
import javax.validation.constraints.Future;
9-
import javax.validation.constraints.NotEmpty;
1010
import javax.validation.constraints.NotNull;
1111

1212
/**

src/main/java/de/rwth/idsg/steve/web/dto/SettingsForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import lombok.Getter;
88
import lombok.NoArgsConstructor;
99
import lombok.Setter;
10+
import org.hibernate.validator.constraints.Email;
1011

11-
import javax.validation.constraints.Email;
1212
import javax.validation.constraints.Min;
1313
import javax.validation.constraints.NotNull;
1414
import java.util.List;

src/main/java/de/rwth/idsg/steve/web/dto/UserForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import lombok.Getter;
44
import lombok.Setter;
5+
import org.hibernate.validator.constraints.Email;
56
import org.joda.time.LocalDate;
67

7-
import javax.validation.constraints.Email;
88
import javax.validation.constraints.NotNull;
99

1010
/**

src/main/java/de/rwth/idsg/steve/web/dto/ocpp/ChangeConfigurationParams.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import lombok.Getter;
66
import lombok.RequiredArgsConstructor;
77
import lombok.Setter;
8+
import org.hibernate.validator.constraints.NotBlank;
89

910
import javax.validation.constraints.AssertTrue;
10-
import javax.validation.constraints.NotBlank;
1111
import javax.validation.constraints.NotNull;
1212
import javax.validation.constraints.Pattern;
1313

@@ -27,7 +27,7 @@ public class ChangeConfigurationParams extends MultipleChargePointSelect {
2727
private ConfigurationKeyType keyType = ConfigurationKeyType.PREDEFINED;
2828

2929
@NotBlank(message = "Value is required")
30-
@Pattern(regexp = "\\S+", message = "Value cannot contain any whitespace")
30+
@Pattern(regexp = "\\S+", message = "Value cannot contain any whitespace")
3131
private String value;
3232

3333
@AssertTrue(message = "Custom Configuration Key cannot be left blank")
@@ -71,7 +71,7 @@ private enum ConfigurationKeyType {
7171
@Getter private final String value;
7272

7373
public static ConfigurationKeyType fromValue(String v) {
74-
for (ConfigurationKeyType c : ConfigurationKeyType.values()) {
74+
for (ConfigurationKeyType c: ConfigurationKeyType.values()) {
7575
if (c.value.equals(v)) {
7676
return c;
7777
}

src/main/java/de/rwth/idsg/steve/web/dto/ocpp/GetDiagnosticsParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import lombok.Getter;
44
import lombok.Setter;
5+
import org.hibernate.validator.constraints.NotBlank;
56
import org.joda.time.LocalDateTime;
67

78
import javax.validation.constraints.AssertTrue;
89
import javax.validation.constraints.Min;
9-
import javax.validation.constraints.NotBlank;
1010
import javax.validation.constraints.Past;
1111
import javax.validation.constraints.Pattern;
1212

src/main/java/de/rwth/idsg/steve/web/dto/ocpp/RemoteStartTransactionParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import de.rwth.idsg.steve.web.validation.IdTag;
44
import lombok.Getter;
55
import lombok.Setter;
6+
import org.hibernate.validator.constraints.NotBlank;
67

78
import javax.validation.constraints.Min;
8-
import javax.validation.constraints.NotBlank;
99

1010
/**
1111
* @author Sevket Goekay <goekay@dbis.rwth-aachen.de>

src/main/java/de/rwth/idsg/steve/web/dto/ocpp/ReserveNowParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import de.rwth.idsg.steve.web.validation.IdTag;
44
import lombok.Getter;
55
import lombok.Setter;
6+
import org.hibernate.validator.constraints.NotBlank;
67
import org.joda.time.LocalDateTime;
78

89
import javax.validation.constraints.Future;
910
import javax.validation.constraints.Min;
10-
import javax.validation.constraints.NotBlank;
1111
import javax.validation.constraints.NotNull;
1212

1313
/**

0 commit comments

Comments
 (0)