1919package de .rwth .idsg .steve .service ;
2020
2121import de .rwth .idsg .steve .SteveException ;
22- import de .rwth .idsg .steve .config .DelegatingTaskExecutor ;
2322import de .rwth .idsg .steve .ocpp .ChargePointServiceInvokerImpl ;
2423import de .rwth .idsg .steve .ocpp .OcppCallback ;
2524import de .rwth .idsg .steve .ocpp .task .CancelReservationTask ;
7372import ocpp .cp ._2015 ._10 .ChargingProfilePurposeType ;
7473import ocpp .cp ._2015 ._10 .GetCompositeScheduleResponse ;
7574import org .joda .time .DateTime ;
75+ import org .springframework .core .task .TaskExecutor ;
7676import org .springframework .stereotype .Service ;
7777
7878import java .util .List ;
@@ -90,7 +90,7 @@ public class ChargePointServiceClient {
9090 private final ReservationRepository reservationRepository ;
9191 private final OcppTagService ocppTagService ;
9292
93- private final DelegatingTaskExecutor asyncTaskExecutor ;
93+ private final TaskExecutor taskExecutor ;
9494 private final TaskStore taskStore ;
9595 private final ChargePointServiceInvokerImpl invoker ;
9696
@@ -107,7 +107,7 @@ public final int changeAvailability(ChangeAvailabilityParams params,
107107 task .addCallback (callback );
108108 }
109109
110- BackgroundService .with (asyncTaskExecutor )
110+ BackgroundService .with (taskExecutor )
111111 .forEach (task .getParams ().getChargePointSelectList ())
112112 .execute (c -> invoker .changeAvailability (c , task ));
113113
@@ -123,7 +123,7 @@ public final int changeConfiguration(ChangeConfigurationParams params,
123123 task .addCallback (callback );
124124 }
125125
126- BackgroundService .with (asyncTaskExecutor )
126+ BackgroundService .with (taskExecutor )
127127 .forEach (task .getParams ().getChargePointSelectList ())
128128 .execute (c -> invoker .changeConfiguration (c , task ));
129129
@@ -139,7 +139,7 @@ public final int clearCache(MultipleChargePointSelect params,
139139 task .addCallback (callback );
140140 }
141141
142- BackgroundService .with (asyncTaskExecutor )
142+ BackgroundService .with (taskExecutor )
143143 .forEach (task .getParams ().getChargePointSelectList ())
144144 .execute (c -> invoker .clearCache (c , task ));
145145
@@ -155,7 +155,7 @@ public final int getDiagnostics(GetDiagnosticsParams params,
155155 task .addCallback (callback );
156156 }
157157
158- BackgroundService .with (asyncTaskExecutor )
158+ BackgroundService .with (taskExecutor )
159159 .forEach (task .getParams ().getChargePointSelectList ())
160160 .execute (c -> invoker .getDiagnostics (c , task ));
161161
@@ -171,7 +171,7 @@ public final int reset(ResetParams params,
171171 task .addCallback (callback );
172172 }
173173
174- BackgroundService .with (asyncTaskExecutor )
174+ BackgroundService .with (taskExecutor )
175175 .forEach (task .getParams ().getChargePointSelectList ())
176176 .execute (c -> invoker .reset (c , task ));
177177
@@ -187,7 +187,7 @@ public final int updateFirmware(UpdateFirmwareParams params,
187187 task .addCallback (callback );
188188 }
189189
190- BackgroundService .with (asyncTaskExecutor )
190+ BackgroundService .with (taskExecutor )
191191 .forEach (task .getParams ().getChargePointSelectList ())
192192 .execute (c -> invoker .updateFirmware (c , task ));
193193
@@ -217,7 +217,7 @@ public final int remoteStartTransaction(RemoteStartTransactionParams params,
217217 task .addCallback (callback );
218218 }
219219
220- BackgroundService .with (asyncTaskExecutor )
220+ BackgroundService .with (taskExecutor )
221221 .forFirst (task .getParams ().getChargePointSelectList ())
222222 .execute (c -> invoker .remoteStartTransaction (c , task ));
223223
@@ -233,7 +233,7 @@ public final int remoteStopTransaction(RemoteStopTransactionParams params,
233233 task .addCallback (callback );
234234 }
235235
236- BackgroundService .with (asyncTaskExecutor )
236+ BackgroundService .with (taskExecutor )
237237 .forFirst (task .getParams ().getChargePointSelectList ())
238238 .execute (c -> invoker .remoteStopTransaction (c , task ));
239239
@@ -249,7 +249,7 @@ public final int unlockConnector(UnlockConnectorParams params,
249249 task .addCallback (callback );
250250 }
251251
252- BackgroundService .with (asyncTaskExecutor )
252+ BackgroundService .with (taskExecutor )
253253 .forFirst (task .getParams ().getChargePointSelectList ())
254254 .execute (c -> invoker .unlockConnector (c , task ));
255255
@@ -269,7 +269,7 @@ public final int dataTransfer(DataTransferParams params,
269269 task .addCallback (callback );
270270 }
271271
272- BackgroundService .with (asyncTaskExecutor )
272+ BackgroundService .with (taskExecutor )
273273 .forEach (task .getParams ().getChargePointSelectList ())
274274 .execute (c -> invoker .dataTransfer (c , task ));
275275
@@ -285,7 +285,7 @@ public final int getConfiguration(GetConfigurationParams params,
285285 task .addCallback (callback );
286286 }
287287
288- BackgroundService .with (asyncTaskExecutor )
288+ BackgroundService .with (taskExecutor )
289289 .forEach (task .getParams ().getChargePointSelectList ())
290290 .execute (c -> invoker .getConfiguration (c , task ));
291291
@@ -301,7 +301,7 @@ public final int getLocalListVersion(MultipleChargePointSelect params,
301301 task .addCallback (callback );
302302 }
303303
304- BackgroundService .with (asyncTaskExecutor )
304+ BackgroundService .with (taskExecutor )
305305 .forEach (task .getParams ().getChargePointSelectList ())
306306 .execute (c -> invoker .getLocalListVersion (c , task ));
307307
@@ -317,7 +317,7 @@ public final int sendLocalList(SendLocalListParams params,
317317 task .addCallback (callback );
318318 }
319319
320- BackgroundService .with (asyncTaskExecutor )
320+ BackgroundService .with (taskExecutor )
321321 .forEach (task .getParams ().getChargePointSelectList ())
322322 .execute (c -> invoker .sendLocalList (c , task ));
323323
@@ -351,7 +351,7 @@ public final int reserveNow(ReserveNowParams params,
351351 task .addCallback (callback );
352352 }
353353
354- BackgroundService .with (asyncTaskExecutor )
354+ BackgroundService .with (taskExecutor )
355355 .forFirst (task .getParams ().getChargePointSelectList ())
356356 .execute (c -> invoker .reserveNow (c , task ));
357357
@@ -367,7 +367,7 @@ public final int cancelReservation(CancelReservationParams params,
367367 task .addCallback (callback );
368368 }
369369
370- BackgroundService .with (asyncTaskExecutor )
370+ BackgroundService .with (taskExecutor )
371371 .forFirst (task .getParams ().getChargePointSelectList ())
372372 .execute (c -> invoker .cancelReservation (c , task ));
373373
@@ -387,7 +387,7 @@ public final int triggerMessage(TriggerMessageParams params,
387387 task .addCallback (callback );
388388 }
389389
390- BackgroundService .with (asyncTaskExecutor )
390+ BackgroundService .with (taskExecutor )
391391 .forEach (task .getParams ().getChargePointSelectList ())
392392 .execute (c -> invoker .triggerMessage (c , task ));
393393
@@ -401,7 +401,7 @@ public final int setChargingProfile(SetChargingProfileTask task,
401401 task .addCallback (callback );
402402 }
403403
404- BackgroundService .with (asyncTaskExecutor )
404+ BackgroundService .with (taskExecutor )
405405 .forEach (task .getParams ().getChargePointSelectList ())
406406 .execute (c -> invoker .setChargingProfile (c , task ));
407407
@@ -427,7 +427,7 @@ public final int clearChargingProfile(ClearChargingProfileParams params,
427427 task .addCallback (callback );
428428 }
429429
430- BackgroundService .with (asyncTaskExecutor )
430+ BackgroundService .with (taskExecutor )
431431 .forEach (task .getParams ().getChargePointSelectList ())
432432 .execute (c -> invoker .clearChargingProfile (c , task ));
433433
@@ -443,7 +443,7 @@ public final int getCompositeSchedule(GetCompositeScheduleParams params,
443443 task .addCallback (callback );
444444 }
445445
446- BackgroundService .with (asyncTaskExecutor )
446+ BackgroundService .with (taskExecutor )
447447 .forEach (task .getParams ().getChargePointSelectList ())
448448 .execute (c -> invoker .getCompositeSchedule (c , task ));
449449
0 commit comments