use of com.sequenceiq.cloudbreak.cloud.PlatformParameters in project cloudbreak by hortonworks.
the class PlatformParametersHandler method accept.
@Override
public void accept(Event<PlatformParametersRequest> platformParameterRequestEvent) {
LOGGER.info("Received event: {}", platformParameterRequestEvent);
PlatformParametersRequest request = platformParameterRequestEvent.getData();
Map<Platform, PlatformParameters> platformParameters = new HashMap<>();
try {
for (Entry<Platform, Collection<Variant>> connector : cloudPlatformConnectors.getPlatformVariants().getPlatformToVariants().entrySet()) {
platformParameters.put(connector.getKey(), cloudPlatformConnectors.getDefault(connector.getKey()).parameters());
}
PlatformParametersResult platformParameterResult = new PlatformParametersResult(request, platformParameters);
request.getResult().onNext(platformParameterResult);
LOGGER.info("Query platform parameters finished.");
} catch (RuntimeException e) {
request.getResult().onNext(new PlatformParametersResult(e.getMessage(), e, request));
}
}
Aggregations