use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareRequestData in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method updateFirmware.
@PayloadRoot(localPart = "UpdateFirmwareRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public UpdateFirmwareAsyncResponse updateFirmware(@OrganisationIdentification final String organisationIdentification, @RequestPayload final UpdateFirmwareRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final UpdateFirmwareRequestData updateFirmwareRequestData = this.configurationMapper.map(request, UpdateFirmwareRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.UPDATE_FIRMWARE).withMessageType(MessageType.UPDATE_FIRMWARE).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, updateFirmwareRequestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, UpdateFirmwareAsyncResponse.class);
}
Aggregations