@Test public void dataTransferAcceptedVerifyResponse() throws InterruptedException, ExecutionException { prepareDataTransfer(IncomingDataTransferResultStatus.ACCEPTED); DataTransferRequest request = new DataTransferRequest(); DataTransferResponse response = motownCentralSystemService.dataTransfer(request, CHARGING_STATION_ID.getId()); assertEquals(DataTransferStatus.ACCEPTED, response.getStatus()); }
@Override public DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity) { final DataTransferFutureEventCallback future = new DataTransferFutureEventCallback(); final ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); FutureRequestHandler<DataTransferResponse, IncomingDataTransferResult> handler = new FutureRequestHandler<>(context.getMessageContext(), continuationTimeout); return handler.handle(future, new CallInitiator() { @Override public void initiateCall() { domainService.incomingDataTransfer(chargingStationId, request.getData(), request.getVendorId(), request.getMessageId(), future, addOnIdentity); } }, new IncomingDataTransferResponseFactory(), new ResponseFactory<DataTransferResponse>() { @Override public DataTransferResponse createResponse() { LOG.error("Error while io.motown.configuration.simple.handling incoming 'data transfer' request, returning rejected"); DataTransferResponse response = new DataTransferResponse(); response.setStatus(DataTransferStatus.REJECTED); return response; } }); }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity) { final DataTransferFutureEventCallback future = new DataTransferFutureEventCallback(); final ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); FutureRequestHandler<DataTransferResponse, IncomingDataTransferResult> handler = new FutureRequestHandler<>(context.getMessageContext(), continuationTimeout); return handler.handle(future, new CallInitiator() { @Override public void initiateCall() { domainService.incomingDataTransfer(chargingStationId, request.getData(), request.getVendorId(), request.getMessageId(), future, addOnIdentity); } }, new IncomingDataTransferResponseFactory(), new ResponseFactory<DataTransferResponse>() { @Override public DataTransferResponse createResponse() { LOG.error("Error while io.motown.configuration.simple.handling incoming 'data transfer' request, returning rejected"); DataTransferResponse response = new DataTransferResponse(); response.setStatus(DataTransferStatus.REJECTED); return response; } }); } }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity) { final DataTransferFutureEventCallback future = new DataTransferFutureEventCallback(); final ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); FutureRequestHandler<DataTransferResponse, IncomingDataTransferResult> handler = new FutureRequestHandler<>(context.getMessageContext(), continuationTimeout); return handler.handle(future, new CallInitiator() { @Override public void initiateCall() { domainService.incomingDataTransfer(chargingStationId, request.getData(), request.getVendorId(), request.getMessageId(), future, addOnIdentity); } }, new IncomingDataTransferResponseFactory(), new ResponseFactory<DataTransferResponse>() { @Override public DataTransferResponse createResponse() { LOG.error("Error while io.motown.configuration.simple.handling incoming 'data transfer' request, returning rejected"); DataTransferResponse response = new DataTransferResponse(); response.setStatus(DataTransferStatus.REJECTED); return response; } }); }  }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity) { final DataTransferFutureEventCallback future = new DataTransferFutureEventCallback(); final ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); FutureRequestHandler<DataTransferResponse, IncomingDataTransferResult> handler = new FutureRequestHandler<>(context.getMessageContext(), continuationTimeout); return handler.handle(future, new CallInitiator() { @Override public void initiateCall() { domainService.incomingDataTransfer(chargingStationId, request.getData(), request.getVendorId(), request.getMessageId(), future, addOnIdentity); } }, new IncomingDataTransferResponseFactory(), new ResponseFactory<DataTransferResponse>() { @Override public DataTransferResponse createResponse() { LOG.error("Error while io.motown.configuration.simple.handling incoming 'data transfer' request, returning rejected"); DataTransferResponse response = new DataTransferResponse(); response.setStatus(DataTransferStatus.REJECTED); return response; } }); }  @Override DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity); @Override StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity); @Override StopTransactionResponse stopTransaction(StopTransactionRequest request, String chargeBoxIdentity); @Override BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity); @Override HeartbeatResponse heartbeat(HeartbeatRequest parameters, String chargeBoxIdentity); @Override MeterValuesResponse meterValues(MeterValuesRequest request, String chargeBoxIdentity); @Override DiagnosticsStatusNotificationResponse diagnosticsStatusNotification(DiagnosticsStatusNotificationRequest request, String chargeBoxIdentity); @Override AuthorizeResponse authorize(final AuthorizeRequest request, final String chargeBoxIdentity); @Override FirmwareStatusNotificationResponse firmwareStatusNotification(FirmwareStatusNotificationRequest request, String chargeBoxIdentity); @Override StartTransactionResponse startTransaction(final StartTransactionRequest parameters, final String chargeBoxIdentity); void setDomainService(DomainService domainService); void setContext(WebServiceContext context); void setContinuationTimeout(int continuationTimeout); void setHeartbeatIntervalFallback(int heartbeatIntervalFallback); void setSoapHeaderReader(SoapHeaderReader soapHeaderReader); void setAddOnId(String id); }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity) { final DataTransferFutureEventCallback future = new DataTransferFutureEventCallback(); final ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); FutureRequestHandler<DataTransferResponse, IncomingDataTransferResult> handler = new FutureRequestHandler<>(context.getMessageContext(), continuationTimeout); return handler.handle(future, new CallInitiator() { @Override public void initiateCall() { domainService.incomingDataTransfer(chargingStationId, request.getData(), request.getVendorId(), request.getMessageId(), future, addOnIdentity); } }, new IncomingDataTransferResponseFactory(), new ResponseFactory<DataTransferResponse>() { @Override public DataTransferResponse createResponse() { LOG.error("Error while io.motown.configuration.simple.handling incoming 'data transfer' request, returning rejected"); DataTransferResponse response = new DataTransferResponse(); response.setStatus(DataTransferStatus.REJECTED); return response; } }); }  @Override DataTransferResponse dataTransfer(final DataTransferRequest request, final String chargeBoxIdentity); @Override StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity); @Override StopTransactionResponse stopTransaction(StopTransactionRequest request, String chargeBoxIdentity); @Override BootNotificationResponse bootNotification(BootNotificationRequest request, String chargeBoxIdentity); @Override HeartbeatResponse heartbeat(HeartbeatRequest parameters, String chargeBoxIdentity); @Override MeterValuesResponse meterValues(MeterValuesRequest request, String chargeBoxIdentity); @Override DiagnosticsStatusNotificationResponse diagnosticsStatusNotification(DiagnosticsStatusNotificationRequest request, String chargeBoxIdentity); @Override AuthorizeResponse authorize(final AuthorizeRequest request, final String chargeBoxIdentity); @Override FirmwareStatusNotificationResponse firmwareStatusNotification(FirmwareStatusNotificationRequest request, String chargeBoxIdentity); @Override StartTransactionResponse startTransaction(final StartTransactionRequest parameters, final String chargeBoxIdentity); void setDomainService(DomainService domainService); void setContext(WebServiceContext context); void setContinuationTimeout(int continuationTimeout); void setHeartbeatIntervalFallback(int heartbeatIntervalFallback); void setSoapHeaderReader(SoapHeaderReader soapHeaderReader); void setAddOnId(String id); static final String ADD_ON_TYPE; }