use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ConfigureDefinableLoadProfileAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method configureDefinableLoadProfile.
@PayloadRoot(localPart = "ConfigureDefinableLoadProfileRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public ConfigureDefinableLoadProfileAsyncResponse configureDefinableLoadProfile(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ConfigureDefinableLoadProfileRequest 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.DefinableLoadProfileConfigurationData definableLoadProfileConfiguration = this.configurationMapper.map(request.getDefinableLoadProfileConfigurationData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.CONFIGURE_DEFINABLE_LOAD_PROFILE).withMessageType(MessageType.CONFIGURE_DEFINABLE_LOAD_PROFILE).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, definableLoadProfileConfiguration);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, ConfigureDefinableLoadProfileAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ConfigureDefinableLoadProfileAsyncResponse in project open-smart-grid-platform by OSGP.
the class ConfigureDefinableLoadProfileSteps method aConfigureDefinableLoadProfileRequestIsReceived.
@When("^a Configure Definable Load Profile request is received$")
public void aConfigureDefinableLoadProfileRequestIsReceived(final Map<String, String> settings) throws Throwable {
final ConfigureDefinableLoadProfileRequest request = ConfigureDefinableLoadProfileRequestFactory.fromParameterMap(settings);
final ConfigureDefinableLoadProfileAsyncResponse asyncResponse = this.client.configureDefinableLoadProfile(request);
assertThat(asyncResponse).isNotNull();
ScenarioContextHelper.saveAsyncResponse(asyncResponse);
}
Aggregations