use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getFirmwareVersion.
/**
* Starts the proces of retrieving the firmware version(s) of the device specified in the {@link
* GetFirmwareVersionRequest}
*
* @param organisationIdentification {@link String} containing the identification of the
* organization
* @param request the {@link GetFirmwareVersionRequest}
* @param messagePriority the message priority
* @param scheduleTime the time the message is scheduled
* @return the {@link GetFirmwareVersionAsyncResponse} containing the correlation id
* @throws OsgpException
*/
@PayloadRoot(localPart = "GetFirmwareVersionRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetFirmwareVersionAsyncResponse getFirmwareVersion(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetFirmwareVersionRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_FIRMWARE_VERSION).withMessageType(MessageType.GET_FIRMWARE_VERSION).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, new GetFirmwareVersionQuery());
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, GetFirmwareVersionAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionAsyncResponse in project open-smart-grid-platform by OSGP.
the class GetFirmwareVersion method theGetFirmwareVersionRequestIsReceived.
@When("^the get firmware version request is received$")
public void theGetFirmwareVersionRequestIsReceived(final Map<String, String> requestData) throws Throwable {
final GetFirmwareVersionRequest getFirmwareVersionRequest = GetFirmwareVersionRequestFactory.fromParameterMap(requestData);
final GetFirmwareVersionAsyncResponse getFirmwareVersionAsyncResponse = this.smartMeteringConfigurationClient.getFirmwareVersion(getFirmwareVersionRequest);
assertThat(getFirmwareVersionAsyncResponse).as("Get firmware version asyncResponse should not be null").isNotNull();
log.info("Get firmware version asyncResponse is received {}", getFirmwareVersionAsyncResponse);
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, getFirmwareVersionAsyncResponse.getCorrelationUid());
}
Aggregations