use of com.sequenceiq.cloudbreak.cloud.model.CloudEncryptionKeys in project cloudbreak by hortonworks.
the class GetPlatformEncryptionKeysHandler method accept.
@Override
public void accept(Event<GetPlatformEncryptionKeysRequest> getPlatformEncryptionKeysRequest) {
LOGGER.debug("Received event: {}", getPlatformEncryptionKeysRequest);
GetPlatformEncryptionKeysRequest request = getPlatformEncryptionKeysRequest.getData();
try {
CloudPlatformVariant cloudPlatformVariant = new CloudPlatformVariant(Platform.platform(request.getExtendedCloudCredential().getCloudPlatform()), Variant.variant(request.getVariant()));
CloudEncryptionKeys encryptionKeys = cloudPlatformConnectors.get(cloudPlatformVariant).platformResources().encryptionKeys(request.getExtendedCloudCredential(), Region.region(request.getRegion()), request.getFilters());
GetPlatformEncryptionKeysResult getPlatformEncryptionKeysResult = new GetPlatformEncryptionKeysResult(request.getResourceId(), encryptionKeys);
request.getResult().onNext(getPlatformEncryptionKeysResult);
LOGGER.debug("Query platform encryption keys types finished.");
} catch (Exception e) {
request.getResult().onNext(new GetPlatformEncryptionKeysResult(e.getMessage(), e, request.getResourceId()));
}
}
Aggregations