Search in sources :

Example 1 with TemplatingDoesNotSupportedException

use of com.sequenceiq.cloudbreak.cloud.exception.TemplatingDoesNotSupportedException in project cloudbreak by hortonworks.

the class TemplateHandler method accept.

@Override
public void accept(Event<GetPlatformTemplateRequest> platformTemplateRequestEvent) {
    LOGGER.info("Received event: {}", platformTemplateRequestEvent);
    GetPlatformTemplateRequest request = platformTemplateRequestEvent.getData();
    String template = null;
    try {
        CloudConnector connector = cloudPlatformConnectors.get(request.getCloudContext().getPlatformVariant());
        if (connector != null) {
            template = connector.resources().getStackTemplate();
        }
    } catch (TemplatingDoesNotSupportedException ignored) {
    }
    GetPlatformTemplateResult getPlatformTemplateResult = new GetPlatformTemplateResult(request, template);
    request.getResult().onNext(getPlatformTemplateResult);
    LOGGER.info("Get template finished.");
}
Also used : GetPlatformTemplateResult(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformTemplateResult) CloudConnector(com.sequenceiq.cloudbreak.cloud.CloudConnector) TemplatingDoesNotSupportedException(com.sequenceiq.cloudbreak.cloud.exception.TemplatingDoesNotSupportedException) GetPlatformTemplateRequest(com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformTemplateRequest)

Aggregations

CloudConnector (com.sequenceiq.cloudbreak.cloud.CloudConnector)1 GetPlatformTemplateRequest (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformTemplateRequest)1 GetPlatformTemplateResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformTemplateResult)1 TemplatingDoesNotSupportedException (com.sequenceiq.cloudbreak.cloud.exception.TemplatingDoesNotSupportedException)1