Search in sources :

Example 1 with FindMessageLogsAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse in project open-smart-grid-platform by OSGP.

the class SmartMeteringManagementEndpoint method findMessageLogsRequest.

/**
 * Retrieve log messages. Looks like it will be executed asynchronously but actually it is
 * executed synchronously. This was implemented like this to duplicate the behavior of the
 * implementation in ws-admin, but supporting async notifications. Once there is a wider
 * implementation of asynchronous requests and notifications, the ws-admin implementation will
 * replace this one and this method can be removed.
 *
 * @param messagePriority unused because this request fakes asynchronous behavior.
 * @param scheduleTime unused because this request fakes asynchronous behavior.
 * @return AsyncResponse
 * @throws OsgpException
 */
@PayloadRoot(localPart = "FindMessageLogsRequest", namespace = NAMESPACE)
@ResponsePayload
public FindMessageLogsAsyncResponse findMessageLogsRequest(@OrganisationIdentification final String organisationIdentification, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @RequestPayload final FindMessageLogsRequest request, @BypassRetry final String bypassRetry) throws OsgpException {
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_MESSAGES).withMessageType(MessageType.GET_MESSAGES).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
    final AsyncResponse asyncResponse = this.managementService.enqueueAndSendFindLogsRequest(requestMessageMetadata, request.getPage());
    this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
    return this.managementMapper.map(asyncResponse, FindMessageLogsAsyncResponse.class);
}
Also used : EnableDebuggingAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.EnableDebuggingAsyncResponse) FindEventsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsAsyncResponse) SetDeviceCommunicationSettingsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceCommunicationSettingsAsyncResponse) SetDeviceLifecycleStatusByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse) AsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse) DisableDebuggingAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.DisableDebuggingAsyncResponse) GetGsmDiagnosticAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticAsyncResponse) ClearMBusStatusOnAllChannelsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.ClearMBusStatusOnAllChannelsAsyncResponse) FindMessageLogsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 2 with FindMessageLogsAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse in project open-smart-grid-platform by OSGP.

the class GetDebugInformation method theGetDebugInformationRequestIsReceived.

@When("^the get debug information request is received$")
public void theGetDebugInformationRequestIsReceived(final Map<String, String> requestData) throws Throwable {
    final FindMessageLogsRequest findMessageLogsRequest = FindMessageLogsRequestFactory.fromParameterMap(requestData);
    final FindMessageLogsAsyncResponse findMessageLogsAsyncResponse = this.smartMeteringManagementRequestClient.doRequest(findMessageLogsRequest);
    assertThat(findMessageLogsAsyncResponse).as("AsyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, findMessageLogsAsyncResponse.getCorrelationUid());
}
Also used : FindMessageLogsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsRequest) FindMessageLogsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse) When(io.cucumber.java.en.When)

Aggregations

FindMessageLogsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse)2 When (io.cucumber.java.en.When)1 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ClearMBusStatusOnAllChannelsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.ClearMBusStatusOnAllChannelsAsyncResponse)1 DisableDebuggingAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.DisableDebuggingAsyncResponse)1 EnableDebuggingAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.EnableDebuggingAsyncResponse)1 FindEventsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsAsyncResponse)1 FindMessageLogsRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsRequest)1 GetGsmDiagnosticAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticAsyncResponse)1 SetDeviceCommunicationSettingsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceCommunicationSettingsAsyncResponse)1 SetDeviceLifecycleStatusByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1