Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5 cleanup #47

Merged
merged 5 commits into from
Apr 17, 2018
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package eu.chargetime.ocpp;/*
package eu.chargetime.ocpp;
/*
ChargeTime.eu - Java-OCA-OCPP

MIT License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package eu.chargetime.ocpp;/*
package eu.chargetime.ocpp;
/*
ChargeTime.eu - Java-OCA-OCPP

MIT License
Expand Down
2 changes: 1 addition & 1 deletion ocpp-v1_6/src/main/java/eu/chargetime/ocpp/IServerAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ public interface IServerAPI {

boolean isClosed();

CompletionStage<Confirmation> send(UUID session, Request request) throws OccurenceConstraintException, UnsupportedFeatureException, NotConnectedException;
CompletionStage<Confirmation> send(UUID sessionIndex, Request request) throws OccurenceConstraintException, UnsupportedFeatureException, NotConnectedException;
}
6 changes: 3 additions & 3 deletions ocpp-v1_6/src/main/java/eu/chargetime/ocpp/JSONClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public class JSONClient implements IClientAPI {

private static final Logger logger = LoggerFactory.getLogger(JSONClient.class);

public final Draft draftOcppOnly =
new Draft_6455(Collections.emptyList(),
Collections.singletonList(new Protocol("ocpp1.6")));
public final Draft draftOcppOnly;
private final WebSocketTransmitter transmitter;
private final FeatureRepository featureRepository;
private final Client client;
Expand All @@ -71,6 +69,8 @@ public JSONClient(ClientCoreProfile coreProfile) {
*/
public JSONClient(ClientCoreProfile coreProfile, String identity) {
this.identity = identity;
draftOcppOnly = new Draft_6455(Collections.emptyList(),
Collections.singletonList(new Protocol("ocpp1.6")));
transmitter = new WebSocketTransmitter(draftOcppOnly);
JSONCommunicator communicator = new JSONCommunicator(transmitter);
AsyncPromiseFulfilerDecorator promiseFulfiler = new AsyncPromiseFulfilerDecorator(new SimplePromiseFulfiller());
Expand Down
6 changes: 3 additions & 3 deletions ocpp-v1_6/src/main/java/eu/chargetime/ocpp/JSONServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public class JSONServer implements IServerAPI {

private static final Logger logger = LoggerFactory.getLogger(JSONServer.class);

public final Draft draftOcppOnly =
new Draft_6455(Collections.emptyList(),
Collections.singletonList(new Protocol("ocpp1.6")));
public final Draft draftOcppOnly;
private final WebSocketListener listener;
private final Server server;
private final FeatureRepository featureRepository;
Expand All @@ -63,6 +61,8 @@ public class JSONServer implements IServerAPI {
public JSONServer(ServerCoreProfile coreProfile) {
featureRepository = new FeatureRepository();
ServerSessionFactory sessionFactory = new ServerSessionFactory(featureRepository);
draftOcppOnly = new Draft_6455(Collections.emptyList(),
Collections.singletonList(new Protocol("ocpp1.6")));
this.listener = new WebSocketListener(sessionFactory, draftOcppOnly);
server = new Server(this.listener, featureRepository, new PromiseRepository());
featureRepository.addFeatureProfile(coreProfile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ public SOAPMessage incomingRequest(SOAPMessageInfo messageInfo) {
SOAPMessage confirmation = null;
try {
confirmation = chargeBoxes.get(identity).relay(message).get();
} catch (InterruptedException e) {
logger.warn("incomingRequest() chargeBoxes.relay failed", e);
} catch (ExecutionException e) {
} catch (InterruptedException | ExecutionException e) {
logger.warn("incomingRequest() chargeBoxes.relay failed", e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class WebServiceReceiver extends SOAPSyncHelper implements Receiver {
private static final Logger logger = LoggerFactory.getLogger(WebServiceReceiver.class);

private RadioEvents events;
SOAPConnection soapConnection;
private SOAPConnection soapConnection;
private String url;
private WebServiceReceiverEvents receiverEvents;
private boolean connected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ of this software and associated documentation files (the "Software"), to deal
public class WebServiceTransmitter extends SOAPSyncHelper implements Transmitter {
private static final Logger logger = LoggerFactory.getLogger(WebServiceTransmitter.class);

SOAPConnection soapConnection;
private SOAPConnection soapConnection;
private String url;
private RadioEvents events;
boolean connected;
private boolean connected;

public WebServiceTransmitter() {
connected = false;
Expand Down Expand Up @@ -85,8 +85,7 @@ protected void sendRequest(final SOAPMessage message) throws NotConnectedExcepti
throw new NotConnectedException();
Thread thread = new Thread(() -> {
try {
SOAPMessage soapMessage = message;
SOAPMessage response = soapConnection.call(soapMessage, url);
SOAPMessage response = soapConnection.call(message, url);
events.receivedMessage(response);
} catch (SOAPException e) {
logger.warn("sendRequest() failed", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void enableWSS(WssFactoryBuilder wssFactoryBuilder) {
}

public void setPingInterval(int interval) {
this.pingInterval = pingInterval;
this.pingInterval = interval;

if(server != null) {
server.setConnectionLostTimeout(interval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void enableWSS(WssSocketBuilder wssSocketBuilder) {
}

public void setPingInterval(int interval) {
this.pingInterval = pingInterval;
this.pingInterval = interval;

if(client != null) {
client.setConnectionLostTimeout(interval);
Expand Down