Search in sources :

Example 1 with ExecutePostClusterManagerStartRecipesFailed

use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.install.ExecutePostClusterManagerStartRecipesFailed in project cloudbreak by hortonworks.

the class ExecutePostClusterManagerStartRecipesHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<ExecutePostClusterManagerStartRecipesRequest> event) {
    Long stackId = event.getData().getResourceId();
    Selectable response;
    try {
        clusterBuilderService.executePostClusterManagerStartRecipes(stackId);
        response = new ExecutePostClusterManagerStartRecipesSuccess(stackId);
    } catch (RuntimeException | CloudbreakException e) {
        LOGGER.error("ExecutePostClusterManagerStartRecipesHandler step failed with the following message: {}", e.getMessage());
        response = new ExecutePostClusterManagerStartRecipesFailed(stackId, e);
    }
    return response;
}
Also used : ExecutePostClusterManagerStartRecipesFailed(com.sequenceiq.cloudbreak.reactor.api.event.cluster.install.ExecutePostClusterManagerStartRecipesFailed) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) ExecutePostClusterManagerStartRecipesSuccess(com.sequenceiq.cloudbreak.reactor.api.event.cluster.install.ExecutePostClusterManagerStartRecipesSuccess)

Aggregations

Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 ExecutePostClusterManagerStartRecipesFailed (com.sequenceiq.cloudbreak.reactor.api.event.cluster.install.ExecutePostClusterManagerStartRecipesFailed)1 ExecutePostClusterManagerStartRecipesSuccess (com.sequenceiq.cloudbreak.reactor.api.event.cluster.install.ExecutePostClusterManagerStartRecipesSuccess)1 CloudbreakException (com.sequenceiq.cloudbreak.service.CloudbreakException)1