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