use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SynchronizeTimeAsyncResponse in project open-smart-grid-platform by OSGP.
the class SynchronizeTime method receivingAGetSynchronizeTimeRequest.
@When("^receiving a get synchronize time request$")
public void receivingAGetSynchronizeTimeRequest(final Map<String, String> settings) throws Throwable {
final SynchronizeTimeRequest request = SynchronizeTimeRequestFactory.fromParameterMap(settings);
final SynchronizeTimeAsyncResponse asyncResponse = this.requestClient.doRequest(request);
assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SynchronizeTimeAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringAdhocEndpoint method synchronizeTime.
@PayloadRoot(localPart = "SynchronizeTimeRequest", namespace = SMARTMETER_ADHOC_NAMESPACE)
@ResponsePayload
public SynchronizeTimeAsyncResponse synchronizeTime(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SynchronizeTimeRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SynchronizeTimeRequestData synchronizeTimeRequestData = this.adhocMapper.map(request.getSynchronizeTimeRequestData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SynchronizeTimeRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SYNCHRONIZE_TIME).withMessageType(MessageType.SYNCHRONIZE_TIME).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, synchronizeTimeRequestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.adhocMapper.map(asyncResponse, SynchronizeTimeAsyncResponse.class);
}
Aggregations