use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncResponse in project open-smart-grid-platform by OSGP.
the class GetKeys method aGetKeysRequestIsReceived.
@When("^a get keys request is received$")
public void aGetKeysRequestIsReceived(final Map<String, String> settings) throws Throwable {
final GetKeysRequest request = GetKeysRequestFactory.fromParameterMap(settings);
final GetKeysAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.getKeys(request);
assertThat(asyncResponse).as("getKeysAsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getKeys.
@PayloadRoot(localPart = "GetKeysRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetKeysAsyncResponse getKeys(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetKeysRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final GetKeysRequestData dataRequest = this.configurationMapper.map(request.getGetKeysData(), GetKeysRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_KEYS).withMessageType(MessageType.GET_KEYS).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, GetKeysAsyncResponse.class);
}
Aggregations