Skip to content

Commit

Permalink
chore: fix checkstyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Jul 14, 2024
1 parent c975c63 commit a4dbd53
Show file tree
Hide file tree
Showing 19 changed files with 328 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -67,7 +65,12 @@ public class OcppConfiguration {
private final List<Feature> logging;
private final String routerEndpointPath;

public OcppConfiguration(CentralSystemService ocpp12Server, ocpp.cs._2012._06.CentralSystemService ocpp15Server, ocpp.cs._2015._10.CentralSystemService ocpp16Server, @Qualifier("MessageHeaderInterceptor") PhaseInterceptor<Message> messageHeaderInterceptor) {
public OcppConfiguration(
CentralSystemService ocpp12Server,
ocpp.cs._2012._06.CentralSystemService ocpp15Server,
ocpp.cs._2015._10.CentralSystemService ocpp16Server,
@Qualifier("MessageHeaderInterceptor") PhaseInterceptor<Message> messageHeaderInterceptor
) {
this.ocpp12Server = ocpp12Server;
this.ocpp15Server = ocpp15Server;
this.ocpp16Server = ocpp16Server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import de.rwth.idsg.steve.ocpp.ws.ChargePointServiceInvoker;
import de.rwth.idsg.steve.ocpp.ws.SessionContextStore;
import de.rwth.idsg.steve.ocpp.ws.ocpp12.Ocpp12TypeStore;
import de.rwth.idsg.steve.ocpp.ws.ocpp12.Ocpp12WebSocketEndpoint;
import de.rwth.idsg.steve.ocpp.ws.pipeline.OutgoingCallPipeline;
import de.rwth.idsg.steve.repository.dto.ChargePointSelect;
import ocpp.cp._2010._08.ChargePointService;
Expand All @@ -44,20 +43,27 @@
* @since 10.03.2018
*/
@Service
@Qualifier("ChargePointService12_Invoker")
public class ChargePointService12_InvokerImpl implements ChargePointService12_Invoker {

private final ChargePointServiceInvoker wsHelper;
private final ClientProviderWithCache<ChargePointService> soapHelper;

public ChargePointService12_InvokerImpl(OutgoingCallPipeline pipeline, @Qualifier("sessionContextStore12") SessionContextStore sessionContextStore, ClientProvider clientProvider) {
public ChargePointService12_InvokerImpl(
OutgoingCallPipeline pipeline,
@Qualifier("sessionContextStore12") SessionContextStore sessionContextStore,
ClientProvider clientProvider
) {
this.wsHelper = new ChargePointServiceInvoker(pipeline, sessionContextStore, Ocpp12TypeStore.INSTANCE);
this.soapHelper = new ClientProviderWithCache<>(clientProvider);
}

@Override
public void reset(ChargePointSelect cp, ResetTask task) {
if (cp.isSoap()) {
create(cp).resetAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).resetAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -66,7 +72,9 @@ public void reset(ChargePointSelect cp, ResetTask task) {
@Override
public void clearCache(ChargePointSelect cp, ClearCacheTask task) {
if (cp.isSoap()) {
create(cp).clearCacheAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).clearCacheAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -75,7 +83,9 @@ public void clearCache(ChargePointSelect cp, ClearCacheTask task) {
@Override
public void getDiagnostics(ChargePointSelect cp, GetDiagnosticsTask task) {
if (cp.isSoap()) {
create(cp).getDiagnosticsAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).getDiagnosticsAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -84,7 +94,9 @@ public void getDiagnostics(ChargePointSelect cp, GetDiagnosticsTask task) {
@Override
public void updateFirmware(ChargePointSelect cp, UpdateFirmwareTask task) {
if (cp.isSoap()) {
create(cp).updateFirmwareAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).updateFirmwareAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -93,7 +105,9 @@ public void updateFirmware(ChargePointSelect cp, UpdateFirmwareTask task) {
@Override
public void unlockConnector(ChargePointSelect cp, UnlockConnectorTask task) {
if (cp.isSoap()) {
create(cp).unlockConnectorAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).unlockConnectorAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -102,7 +116,9 @@ public void unlockConnector(ChargePointSelect cp, UnlockConnectorTask task) {
@Override
public void changeAvailability(ChargePointSelect cp, ChangeAvailabilityTask task) {
if (cp.isSoap()) {
create(cp).changeAvailabilityAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).changeAvailabilityAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -111,7 +127,9 @@ public void changeAvailability(ChargePointSelect cp, ChangeAvailabilityTask task
@Override
public void changeConfiguration(ChargePointSelect cp, ChangeConfigurationTask task) {
if (cp.isSoap()) {
create(cp).changeConfigurationAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).changeConfigurationAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -120,7 +138,9 @@ public void changeConfiguration(ChargePointSelect cp, ChangeConfigurationTask ta
@Override
public void remoteStartTransaction(ChargePointSelect cp, RemoteStartTransactionTask task) {
if (cp.isSoap()) {
create(cp).remoteStartTransactionAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).remoteStartTransactionAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand All @@ -129,7 +149,9 @@ public void remoteStartTransaction(ChargePointSelect cp, RemoteStartTransactionT
@Override
public void remoteStopTransaction(ChargePointSelect cp, RemoteStopTransactionTask task) {
if (cp.isSoap()) {
create(cp).remoteStopTransactionAsync(task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId()));
create(cp).remoteStopTransactionAsync(
task.getOcpp12Request(), cp.getChargeBoxId(), task.getOcpp12Handler(cp.getChargeBoxId())
);
} else {
runPipeline(cp, task);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import de.rwth.idsg.steve.ocpp.ws.ChargePointServiceInvoker;
import de.rwth.idsg.steve.ocpp.ws.SessionContextStore;
import de.rwth.idsg.steve.ocpp.ws.ocpp15.Ocpp15TypeStore;
import de.rwth.idsg.steve.ocpp.ws.ocpp15.Ocpp15WebSocketEndpoint;
import de.rwth.idsg.steve.ocpp.ws.pipeline.OutgoingCallPipeline;
import de.rwth.idsg.steve.repository.dto.ChargePointSelect;
import ocpp.cp._2012._06.ChargePointService;
Expand All @@ -50,12 +49,17 @@
* @since 10.03.2018
*/
@Service
@Qualifier("ChargePointService15_Invoker")
public class ChargePointService15_InvokerImpl implements ChargePointService15_Invoker {

private final ChargePointServiceInvoker wsHelper;
private final ClientProviderWithCache<ChargePointService> soapHelper;

public ChargePointService15_InvokerImpl(OutgoingCallPipeline pipeline, @Qualifier("sessionContextStore15") SessionContextStore sessionContextStore, ClientProvider clientProvider) {
public ChargePointService15_InvokerImpl(
OutgoingCallPipeline pipeline,
@Qualifier("sessionContextStore15") SessionContextStore sessionContextStore,
ClientProvider clientProvider
) {
this.wsHelper = new ChargePointServiceInvoker(pipeline, sessionContextStore, Ocpp15TypeStore.INSTANCE);
this.soapHelper = new ClientProviderWithCache<>(clientProvider);
}
Expand Down
Loading

0 comments on commit a4dbd53

Please sign in to comment.