|
|
|
@ -15,6 +15,7 @@ import eu.chargetime.ocpp.model.core.StartTransactionConfirmation; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.UUID; |
|
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
@ -55,9 +56,12 @@ public class TransactionService { |
|
|
|
|
var identity = sessionService.getIdentityBySessionId(sessionIndex); |
|
|
|
|
log.info("Try to stop transaction for {}, with id {}", identity, transactionId); |
|
|
|
|
|
|
|
|
|
if (Objects.nonNull(identity)) { |
|
|
|
|
transactionMap.remove(identity); |
|
|
|
|
} |
|
|
|
|
Optional.ofNullable(identity) |
|
|
|
|
.map(transactionMap::remove) |
|
|
|
|
.filter(Objects::nonNull) |
|
|
|
|
.ifPresentOrElse( |
|
|
|
|
(id) -> log.info("Transaction id {} removed ({} requested)", id, transactionId), |
|
|
|
|
() -> log.info("Nothing to remove for {}", transactionId)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public RemoteStartTransactionConfirmation remoteStart(String id, Integer connectorId) { |
|
|
|
|