use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareAsyncResponse 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);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareAsyncResponse in project open-smart-grid-platform by OSGP.
the class UpdateFirmware method theRequestForAFirmwareUpgradeIsReceived.
@When("^the request for a firmware upgrade is received$")
public void theRequestForAFirmwareUpgradeIsReceived(final Map<String, String> settings) throws Throwable {
final UpdateFirmwareRequest request = UpdateFirmwareRequestFactory.fromParameterMap(settings);
final UpdateFirmwareAsyncResponse asyncResponse = this.client.updateFirmware(request);
assertThat(asyncResponse).as("asyncResponse should not be null").isNotNull();
ScenarioContextHelper.saveAsyncResponse(asyncResponse);
}
Aggregations