@Test(expected = IllegalStateException.class) public void testStartTransactionUnconfiguredChargingStation() { ChargingStation cs = new ChargingStation(CHARGING_STATION_ID.getId()); cs.setRegistered(true); chargingStationRepository.createOrUpdate(cs); domainService.startTransaction(CHARGING_STATION_ID, EVSE_ID, IDENTIFYING_TOKEN, mock(FutureEventCallback.class), ADD_ON_IDENTITY); }
public void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback, AddOnIdentity addOnIdentity) { ChargingStation chargingStation = this.checkChargingStationExistsAndIsRegisteredAndConfigured(chargingStationId); if (evseId.getNumberedId() > chargingStation.getNumberOfEvses()) { throw new IllegalStateException("Cannot start transaction on a unknown evse."); } authorize(chargingStationId, idTag.getToken(), futureEventCallback, addOnIdentity); }
DomainService { public void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback, AddOnIdentity addOnIdentity) { ChargingStation chargingStation = this.checkChargingStationExistsAndIsRegisteredAndConfigured(chargingStationId); if (evseId.getNumberedId() > chargingStation.getNumberOfEvses()) { throw new IllegalStateException("Cannot start transaction on a unknown evse."); } authorize(chargingStationId, idTag.getToken(), futureEventCallback, addOnIdentity); } }
DomainService { public void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback, AddOnIdentity addOnIdentity) { ChargingStation chargingStation = this.checkChargingStationExistsAndIsRegisteredAndConfigured(chargingStationId); if (evseId.getNumberedId() > chargingStation.getNumberOfEvses()) { throw new IllegalStateException("Cannot start transaction on a unknown evse."); } authorize(chargingStationId, idTag.getToken(), futureEventCallback, addOnIdentity); }  }
DomainService { public void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback, AddOnIdentity addOnIdentity) { ChargingStation chargingStation = this.checkChargingStationExistsAndIsRegisteredAndConfigured(chargingStationId); if (evseId.getNumberedId() > chargingStation.getNumberOfEvses()) { throw new IllegalStateException("Cannot start transaction on a unknown evse."); } authorize(chargingStationId, idTag.getToken(), futureEventCallback, addOnIdentity); }  BootChargingStationResult bootChargingStation(ChargingStationId chargingStationId, String protocol,
                                                         AttributeMap<String, String> attributes, AddOnIdentity addOnIdentity); void incomingDataTransfer(ChargingStationId chargingStationId, String data, String vendorId, String messageId, FutureEventCallback future, AddOnIdentity addOnIdentity); void heartbeat(ChargingStationId chargingStationId, AddOnIdentity addOnIdentity); void meterValues(ChargingStationId chargingStationId, TransactionId transactionId, EvseId evseId, List<MeterValue> meterValues, AddOnIdentity addOnIdentity); void diagnosticsFileNameReceived(ChargingStationId chargingStationId, String diagnosticsFileName, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void authorizationListVersionReceived(ChargingStationId chargingStationId, int currentVersion, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void authorize(ChargingStationId chargingStationId, String idTag, FutureEventCallback future, AddOnIdentity addOnIdentity); void receiveConfigurationItems(ChargingStationId chargingStationId, Set<ConfigurationItem> configurationItems, Set<String> requestedKeys, AddOnIdentity addOnIdentity); void diagnosticsUploadStatusUpdate(ChargingStationId chargingStationId, boolean diagnosticsUploaded, AddOnIdentity addOnIdentity); void firmwareStatusUpdate(ChargingStationId chargingStationId, FirmwareStatus firmwareStatus, AddOnIdentity addOnIdentity); void statusNotification(ChargingStationId chargingStationId, EvseId evseId, StatusNotification statusNotification, AddOnIdentity addOnIdentity); void startTransactionNoAuthorize(ChargingStationId chargingStationId, TransactionId transactionId,
                                            StartTransactionInfo startTransactionInfo, AddOnIdentity addOnIdentity); void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback,
                                 AddOnIdentity addOnIdentity); void stopTransaction(ChargingStationId chargingStationId, NumberedTransactionId transactionId, IdentifyingToken idTag, int meterValueStop, Date timeStamp,
                                List<MeterValue> meterValues, AddOnIdentity addOnIdentity); void informRequestStartTransactionAccepted(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken identifyingToken, IdentityContext identityContext, CorrelationToken correlationToken); void informRequestStartTransactionRejected(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken identifyingToken, IdentityContext identityContext, CorrelationToken correlationToken); void informRequestStopTransactionAccepted(ChargingStationId chargingStationId, TransactionId transactionId, IdentityContext identityContext, CorrelationToken correlationToken); void informRequestStopTransactionRejected(ChargingStationId chargingStationId, TransactionId transactionId, IdentityContext identityContext, CorrelationToken correlationToken); void informReserved(ChargingStationId chargingStationId, ReservationId reservationId, EvseId evseId, Date expiryDate, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informReservationFaulted(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informReservationRejected(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informChargingStationUnavailable(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informChargingStationOccupied(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informReservationCancelled(ChargingStationId chargingStationId, ReservationId reservationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informCacheCleared(ChargingStationId chargingStationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeComponentAvailabilityToOperative(ChargingStationId chargingStationId, ComponentId componentId, ChargingStationComponent component, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeComponentAvailabilityToInoperative(ChargingStationId chargingStationId, ComponentId componentId, ChargingStationComponent component, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeChargingStationAvailabilityToOperative(ChargingStationId chargingStationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeChargingStationAvailabilityToInoperative(ChargingStationId chargingStationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeConfiguration(ChargingStationId chargingStationId, ConfigurationItem configurationItem, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informDataTransferResponse(ChargingStationId chargingStationId, String data, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informUnlockEvse(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void authorizationListChange(ChargingStationId chargingStationId, int version, AuthorizationListUpdateType updateType, Set<IdentifyingToken> identifyingTokens, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void setCommandGateway(DomainCommandGateway commandGateway); void setEventWaitingGateway(EventWaitingGateway eventWaitingGateway); void setChargingStationRepository(ChargingStationRepository chargingStationRepository); void setTransactionRepository(TransactionRepository transactionRepository); void setReservationIdentifierRepository(ReservationIdentifierRepository reservationIdentifierRepository); void setEntityManagerFactory(EntityManagerFactory entityManagerFactory); void setHeartbeatInterval(int heartbeatInterval); void setAuthorizationTimeoutInMillis(long authorizationTimeoutInMillis); void setUserIdentitiesWithAllPermissions(Set<UserIdentity> userIdentitiesWithAllPermissions); String retrieveChargingStationAddress(ChargingStationId id); NumberedReservationId generateReservationIdentifier(ChargingStationId chargingStationId, String protocolIdentifier); Transaction createTransaction(EvseId evseId); }
DomainService { public void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback, AddOnIdentity addOnIdentity) { ChargingStation chargingStation = this.checkChargingStationExistsAndIsRegisteredAndConfigured(chargingStationId); if (evseId.getNumberedId() > chargingStation.getNumberOfEvses()) { throw new IllegalStateException("Cannot start transaction on a unknown evse."); } authorize(chargingStationId, idTag.getToken(), futureEventCallback, addOnIdentity); }  BootChargingStationResult bootChargingStation(ChargingStationId chargingStationId, String protocol,
                                                         AttributeMap<String, String> attributes, AddOnIdentity addOnIdentity); void incomingDataTransfer(ChargingStationId chargingStationId, String data, String vendorId, String messageId, FutureEventCallback future, AddOnIdentity addOnIdentity); void heartbeat(ChargingStationId chargingStationId, AddOnIdentity addOnIdentity); void meterValues(ChargingStationId chargingStationId, TransactionId transactionId, EvseId evseId, List<MeterValue> meterValues, AddOnIdentity addOnIdentity); void diagnosticsFileNameReceived(ChargingStationId chargingStationId, String diagnosticsFileName, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void authorizationListVersionReceived(ChargingStationId chargingStationId, int currentVersion, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void authorize(ChargingStationId chargingStationId, String idTag, FutureEventCallback future, AddOnIdentity addOnIdentity); void receiveConfigurationItems(ChargingStationId chargingStationId, Set<ConfigurationItem> configurationItems, Set<String> requestedKeys, AddOnIdentity addOnIdentity); void diagnosticsUploadStatusUpdate(ChargingStationId chargingStationId, boolean diagnosticsUploaded, AddOnIdentity addOnIdentity); void firmwareStatusUpdate(ChargingStationId chargingStationId, FirmwareStatus firmwareStatus, AddOnIdentity addOnIdentity); void statusNotification(ChargingStationId chargingStationId, EvseId evseId, StatusNotification statusNotification, AddOnIdentity addOnIdentity); void startTransactionNoAuthorize(ChargingStationId chargingStationId, TransactionId transactionId,
                                            StartTransactionInfo startTransactionInfo, AddOnIdentity addOnIdentity); void startTransaction(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken idTag, FutureEventCallback futureEventCallback,
                                 AddOnIdentity addOnIdentity); void stopTransaction(ChargingStationId chargingStationId, NumberedTransactionId transactionId, IdentifyingToken idTag, int meterValueStop, Date timeStamp,
                                List<MeterValue> meterValues, AddOnIdentity addOnIdentity); void informRequestStartTransactionAccepted(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken identifyingToken, IdentityContext identityContext, CorrelationToken correlationToken); void informRequestStartTransactionRejected(ChargingStationId chargingStationId, EvseId evseId, IdentifyingToken identifyingToken, IdentityContext identityContext, CorrelationToken correlationToken); void informRequestStopTransactionAccepted(ChargingStationId chargingStationId, TransactionId transactionId, IdentityContext identityContext, CorrelationToken correlationToken); void informRequestStopTransactionRejected(ChargingStationId chargingStationId, TransactionId transactionId, IdentityContext identityContext, CorrelationToken correlationToken); void informReserved(ChargingStationId chargingStationId, ReservationId reservationId, EvseId evseId, Date expiryDate, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informReservationFaulted(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informReservationRejected(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informChargingStationUnavailable(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informChargingStationOccupied(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informReservationCancelled(ChargingStationId chargingStationId, ReservationId reservationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informCacheCleared(ChargingStationId chargingStationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeComponentAvailabilityToOperative(ChargingStationId chargingStationId, ComponentId componentId, ChargingStationComponent component, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeComponentAvailabilityToInoperative(ChargingStationId chargingStationId, ComponentId componentId, ChargingStationComponent component, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeChargingStationAvailabilityToOperative(ChargingStationId chargingStationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeChargingStationAvailabilityToInoperative(ChargingStationId chargingStationId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void changeConfiguration(ChargingStationId chargingStationId, ConfigurationItem configurationItem, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informDataTransferResponse(ChargingStationId chargingStationId, String data, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void informUnlockEvse(ChargingStationId chargingStationId, EvseId evseId, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void authorizationListChange(ChargingStationId chargingStationId, int version, AuthorizationListUpdateType updateType, Set<IdentifyingToken> identifyingTokens, CorrelationToken correlationToken, AddOnIdentity addOnIdentity); void setCommandGateway(DomainCommandGateway commandGateway); void setEventWaitingGateway(EventWaitingGateway eventWaitingGateway); void setChargingStationRepository(ChargingStationRepository chargingStationRepository); void setTransactionRepository(TransactionRepository transactionRepository); void setReservationIdentifierRepository(ReservationIdentifierRepository reservationIdentifierRepository); void setEntityManagerFactory(EntityManagerFactory entityManagerFactory); void setHeartbeatInterval(int heartbeatInterval); void setAuthorizationTimeoutInMillis(long authorizationTimeoutInMillis); void setUserIdentitiesWithAllPermissions(Set<UserIdentity> userIdentitiesWithAllPermissions); String retrieveChargingStationAddress(ChargingStationId id); NumberedReservationId generateReservationIdentifier(ChargingStationId chargingStationId, String protocolIdentifier); Transaction createTransaction(EvseId evseId); static final int CHARGING_STATION_EVSE_ID; static final String ERROR_CODE_KEY; static final String INFO_KEY; static final String VENDOR_ID_KEY; static final String VENDOR_ERROR_CODE_KEY; }