use of com.sequenceiq.cloudbreak.cloud.model.Variant in project cloudbreak by hortonworks.
the class CloudPlatformConnectors method cloudPlatformConnectors.
@PostConstruct
public void cloudPlatformConnectors() {
platformToVariants = HashMultimap.create();
for (CloudConnector connector : cloudConnectors) {
map.put(new CloudPlatformVariant(connector.platform(), connector.variant()), connector);
platformToVariants.put(connector.platform(), connector.variant());
}
Map<Platform, Variant> environmentDefaults = extractEnvironmentDefaultVariants();
setupDefaultVariants(platformToVariants, environmentDefaults);
LOGGER.debug(map.toString());
LOGGER.debug(defaultVariants.toString());
}
use of com.sequenceiq.cloudbreak.cloud.model.Variant in project cloudbreak by hortonworks.
the class CheckPlatformVariantHandler method accept.
@Override
public void accept(Event<CheckPlatformVariantRequest> defaultPlatformVariantRequestEvent) {
LOGGER.info("Received event: {}", defaultPlatformVariantRequestEvent);
CheckPlatformVariantRequest request = defaultPlatformVariantRequestEvent.getData();
try {
CloudConnector cc = cloudPlatformConnectors.get(request.getCloudContext().getPlatform(), request.getCloudContext().getVariant());
Variant defaultVariant = cc.variant();
CheckPlatformVariantResult platformParameterResult = new CheckPlatformVariantResult(request, defaultVariant);
request.getResult().onNext(platformParameterResult);
LOGGER.info("Query platform variant finished.");
} catch (RuntimeException e) {
request.getResult().onNext(new CheckPlatformVariantResult(e.getMessage(), e, request));
}
}
Aggregations