use of com.sequenceiq.cloudbreak.core.flow2.event.MaintenanceModeValidationTriggerEvent in project cloudbreak by hortonworks.
the class MaintenanceModeValidationActions method fetchStackRepo.
@Bean(name = "FETCH_STACK_REPO_STATE")
public AbstractMaintenanceModeValidationAction<?> fetchStackRepo() {
return new AbstractMaintenanceModeValidationAction<>(MaintenanceModeValidationTriggerEvent.class) {
@Override
protected void doExecute(StackContext context, MaintenanceModeValidationTriggerEvent payload, Map<Object, Object> variables) {
maintenanceModeValidationService.setUpValidationFlow(context.getStack().getId());
String stackRepo = maintenanceModeValidationService.fetchStackRepository(context.getStack().getId());
putWarnings(variables, new ArrayList<>());
variables.put(STACK_REPO, stackRepo);
sendEvent(context, new StackEvent(FETCH_STACK_REPO_INFO_FINISHED_EVENT.event(), context.getStack().getId()));
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.event.MaintenanceModeValidationTriggerEvent in project cloudbreak by hortonworks.
the class ReactorFlowManagerTest method testTriggerMaintenanceModeValidationFlow.
@Test
public void testTriggerMaintenanceModeValidationFlow() {
long stackId = 1L;
underTest.triggerMaintenanceModeValidationFlow(stackId);
ArgumentCaptor<Acceptable> captor = ArgumentCaptor.forClass(Acceptable.class);
verify(reactorNotifier).notify(eq(stackId), eq(FlowChainTriggers.CLUSTER_MAINTENANCE_MODE_VALIDATION_TRIGGER_EVENT), captor.capture());
MaintenanceModeValidationTriggerEvent event = (MaintenanceModeValidationTriggerEvent) captor.getValue();
assertEquals(stack.getId(), event.getResourceId());
assertEquals(FlowChainTriggers.CLUSTER_MAINTENANCE_MODE_VALIDATION_TRIGGER_EVENT, event.selector());
}
use of com.sequenceiq.cloudbreak.core.flow2.event.MaintenanceModeValidationTriggerEvent in project cloudbreak by hortonworks.
the class ClusterMaintenanceModeFlowEventChainFactory method createFlowTriggerEventQueue.
@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(MaintenanceModeValidationTriggerEvent event) {
Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>();
flowEventChain.add(new StackSyncTriggerEvent(StackSyncEvent.STACK_SYNC_EVENT.event(), event.getResourceId(), true, event.accepted()));
flowEventChain.add(new StackEvent(CLUSTER_SYNC_EVENT.event(), event.getResourceId()));
flowEventChain.add(new MaintenanceModeValidationTriggerEvent(MaintenanceModeValidationEvent.START_VALIDATION_FLOW_EVENT.event(), event.getResourceId()));
return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
Aggregations