Search in sources :

Example 1 with TriggerFullBackupEvent

use of com.sequenceiq.freeipa.flow.freeipa.backup.full.event.TriggerFullBackupEvent in project cloudbreak by hortonworks.

the class FullBackupActions method backupAction.

@Bean(name = "BACKUP_STATE")
public Action<?, ?> backupAction() {
    return new AbstractBackupAction<>(TriggerFullBackupEvent.class) {

        @Override
        protected void doExecute(BackupContext context, TriggerFullBackupEvent payload, Map<Object, Object> variables) {
            LOGGER.info("Full backup flow started with: {}", payload);
            setChainedAction(variables, payload.isChained());
            setFinalChain(variables, payload.isFinalChain());
            setOperationId(variables, payload.getOperationId());
            sendEvent(context, new CreateFullBackupEvent(payload.getResourceId()));
        }
    };
}
Also used : CreateFullBackupEvent(com.sequenceiq.freeipa.flow.freeipa.backup.full.event.CreateFullBackupEvent) TriggerFullBackupEvent(com.sequenceiq.freeipa.flow.freeipa.backup.full.event.TriggerFullBackupEvent) BackupContext(com.sequenceiq.freeipa.flow.freeipa.backup.full.BackupContext) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Aggregations

BackupContext (com.sequenceiq.freeipa.flow.freeipa.backup.full.BackupContext)1 CreateFullBackupEvent (com.sequenceiq.freeipa.flow.freeipa.backup.full.event.CreateFullBackupEvent)1 TriggerFullBackupEvent (com.sequenceiq.freeipa.flow.freeipa.backup.full.event.TriggerFullBackupEvent)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1