use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetRandomisationSettingsRequestData in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setRandomisationSettings.
@PayloadRoot(localPart = "SetRandomisationSettingsRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetRandomisationSettingsAsyncResponse setRandomisationSettings(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetRandomisationSettingsRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final SetRandomisationSettingsRequestData dataRequest = this.configurationMapper.map(request.getSetRandomisationSettingsData(), SetRandomisationSettingsRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_RANDOMISATION_SETTINGS).withMessageType(MessageType.SET_RANDOMISATION_SETTINGS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, dataRequest);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetRandomisationSettingsAsyncResponse.class);
}
Aggregations