use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetActivityCalendarAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetActivityCalendar method theSetActivityCalendarRequestIsReceived.
@When("^the set activity calendar request is received$")
public void theSetActivityCalendarRequestIsReceived(final Map<String, String> requestData) throws Throwable {
final SetActivityCalendarRequest setActivityCalendarRequest = SetActivityCalendarRequestFactory.fromParameterMap(requestData);
final SetActivityCalendarAsyncResponse setActivityCalendarAsyncResponse = this.smartMeteringConfigurationClient.setActivityCalendar(setActivityCalendarRequest);
LOGGER.info("Set activity calendar asyncResponse is received {}", setActivityCalendarAsyncResponse);
assertThat(setActivityCalendarAsyncResponse).as("Set activity calendar asyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setActivityCalendarAsyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetActivityCalendarAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setActivityCalendar.
@PayloadRoot(localPart = "SetActivityCalendarRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetActivityCalendarAsyncResponse setActivityCalendar(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetActivityCalendarRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final ActivityCalendar activityCalendar = this.configurationMapper.map(request.getActivityCalendarData().getActivityCalendar(), ActivityCalendar.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_ACTIVITY_CALENDAR).withMessageType(MessageType.SET_ACTIVITY_CALENDAR).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, activityCalendar);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetActivityCalendarAsyncResponse.class);
}
Aggregations