use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticAsyncResponse in project open-smart-grid-platform by OSGP.
the class GetGsmDiagnostic method aGetGsmDiagnosticRequestIsReceived.
@When("^a get gsm diagnostic request is received$")
public void aGetGsmDiagnosticRequestIsReceived(final Map<String, String> settings) throws Throwable {
final GetGsmDiagnosticRequest request = GetGsmDiagnosticRequestFactory.fromParameterMap(settings);
final GetGsmDiagnosticAsyncResponse asyncResponse = this.smManagementRequestClient.doRequest(request);
assertThat(asyncResponse).as("getGsmDiagnosticAsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringManagementEndpoint method getGsmDiagnostic.
@PayloadRoot(localPart = "GetGsmDiagnosticRequest", namespace = NAMESPACE)
@ResponsePayload
public GetGsmDiagnosticAsyncResponse getGsmDiagnostic(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetGsmDiagnosticRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetGsmDiagnosticRequestData requestData = this.managementMapper.map(request.getGetGsmDiagnosticRequestData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetGsmDiagnosticRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_GSM_DIAGNOSTIC).withMessageType(MessageType.GET_GSM_DIAGNOSTIC).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, requestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.managementMapper.map(asyncResponse, GetGsmDiagnosticAsyncResponse.class);
}
Aggregations