use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse in project open-smart-grid-platform by OSGP.
the class ReplaceKeysSteps method multipleGenerateAndReplaceKeysRequestsAreReceived.
@When("multiple generate and replace keys requests are received")
public void multipleGenerateAndReplaceKeysRequestsAreReceived(final Map<String, String> settings) throws Throwable {
final List<Map<String, String>> listOfSettingsPerRequest = this.createSettingPerRequest(settings);
final List<String> correlationUIDs = new ArrayList<>();
for (final Map<String, String> settingsPerRequest : listOfSettingsPerRequest) {
final GenerateAndReplaceKeysRequest request = GenerateAndReplaceKeysRequestFactory.fromParameterMap(settingsPerRequest);
final GenerateAndReplaceKeysAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.generateAndReplaceKeys(request);
correlationUIDs.add(asyncResponse.getCorrelationUid());
}
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, correlationUIDs);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method generateAndReplaceKeys.
@PayloadRoot(localPart = "GenerateAndReplaceKeysRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GenerateAndReplaceKeysAsyncResponse generateAndReplaceKeys(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GenerateAndReplaceKeysRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GENERATE_AND_REPLACE_KEYS).withMessageType(MessageType.GENERATE_AND_REPLACE_KEYS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, null);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, GenerateAndReplaceKeysAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse in project open-smart-grid-platform by OSGP.
the class ReplaceKeysSteps method theGenerateAndReplaceKeysRequestIsReceived.
@When("^the generate and replace keys request is received$")
public void theGenerateAndReplaceKeysRequestIsReceived(final Map<String, String> settings) throws Throwable {
ScenarioContext.current().put(PlatformKeys.KEY_DEVICE_IDENTIFICATION, settings.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
final GenerateAndReplaceKeysRequest request = GenerateAndReplaceKeysRequestFactory.fromParameterMap(settings);
final GenerateAndReplaceKeysAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.generateAndReplaceKeys(request);
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Aggregations