Search in sources :

Example 11 with FlowEvent

use of com.sequenceiq.flow.core.FlowEvent in project cloudbreak by hortonworks.

the class Flow2Config method flowConfigurationMap.

@Bean
public Map<String, FlowConfiguration<?>> flowConfigurationMap(List<FlowConfiguration<?>> flowConfigs) {
    Map<String, FlowConfiguration<?>> flowConfigMap = new HashMap<>();
    for (FlowConfiguration<?> flowConfig : flowConfigs) {
        for (FlowEvent event : flowConfig.getInitEvents()) {
            String key = event.event();
            if (flowConfigMap.get(key) != null) {
                throw new UnsupportedOperationException("Event already registered: " + key);
            }
            flowConfigMap.put(key, flowConfig);
        }
    }
    return ImmutableMap.copyOf(flowConfigMap);
}
Also used : FlowEvent(com.sequenceiq.flow.core.FlowEvent) HashMap(java.util.HashMap) Bean(org.springframework.context.annotation.Bean)

Aggregations

FlowEvent (com.sequenceiq.flow.core.FlowEvent)11 Test (org.junit.Test)9 StackImageUpdateTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackImageUpdateTriggerEvent)8 ResourceEvent (com.sequenceiq.cloudbreak.event.ResourceEvent)8 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)8 StackFailureEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackFailureEvent)8 ImageUpdateEvent (com.sequenceiq.cloudbreak.reactor.api.event.stack.ImageUpdateEvent)8 Event (reactor.bus.Event)8 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)7 StatedImage (com.sequenceiq.cloudbreak.service.image.StatedImage)3 HashMap (java.util.HashMap)2 CloudPlatformResult (com.sequenceiq.cloudbreak.cloud.event.CloudPlatformResult)1 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)1 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)1 Resource (com.sequenceiq.cloudbreak.domain.Resource)1 StackView (com.sequenceiq.cloudbreak.domain.view.StackView)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Map (java.util.Map)1