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
158 changes: 0 additions & 158 deletions OCPP-J/pom.xml

This file was deleted.

17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ Please note, this is a library and not an application, so there is no main metho

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

The library supports version 2.0.1 and 1.6 SOAP and web sockets.
The library supports OCPP 1.6 with JSON and SOAP transports and OCPP 2.0.1.

The following packages are built from the sources:

| Package | Description |
|-------------|-------------------------------------------------------------------|
| ocpp16j | OCPP 1.6 with JSON transport (only) |
| ocpp16s | OCPP 1.6 with SOAP transport (only) |
| ocpp2 | OCPP 2.0.1 (multi-protocol capable, ocpp16j integration possible) |
| | |
| ocpp16 | OCPP 1.6 base dependency package |
| ocpp-common | common dependency package |
| ocpp-json | JSON transport dependency package |
| | |
| ocpp16-test | OCPP 1.6 integration tests |
| ocpp2-test | OCPP 1.6 and 2.0.1 integration tests |

Incoming request events are split into feature profiles as described in the OCPP specification.
I recommend that you download and read the specification from openchargealliance.org
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* This file was generated by the Gradle 'init' task.
* Java-OCA-OCPP gradle build configuration
*/

buildscript {
Expand All @@ -15,7 +15,7 @@ buildscript {

allprojects {
group = 'eu.chargetime.ocpp'
version = '1.2'
version = '2.0'
}

subprojects {
Expand Down
8 changes: 5 additions & 3 deletions ocpp-common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/*
* Java-OCA-OCPP ocpp-common gradle build configuration
*/

dependencies {
compile 'org.slf4j:slf4j-api:2.0.17'
compile 'ch.qos.logback:logback-classic:1.3.16'
compile group: 'javax.xml.soap', name: 'javax.xml.soap-api', version: '1.4.0'
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.1'
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'

testCompile 'junit:junit:4.13.2'
testCompile 'org.mockito:mockito-core:4.11.0'
testCompile 'org.hamcrest:hamcrest-all:1.3'
}

description = 'Java-OCA-OCPP Common'
description = 'Java-OCA-OCPP OCPP Common Package'
56 changes: 26 additions & 30 deletions ocpp-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<modelVersion>4.0.0</modelVersion>

<groupId>eu.chargetime.ocpp</groupId>
<artifactId>common</artifactId>
<version>1.2.0</version>
<artifactId>ocpp-common</artifactId>
<version>2.0.0</version>

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

<licenses>
Expand Down Expand Up @@ -51,11 +51,6 @@
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
<version>1.4.0</version>
</dependency>

<!-- Logging -->
<dependency>
Expand Down Expand Up @@ -90,6 +85,7 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -129,29 +125,29 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
19 changes: 0 additions & 19 deletions ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ of this software and associated documentation files (the "Software"), to deal
*/

import eu.chargetime.ocpp.model.*;
import eu.chargetime.ocpp.utilities.SugarUtil;
import java.util.ArrayDeque;
import javax.xml.soap.SOAPMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;

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

if (call != null) {
if (call instanceof SOAPMessage) {
logger.trace("Send a message: {}", SugarUtil.soapMessageToString((SOAPMessage) call));
} else {
logger.trace("Send a message: {}", call);
}
}

try {
if (radio.isClosed()) {
if (request.transactionRelated() && transactionQueue != null) {
Expand Down Expand Up @@ -298,14 +287,6 @@ public void connected() {
@Override
public void receivedMessage(Object input) {
Message message = parse(input);
if (message != null) {
Object payload = message.getPayload();
if (payload instanceof Document) {
logger.trace("Receive a message: {}", SugarUtil.docToString((Document) payload));
} else {
logger.trace("Receive a message: {}", message);
}
}
if (message instanceof CallResultMessage) {
events.onCallResult(message.getId(), message.getAction(), message.getPayload());
} else if (message instanceof CallErrorMessage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ private ToStringHelperImpl addHolder(String name, Object value) {

private ToStringHelperImpl addHolder(String name, ZonedDateTime value) {
ValueHolder valueHolder = addHolder();
valueHolder.value = "\"" + SugarUtil.zonedDateTimeToString(value) + "\"";
valueHolder.value = "\"" + zonedDateTimeToString(value) + "\"";
valueHolder.name = name;
return this;
}
Expand All @@ -911,4 +911,9 @@ private static final class ValueHolder {
ValueHolder next;
}
}

public static String zonedDateTimeToString(ZonedDateTime zonedDateTime) {
if (zonedDateTime == null) return "";
return zonedDateTime.toString();
}
}
7 changes: 4 additions & 3 deletions OCPP-J/build.gradle → ocpp-json/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* This file was generated by the Gradle 'init' task.
* Java-OCA-OCPP ocpp-json gradle build configuration
*/

dependencies {
compile project(':common')
compile project(':ocpp-common')
compile 'com.google.code.gson:gson:2.13.2'
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:3.0'
Expand All @@ -16,5 +17,5 @@ task javadocJar(type: Jar) {
from(javadoc.destinationDir)
}

description = 'Java-OCA-OCPP OCPP-J'
description = 'Java-OCA-OCPP OCPP JSON Transport'
publishing.publications.maven.artifact(javadocJar)
Loading