use of com.sequenceiq.cloudbreak.core.flow2.cluster.datalake.upgrade.validation.event.ClusterUpgradeFreeIpaStatusValidationFinishedEvent in project cloudbreak by hortonworks.
the class ClusterUpgradeFreeIpaStatusValidationHandler method doAccept.
@Override
protected Selectable doAccept(HandlerEvent<ClusterUpgradeFreeIpaStatusValidationEvent> event) {
LOGGER.debug("Accepting Cluster upgrade FreeIPA status validation event.");
ClusterUpgradeFreeIpaStatusValidationEvent request = event.getData();
Long stackId = request.getResourceId();
String environmentCrn = getStack(stackId).getEnvironmentCrn();
if (!freeipaService.checkFreeipaRunning(environmentCrn)) {
String message = "Upgrade cannot be performed because the FreeIPA isn't available. Please check the FreeIPA state and try again.";
LOGGER.info("FreeIPA status validation failed with: {}", message);
return new ClusterUpgradeValidationFailureEvent(stackId, new UpgradeValidationFailedException(message));
} else {
LOGGER.debug("FreeIPA status validation passed successfully");
return new ClusterUpgradeFreeIpaStatusValidationFinishedEvent(stackId);
}
}
use of com.sequenceiq.cloudbreak.core.flow2.cluster.datalake.upgrade.validation.event.ClusterUpgradeFreeIpaStatusValidationFinishedEvent in project cloudbreak by hortonworks.
the class ClusterUpgradeValidationActions method clusterUpgradeServiceValidation.
@Bean(name = "CLUSTER_UPGRADE_SERVICE_VALIDATION_STATE")
public Action<?, ?> clusterUpgradeServiceValidation() {
return new AbstractClusterUpgradeValidationAction<>(ClusterUpgradeFreeIpaStatusValidationFinishedEvent.class) {
@Override
protected void doExecute(StackContext context, ClusterUpgradeFreeIpaStatusValidationFinishedEvent payload, Map<Object, Object> variables) {
LOGGER.info("Starting to validate services.");
boolean lockComponents = (Boolean) variables.get(LOCK_COMPONENTS);
ClusterUpgradeServiceValidationEvent event = new ClusterUpgradeServiceValidationEvent(payload.getResourceId(), lockComponents);
sendEvent(context, event.selector(), event);
}
@Override
protected Object getFailurePayload(ClusterUpgradeFreeIpaStatusValidationFinishedEvent payload, Optional<StackContext> flowContext, Exception ex) {
return new ClusterUpgradeValidationFinishedEvent(payload.getResourceId(), ex);
}
};
}
Aggregations