use of com.sequenceiq.cloudbreak.service.upgrade.validation.service.ServiceUpgradeValidationRequest in project cloudbreak by hortonworks.
the class ClusterUpgradeServiceValidationHandler method doAccept.
@Override
protected Selectable doAccept(HandlerEvent<ClusterUpgradeServiceValidationEvent> event) {
LOGGER.debug("Accepting Cluster upgrade service validation event.");
ClusterUpgradeServiceValidationEvent request = event.getData();
Long stackId = request.getResourceId();
try {
Stack stack = getStack(stackId);
serviceUpgradeValidators.forEach(validator -> validator.validate(new ServiceUpgradeValidationRequest(stack, request.isLockComponents())));
return new ClusterUpgradeValidationFinishedEvent(stackId);
} catch (UpgradeValidationFailedException e) {
LOGGER.warn("Cluster upgrade service validation failed", e);
return new ClusterUpgradeValidationFailureEvent(stackId, e);
} catch (Exception e) {
LOGGER.error("Cluster upgrade service validation was unsuccessful due to an internal error", e);
return new ClusterUpgradeValidationFinishedEvent(stackId, e);
}
}
Aggregations