use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetRandomisationSettingsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetRandomisationSettings method theSetRandomisationSettingsRequestIsReceived.
@When("the set randomisation settings request is received")
public void theSetRandomisationSettingsRequestIsReceived(final Map<String, String> parameters) throws WebServiceSecurityException {
final SetRandomisationSettingsRequest request = SetRandomisationSettingsFactory.fromParameterMap(parameters);
final SetRandomisationSettingsAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.setRandomisationSettings(request);
assertThat(asyncResponse).isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetRandomisationSettingsAsyncResponse 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