use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetClockConfigurationAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetClockConfiguration method theSetClockConfigurationRequestIsReceived.
@When("^the SetClockConfiguration request is received$")
public void theSetClockConfigurationRequestIsReceived(final Map<String, String> settings) throws Throwable {
final SetClockConfigurationRequest request = SetClockConfigurationRequestFactory.fromParameterMap(settings);
final SetClockConfigurationAsyncResponse asyncResponse = this.client.setClockConfiguration(request);
assertThat(asyncResponse).isNotNull();
ScenarioContextHelper.saveAsyncResponse(asyncResponse);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetClockConfigurationAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setClockConfiguration.
@PayloadRoot(localPart = "SetClockConfigurationRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetClockConfigurationAsyncResponse setClockConfiguration(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetClockConfigurationRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetClockConfigurationRequestData clockConfiguration = this.configurationMapper.map(request.getSetClockConfigurationData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetClockConfigurationRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_CLOCK_CONFIGURATION).withMessageType(MessageType.SET_CLOCK_CONFIGURATION).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, clockConfiguration);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetClockConfigurationAsyncResponse.class);
}
Aggregations