use of com.sequenceiq.flow.core.FlowTriggerConditionResult in project cloudbreak by hortonworks.
the class StackStopFlowTriggerCondition method isFlowTriggerable.
@Override
public FlowTriggerConditionResult isFlowTriggerable(Long stackId) {
FlowTriggerConditionResult result = FlowTriggerConditionResult.OK;
StackView stack = stackService.getViewByIdWithoutAuth(stackId);
if (!stackStartStopService.isStopPossible(stack)) {
String msg = "Stopping stack is not possible because stack is not in stop requested state.";
LOGGER.debug(msg);
result = new FlowTriggerConditionResult(msg);
}
return result;
}
use of com.sequenceiq.flow.core.FlowTriggerConditionResult in project cloudbreak by hortonworks.
the class ClusterCreationFlowTriggerCondition method isFlowTriggerable.
@Override
public FlowTriggerConditionResult isFlowTriggerable(Long stackId) {
FlowTriggerConditionResult result = FlowTriggerConditionResult.OK;
StackView stackView = stackService.getViewByIdWithoutAuth(stackId);
boolean triggerable = stackView.isCreateInProgress();
if (!triggerable) {
String msg = "Cluster creation cannot be triggered, because stack is not in create in progress status.";
LOGGER.warn(msg);
result = new FlowTriggerConditionResult(msg);
}
return result;
}
use of com.sequenceiq.flow.core.FlowTriggerConditionResult in project cloudbreak by hortonworks.
the class ClusterCertificateRenewTriggerCondition method isFlowTriggerable.
@Override
public FlowTriggerConditionResult isFlowTriggerable(Long stackId) {
FlowTriggerConditionResult result = FlowTriggerConditionResult.OK;
Stack stack = stackService.getByIdWithTransaction(stackId);
boolean resourcesIsInTriggerableState = stack.isAvailable() && stack.getCluster() != null;
if (!resourcesIsInTriggerableState) {
String msg = "Certificate renewal could not be triggered, because the cluster's state is not available.";
LOGGER.info(msg);
result = new FlowTriggerConditionResult(msg);
}
boolean certRenewalIsTriggerable = gatewayPublicEndpointManagementService.isCertRenewalTriggerable(stack);
if (!certRenewalIsTriggerable) {
String msg = "Certificate renewal could not be triggered, because the generation feature is disabled or certificate that" + " is generated by PEM service does not belong to the specified stack.";
LOGGER.info(msg);
result = new FlowTriggerConditionResult(msg);
}
return result;
}
use of com.sequenceiq.flow.core.FlowTriggerConditionResult in project cloudbreak by hortonworks.
the class StackImageUpdateFlowTriggerCondition method isFlowTriggerable.
@Override
public FlowTriggerConditionResult isFlowTriggerable(Long stackId) {
FlowTriggerConditionResult result = FlowTriggerConditionResult.OK;
StackView stackView = stackService.getViewByIdWithoutAuth(stackId);
boolean triggerable = stackView.isAvailable();
if (!triggerable) {
String msg = "Image update cannot be triggered because the cluster is not available.";
LOGGER.debug(msg);
result = new FlowTriggerConditionResult(msg);
}
return result;
}
use of com.sequenceiq.flow.core.FlowTriggerConditionResult in project cloudbreak by hortonworks.
the class InstanceTerminationFlowTriggerCondition method isFlowTriggerable.
@Override
public FlowTriggerConditionResult isFlowTriggerable(Long stackId) {
FlowTriggerConditionResult result = FlowTriggerConditionResult.OK;
StackView stack = stackService.getViewByIdWithoutAuth(stackId);
if (stack.isDeleteInProgress()) {
String msg = "Couldn't start instance termination flow because the stack has been terminating.";
LOGGER.debug(msg);
result = new FlowTriggerConditionResult(msg);
}
return result;
}
Aggregations