Search in sources :

Example 1 with FindEventsAsyncResponse

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

the class AbstractFindEventsReads method receivingAFindEventsRequest.

public void receivingAFindEventsRequest(final Map<String, String> requestData) throws Throwable {
    final Map<String, String> settings = new HashMap<>();
    settings.put(PlatformSmartmeteringKeys.EVENT_TYPE, this.getEventLogCategory());
    settings.put(PlatformSmartmeteringKeys.KEY_BEGIN_DATE, requestData.get(PlatformSmartmeteringKeys.KEY_BEGIN_DATE));
    settings.put(PlatformSmartmeteringKeys.KEY_END_DATE, requestData.get(PlatformSmartmeteringKeys.KEY_END_DATE));
    settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION));
    final FindEventsRequest findEventsRequest = FindEventsRequestFactory.fromParameterMap(settings);
    final FindEventsAsyncResponse findEventsAsyncResponse = this.smartMeteringManagementRequestClient.doRequest(findEventsRequest);
    assertThat(findEventsAsyncResponse).as("AsyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, findEventsAsyncResponse.getCorrelationUid());
}
Also used : FindEventsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsRequest) HashMap(java.util.HashMap) FindEventsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsAsyncResponse)

Example 2 with FindEventsAsyncResponse

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

the class SmartMeteringManagementEndpoint method findEventsRequest.

@PayloadRoot(localPart = "FindEventsRequest", namespace = NAMESPACE)
@ResponsePayload
public FindEventsAsyncResponse findEventsRequest(@OrganisationIdentification final String organisationIdentification, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @RequestPayload final FindEventsRequest request, @BypassRetry final String bypassRetry) throws OsgpException {
    final List<org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FindEventsRequestData> findEventsQueryList = this.managementMapper.mapAsList(request.getFindEventsRequestData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FindEventsRequestData.class);
    this.validateFindEventsQueries(findEventsQueryList);
    final FindEventsRequestDataList requestData = new FindEventsRequestDataList(findEventsQueryList);
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.FIND_EVENTS).withMessageType(MessageType.FIND_EVENTS).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, FindEventsAsyncResponse.class);
}
Also used : FindEventsRequestDataList(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FindEventsRequestDataList) 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)

Aggregations

FindEventsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsAsyncResponse)2 HashMap (java.util.HashMap)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 FindEventsRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsRequest)1 FindMessageLogsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse)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 FindEventsRequestDataList (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FindEventsRequestDataList)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1