use of com.sequenceiq.cloudbreak.reactor.api.event.recipe.UploadRecipesRequest in project cloudbreak by hortonworks.
the class UploadRecipesHandler method accept.
@Override
public void accept(Event<UploadRecipesRequest> event) {
UploadRecipesRequest request = event.getData();
Selectable result;
Long stackId = request.getStackId();
try {
Stack stack = stackService.getByIdWithLists(stackId);
Set<HostGroup> hostGroups = hostGroupService.getByCluster(stack.getCluster().getId());
recipeEngine.uploadRecipes(stack, hostGroups);
result = new UploadRecipesSuccess(stackId);
} catch (Exception e) {
LOGGER.error("Failed to upload recipes", e);
result = new UploadRecipesFailed(stackId, e);
}
eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Aggregations