Skip to content

Commit

Permalink
1) do not select charge points without endpoint address for triggerin…
Browse files Browse the repository at this point in the history
…g ocpp operations (duh!)

2) made the fields final in dtos (these are just simple value objects for frontend)
3) updated maven dependencies to the latest versions
4) little version bump
  • Loading branch information
goekay committed Mar 10, 2015
1 parent acce33e commit fc28b5a
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 28 deletions.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.rwth.idsg</groupId>
<artifactId>steve</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
<packaging>jar</packaging>

<developers>
Expand All @@ -17,12 +17,12 @@
<properties>
<java.version>1.7</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jooq.version>3.5.2</jooq.version>
<cxf.version>3.0.3</cxf.version>
<spring.version>4.1.4.RELEASE</spring.version>
<spring.security.version>3.2.5.RELEASE</spring.security.version>
<jooq.version>3.5.3</jooq.version>
<cxf.version>3.0.4</cxf.version>
<spring.version>4.1.5.RELEASE</spring.version>
<spring.security.version>3.2.6.RELEASE</spring.security.version>
<mysql.jdbc.version>5.1.34</mysql.jdbc.version>
<jetty.version>9.2.7.v20150116</jetty.version>
<jetty.version>9.2.9.v20150224</jetty.version>
</properties>

<build>
Expand Down Expand Up @@ -279,7 +279,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -399,7 +399,7 @@
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java6</artifactId>
<version>2.2.5</version>
<version>2.3.3</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.zaxxer.hikari.HikariDataSource;
import de.rwth.idsg.steve.SteveConfiguration;
import de.rwth.idsg.steve.web.GsonHttpMessageConverter;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.jooq.SQLDialect;
import org.jooq.conf.Settings;
import org.jooq.impl.DataSourceConnectionProvider;
Expand Down Expand Up @@ -59,6 +61,10 @@ private void initDataSource() {
@Qualifier("jooqConfig")
public org.jooq.Configuration jooqConfig() {

// Disable the Jooq logo in logs
// https://github.com/jOOQ/jOOQ/issues/4019
Logger.getLogger(org.jooq.Constants.class).setLevel(Level.WARN);

initDataSource();

// Configuration for JOOQ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ public List<ChargePointSelect> getChargePointsV15() {
* SELECT chargeBoxId, endpoint_address
* FROM chargebox
* WHERE ocppVersion = ?
* AND endpoint_address IS NOT NULL
*/
private List<ChargePointSelect> internalGetChargePoints(OcppVersion version) {
return DSL.using(config)
.select(CHARGEBOX.CHARGEBOXID, CHARGEBOX.ENDPOINT_ADDRESS)
.from(CHARGEBOX)
.where(CHARGEBOX.OCPPVERSION.equal(version.getValue()))
.and(CHARGEBOX.ENDPOINT_ADDRESS.isNotNull())
.fetch()
.map(new ChargePointSelectMapper());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class RequestTaskStoreImpl implements RequestTaskStore {

@Override
public List<TaskOverview> getOverview() {
List<TaskOverview> list = new ArrayList<>();
List<TaskOverview> list = new ArrayList<>(lookupTable.size());
for (Map.Entry<Integer, RequestTask> entry : lookupTable.entrySet()) {
RequestTask r = entry.getValue();
list.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Getter
@Builder
public final class ChargePoint {
private String chargeBoxId, endpointAddress, ocppVersion, chargePointVendor, chargePointModel,
private final String chargeBoxId, endpointAddress, ocppVersion, chargePointVendor, chargePointModel,
chargePointSerialNumber, chargeBoxSerialNumber, firewireVersion, firewireUpdateStatus,
firewireUpdateTimestamp, iccid, imsi, meterType, meterSerialNumber, diagnosticsStatus,
diagnosticsTimestamp, lastHeartbeatTimestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
*/
@Getter
@Builder
public class ChargePointSelect {
private String chargeBoxId, endpointAddress;
public final class ChargePointSelect {
private final String chargeBoxId, endpointAddress;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
@Getter
@Builder
public final class ConnectorStatus {
private String chargeBoxId, timeStamp, status, errorCode;
private int connectorId;
private final String chargeBoxId, timeStamp, status, errorCode;
private final int connectorId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
@Getter
@Builder
public final class DbVersion {
private String version, updateTimestamp;
private final String version, updateTimestamp;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
@Getter
@Builder
public final class Heartbeat {
private String chargeBoxId, lastTimestamp;
private final String chargeBoxId, lastTimestamp;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Getter
@Builder
public final class Reservation {
private int id;
private Integer transactionId;
private String idTag, chargeBoxId, startDatetime, expiryDatetime, status;
private final int id;
private final Integer transactionId;
private final String idTag, chargeBoxId, startDatetime, expiryDatetime, status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@Builder
public final class Statistics {
// Number of chargeboxes, users, reservations, transactions
private Integer numChargeBoxes, numUsers, numReservations, numTransactions,
private final Integer numChargeBoxes, numUsers, numReservations, numTransactions,
// Received heartbeats
heartbeatToday, heartbeatYesterday, heartbeatEarlier,
// Number of available, occupied, faulted and unavailable chargebox connectors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
@Getter
@EqualsAndHashCode
@Builder
public class TaskOverview implements Comparable<TaskOverview> {
private int taskId, responseCount, requestCount;
private DateTime start, end;
public final class TaskOverview implements Comparable<TaskOverview> {
private final int taskId, responseCount, requestCount;
private final DateTime start, end;

/**
* We want the tasks to be printed in descending order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
@Getter
@Builder
public final class Transaction {
private int id, connectorId;
private String chargeBoxId, idTag, startTimestamp, startValue, stopTimestamp, stopValue;
private final int id, connectorId;
private final String chargeBoxId, idTag, startTimestamp, startValue, stopTimestamp, stopValue;
}
4 changes: 2 additions & 2 deletions src/main/java/de/rwth/idsg/steve/repository/dto/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
@Getter
@Builder
public final class User {
private String idTag, parentIdTag, expiryDate;
private boolean inTransaction, blocked;
private final String idTag, parentIdTag, expiryDate;
private final boolean inTransaction, blocked;
}
3 changes: 2 additions & 1 deletion src/main/resources/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

<category name="org.apache.cxf"><level value="INFO"/></category>
<category name="org.eclipse.jetty"><level value="INFO"/></category>
<category name="com.zaxxer"><level value="INFO"/></category>
<category name="com.zaxxer.hikari"><level value="INFO"/></category>
<category name="HikariPool"><level value="INFO"/></category>
<category name="org.springframework"><level value="INFO"/></category>
<category name="org.springframework.security"><level value="INFO"/></category>
<category name="org.springframework.web.servlet"><level value="INFO"/></category>
Expand Down

0 comments on commit fc28b5a

Please sign in to comment.