@Test public void statusNotificationVerifyServiceCall() { StatusNotificationRequest request = new StatusNotificationRequest(); request.setStatus(ChargePointStatus.FAULTED); request.setVendorId(CHARGING_STATION_VENDOR); request.setConnectorId(EVSE_ID.getNumberedId()); request.setErrorCode(ChargePointErrorCode.GROUND_FAILURE); request.setInfo(STATUS_NOTIFICATION_ERROR_INFO); request.setTimestamp(FIVE_MINUTES_AGO); request.setVendorErrorCode(STATUS_NOTIFICATION_VENDOR_ERROR_CODE); motownCentralSystemService.statusNotification(request, CHARGING_STATION_ID.getId()); AttributeMap<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_ERROR_CODE_KEY, ChargePointErrorCode.GROUND_FAILURE.value()). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_INFO_KEY, STATUS_NOTIFICATION_ERROR_INFO). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, CHARGING_STATION_VENDOR). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_VENDOR_ERROR_CODE_KEY, STATUS_NOTIFICATION_VENDOR_ERROR_CODE); verify(domainService).statusNotification(CHARGING_STATION_ID, EVSE_ID, new StatusNotification(ComponentStatus.FAULTED, FIVE_MINUTES_AGO, attributes), OCPPS15_ADD_ON_IDENTITY); }
@Override public StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); EvseId evseId = new EvseId(request.getConnectorId()); ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus()); String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null; Date timestamp = request.getTimestamp(); if (timestamp == null) { timestamp = new Date(); } Map<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_ERROR_CODE_KEY, errorCode). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_INFO_KEY, request.getInfo()). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getVendorId()). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_VENDOR_ERROR_CODE_KEY, request.getVendorErrorCode()); domainService.statusNotification(chargingStationId, evseId, new StatusNotification(componentStatus, timestamp, attributes), addOnIdentity); return new StatusNotificationResponse(); }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); EvseId evseId = new EvseId(request.getConnectorId()); ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus()); String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null; Date timestamp = request.getTimestamp(); if (timestamp == null) { timestamp = new Date(); } Map<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_ERROR_CODE_KEY, errorCode). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_INFO_KEY, request.getInfo()). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getVendorId()). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_VENDOR_ERROR_CODE_KEY, request.getVendorErrorCode()); domainService.statusNotification(chargingStationId, evseId, new StatusNotification(componentStatus, timestamp, attributes), addOnIdentity); return new StatusNotificationResponse(); } }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); EvseId evseId = new EvseId(request.getConnectorId()); ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus()); String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null; Date timestamp = request.getTimestamp(); if (timestamp == null) { timestamp = new Date(); } Map<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_ERROR_CODE_KEY, errorCode). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_INFO_KEY, request.getInfo()). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getVendorId()). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_VENDOR_ERROR_CODE_KEY, request.getVendorErrorCode()); domainService.statusNotification(chargingStationId, evseId, new StatusNotification(componentStatus, timestamp, attributes), addOnIdentity); return new StatusNotificationResponse(); }  }
MotownCentralSystemService implements io.motown.ocpp.v15.soap.centralsystem.schema.CentralSystemService { @Override public StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); EvseId evseId = new EvseId(request.getConnectorId()); ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus()); String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null; Date timestamp = request.getTimestamp(); if (timestamp == null) { timestamp = new Date(); } Map<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_ERROR_CODE_KEY, errorCode). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_INFO_KEY, request.getInfo()). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getVendorId()). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_VENDOR_ERROR_CODE_KEY, request.getVendorErrorCode()); domainService.statusNotification(chargingStationId, evseId, new StatusNotification(componentStatus, timestamp, attributes), addOnIdentity); return new StatusNotificationResponse(); }  @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 StatusNotificationResponse statusNotification(StatusNotificationRequest request, String chargeBoxIdentity) { ChargingStationId chargingStationId = new ChargingStationId(chargeBoxIdentity); EvseId evseId = new EvseId(request.getConnectorId()); ComponentStatus componentStatus = getComponentStatusFromChargePointStatus(request.getStatus()); String errorCode = request.getErrorCode() != null ? request.getErrorCode().value() : null; Date timestamp = request.getTimestamp(); if (timestamp == null) { timestamp = new Date(); } Map<String, String> attributes = new AttributeMap<String, String>(). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_ERROR_CODE_KEY, errorCode). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_INFO_KEY, request.getInfo()). putIfValueNotNull(AttributeMapKeys.VENDOR_ID, request.getVendorId()). putIfValueNotNull(AttributeMapKeys.STATUS_NOTIFICATION_VENDOR_ERROR_CODE_KEY, request.getVendorErrorCode()); domainService.statusNotification(chargingStationId, evseId, new StatusNotification(componentStatus, timestamp, attributes), addOnIdentity); return new StatusNotificationResponse(); }  @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; }