use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetConfigurationObjectAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setConfigurationObject.
@PayloadRoot(localPart = "SetConfigurationObjectRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetConfigurationObjectAsyncResponse setConfigurationObject(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetConfigurationObjectRequest 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.SetConfigurationObjectRequest dataRequest = this.configurationMapper.map(request, org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetConfigurationObjectRequest.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_CONFIGURATION_OBJECT).withMessageType(MessageType.SET_CONFIGURATION_OBJECT).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, SetConfigurationObjectAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetConfigurationObjectAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetConfigurationObject method theSetConfigurationObjectRequestIsReceived.
@When("^the set configuration object request is received$")
public void theSetConfigurationObjectRequestIsReceived(final Map<String, String> requestData) throws Throwable {
final SetConfigurationObjectRequest setConfigurationObjectRequest = SetConfigurationObjectRequestFactory.fromParameterMap(requestData);
final SetConfigurationObjectAsyncResponse setConfigurationObjectAsyncResponse = this.smartMeteringConfigurationClient.setConfigurationObject(setConfigurationObjectRequest);
LOGGER.info("Set configuration object response is received {}", setConfigurationObjectAsyncResponse);
assertThat(setConfigurationObjectAsyncResponse).as("Set configuration object response should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setConfigurationObjectAsyncResponse.getCorrelationUid());
}
Aggregations