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);
}
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());
}
Aggregations