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