use of com.sequenceiq.cloudbreak.core.flow2.cluster.datalake.dr.BackupRestoreContext in project cloudbreak by hortonworks.
the class DatabaseRestoreActions method databaseRestoreFailedAction.
@Bean(name = "DATABASE_RESTORE_FAILED_STATE")
public Action<?, ?> databaseRestoreFailedAction() {
return new AbstractBackupRestoreActions<>(DatabaseRestoreFailedEvent.class) {
@Override
protected BackupRestoreContext createFlowContext(FlowParameters flowParameters, StateContext<FlowState, FlowEvent> stateContext, DatabaseRestoreFailedEvent payload) {
Flow flow = getFlow(flowParameters.getFlowId());
flow.setFlowFailed(payload.getException());
return BackupRestoreContext.from(flowParameters, payload, null, null, true);
}
@Override
protected void doExecute(BackupRestoreContext context, DatabaseRestoreFailedEvent payload, Map<Object, Object> variables) {
backupRestoreStatusService.handleDatabaseRestoreFailure(context.getStackId(), payload.getException().getMessage(), payload.getDetailedStatus());
sendEvent(context, DATABASE_RESTORE_FAIL_HANDLED_EVENT.event(), payload);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.cluster.datalake.dr.BackupRestoreContext in project cloudbreak by hortonworks.
the class DatabaseBackupActions method databaseBackupFailedAction.
@Bean(name = "DATABASE_BACKUP_FAILED_STATE")
public Action<?, ?> databaseBackupFailedAction() {
return new AbstractBackupRestoreActions<>(DatabaseBackupFailedEvent.class) {
@Override
protected BackupRestoreContext createFlowContext(FlowParameters flowParameters, StateContext<FlowState, FlowEvent> stateContext, DatabaseBackupFailedEvent payload) {
Flow flow = getFlow(flowParameters.getFlowId());
flow.setFlowFailed(payload.getException());
return BackupRestoreContext.from(flowParameters, payload, null, null, true);
}
@Override
protected void doExecute(BackupRestoreContext context, DatabaseBackupFailedEvent payload, Map<Object, Object> variables) {
backupRestoreStatusService.handleDatabaseBackupFailure(context.getStackId(), payload.getException().getMessage(), payload.getDetailedStatus());
sendEvent(context, DATABASE_BACKUP_FAIL_HANDLED_EVENT.event(), payload);
}
};
}
Aggregations