Skip to content

Commit d62ae22

Browse files
authored
Merge pull request #397 from ChargeTimeEU/clean_up_project_structure
Clean up project structure and bump version to 2.0
2 parents ca316eb + 2711952 commit d62ae22

File tree

65 files changed

+796
-534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+796
-534
lines changed

OCPP-J/pom.xml

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

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,22 @@ Please note, this is a library and not an application, so there is no main metho
1212

1313
The design is driven by test, which will ensure premium software that is easy to adapt and modify to your needs.
1414

15-
The library supports version 2.0.1 and 1.6 SOAP and web sockets.
15+
The library supports OCPP 1.6 with JSON and SOAP transports and OCPP 2.0.1.
16+
17+
The following packages are built from the sources:
18+
19+
| Package | Description |
20+
|-------------|-------------------------------------------------------------------|
21+
| ocpp16j | OCPP 1.6 with JSON transport (only) |
22+
| ocpp16s | OCPP 1.6 with SOAP transport (only) |
23+
| ocpp2 | OCPP 2.0.1 (multi-protocol capable, ocpp16j integration possible) |
24+
| | |
25+
| ocpp16 | OCPP 1.6 base dependency package |
26+
| ocpp-common | common dependency package |
27+
| ocpp-json | JSON transport dependency package |
28+
| | |
29+
| ocpp16-test | OCPP 1.6 integration tests |
30+
| ocpp2-test | OCPP 1.6 and 2.0.1 integration tests |
1631

1732
Incoming request events are split into feature profiles as described in the OCPP specification.
1833
I recommend that you download and read the specification from openchargealliance.org

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* This file was generated by the Gradle 'init' task.
2+
* Java-OCA-OCPP gradle build configuration
33
*/
44

55
buildscript {
@@ -15,7 +15,7 @@ buildscript {
1515

1616
allprojects {
1717
group = 'eu.chargetime.ocpp'
18-
version = '1.2'
18+
version = '2.0'
1919
}
2020

2121
subprojects {

ocpp-common/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
/*
2+
* Java-OCA-OCPP ocpp-common gradle build configuration
3+
*/
14

25
dependencies {
36
compile 'org.slf4j:slf4j-api:2.0.17'
47
compile 'ch.qos.logback:logback-classic:1.3.16'
5-
compile group: 'javax.xml.soap', name: 'javax.xml.soap-api', version: '1.4.0'
6-
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.1'
8+
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
79

810
testCompile 'junit:junit:4.13.2'
911
testCompile 'org.mockito:mockito-core:4.11.0'
1012
testCompile 'org.hamcrest:hamcrest-all:1.3'
1113
}
1214

13-
description = 'Java-OCA-OCPP Common'
15+
description = 'Java-OCA-OCPP OCPP Common Package'

ocpp-common/pom.xml

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>eu.chargetime.ocpp</groupId>
8-
<artifactId>common</artifactId>
9-
<version>1.2.0</version>
8+
<artifactId>ocpp-common</artifactId>
9+
<version>2.0.0</version>
1010

11-
<name>Java-OCA-OCPP common</name>
12-
<description>Implementation of Open Charge-Point Protocol common library.</description>
11+
<name>Java-OCA-OCPP OCPP Common Package</name>
12+
<description>Java-OCA-OCPP common dependency package</description>
1313
<url>https://github.com/ChargeTimeEU/Java-OCA-OCPP</url>
1414

1515
<licenses>
@@ -51,11 +51,6 @@
5151
<artifactId>jaxb-api</artifactId>
5252
<version>2.3.1</version>
5353
</dependency>
54-
<dependency>
55-
<groupId>javax.xml.soap</groupId>
56-
<artifactId>javax.xml.soap-api</artifactId>
57-
<version>1.4.0</version>
58-
</dependency>
5954

6055
<!-- Logging -->
6156
<dependency>
@@ -90,6 +85,7 @@
9085
<scope>test</scope>
9186
</dependency>
9287
</dependencies>
88+
9389
<build>
9490
<plugins>
9591
<plugin>
@@ -129,29 +125,29 @@
129125
</executions>
130126
</plugin>
131127
<plugin>
132-
<groupId>org.apache.maven.plugins</groupId>
133-
<artifactId>maven-gpg-plugin</artifactId>
134-
<version>3.2.8</version>
135-
<executions>
136-
<execution>
137-
<id>sign-artifacts</id>
138-
<phase>verify</phase>
139-
<goals>
140-
<goal>sign</goal>
141-
</goals>
142-
</execution>
143-
</executions>
128+
<groupId>org.apache.maven.plugins</groupId>
129+
<artifactId>maven-gpg-plugin</artifactId>
130+
<version>3.2.8</version>
131+
<executions>
132+
<execution>
133+
<id>sign-artifacts</id>
134+
<phase>verify</phase>
135+
<goals>
136+
<goal>sign</goal>
137+
</goals>
138+
</execution>
139+
</executions>
144140
</plugin>
145141
<plugin>
146-
<groupId>org.sonatype.plugins</groupId>
147-
<artifactId>nexus-staging-maven-plugin</artifactId>
148-
<version>1.7.0</version>
149-
<extensions>true</extensions>
150-
<configuration>
151-
<serverId>ossrh</serverId>
152-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
153-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
154-
</configuration>
142+
<groupId>org.sonatype.plugins</groupId>
143+
<artifactId>nexus-staging-maven-plugin</artifactId>
144+
<version>1.7.0</version>
145+
<extensions>true</extensions>
146+
<configuration>
147+
<serverId>ossrh</serverId>
148+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
149+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
150+
</configuration>
155151
</plugin>
156152
</plugins>
157153
</build>

ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ of this software and associated documentation files (the "Software"), to deal
2828
*/
2929

3030
import eu.chargetime.ocpp.model.*;
31-
import eu.chargetime.ocpp.utilities.SugarUtil;
3231
import java.util.ArrayDeque;
33-
import javax.xml.soap.SOAPMessage;
3432
import org.slf4j.Logger;
3533
import org.slf4j.LoggerFactory;
36-
import org.w3c.dom.Document;
3734

3835
/**
3936
* Abstract class. Handles basic communication: Pack and send messages. Receive and unpack messages.
@@ -165,14 +162,6 @@ public void accept(CommunicatorEvents events) {
165162
public synchronized void sendCall(String uniqueId, String action, Request request) {
166163
Object call = makeCall(uniqueId, action, packPayload(request));
167164

168-
if (call != null) {
169-
if (call instanceof SOAPMessage) {
170-
logger.trace("Send a message: {}", SugarUtil.soapMessageToString((SOAPMessage) call));
171-
} else {
172-
logger.trace("Send a message: {}", call);
173-
}
174-
}
175-
176165
try {
177166
if (radio.isClosed()) {
178167
if (request.transactionRelated() && transactionQueue != null) {
@@ -298,14 +287,6 @@ public void connected() {
298287
@Override
299288
public void receivedMessage(Object input) {
300289
Message message = parse(input);
301-
if (message != null) {
302-
Object payload = message.getPayload();
303-
if (payload instanceof Document) {
304-
logger.trace("Receive a message: {}", SugarUtil.docToString((Document) payload));
305-
} else {
306-
logger.trace("Receive a message: {}", message);
307-
}
308-
}
309290
if (message instanceof CallResultMessage) {
310291
events.onCallResult(message.getId(), message.getAction(), message.getPayload());
311292
} else if (message instanceof CallErrorMessage) {

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/IClientAPI.java renamed to ocpp-common/src/main/java/eu/chargetime/ocpp/IClientAPI.java

File renamed without changes.

ocpp-v1_6/src/main/java/eu/chargetime/ocpp/IServerAPI.java renamed to ocpp-common/src/main/java/eu/chargetime/ocpp/IServerAPI.java

File renamed without changes.

ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/MoreObjects.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ private ToStringHelperImpl addHolder(String name, Object value) {
900900

901901
private ToStringHelperImpl addHolder(String name, ZonedDateTime value) {
902902
ValueHolder valueHolder = addHolder();
903-
valueHolder.value = "\"" + SugarUtil.zonedDateTimeToString(value) + "\"";
903+
valueHolder.value = "\"" + zonedDateTimeToString(value) + "\"";
904904
valueHolder.name = name;
905905
return this;
906906
}
@@ -911,4 +911,9 @@ private static final class ValueHolder {
911911
ValueHolder next;
912912
}
913913
}
914+
915+
public static String zonedDateTimeToString(ZonedDateTime zonedDateTime) {
916+
if (zonedDateTime == null) return "";
917+
return zonedDateTime.toString();
918+
}
914919
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* This file was generated by the Gradle 'init' task.
2+
* Java-OCA-OCPP ocpp-json gradle build configuration
33
*/
44

55
dependencies {
6-
compile project(':common')
6+
compile project(':ocpp-common')
77
compile 'com.google.code.gson:gson:2.13.2'
88
compile 'org.java-websocket:Java-WebSocket:1.6.0'
9+
910
testCompile 'junit:junit:4.13.2'
1011
testCompile 'org.mockito:mockito-core:4.11.0'
1112
testCompile 'org.hamcrest:hamcrest-core:3.0'
@@ -16,5 +17,5 @@ task javadocJar(type: Jar) {
1617
from(javadoc.destinationDir)
1718
}
1819

19-
description = 'Java-OCA-OCPP OCPP-J'
20+
description = 'Java-OCA-OCPP OCPP JSON Transport'
2021
publishing.publications.maven.artifact(javadocJar)

0 commit comments

Comments
 (0)