Ejemplo n.º 1
0
        public static IntegrationFlowBuilder <TBody> WireTap <TBody>(IBuildableFlow sourceFlow, IntegrationFlowBuilder <TBody> builder, IServiceProvider serviceProvider)
        {
            var wireTapStep = new WireTapStep(serviceProvider.GetRequiredService <ILoggerFactory>().CreateLogger <WireTapStep>());

            sourceFlow.AddStep(wireTapStep);
            return(builder);
        }
Ejemplo n.º 2
0
 public ExceptionHandlerBuilder(IBuildableFlow sourceFlow, IntegrationFlowBuilder <TBody> builder, IServiceProvider serviceProvider)
 {
     this.SourceFlow      = sourceFlow ?? throw new ArgumentNullException(nameof(sourceFlow));
     this.Builder         = builder ?? throw new ArgumentNullException(nameof(builder));
     this.ServiceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     this.ExceptionHander = new ExceptionHandler(this.ServiceProvider.GetRequiredService <ILogger <ExceptionHandler> >());
 }
Ejemplo n.º 3
0
        public static IntegrationFlowBuilder <TBody> Log <TBody>(IBuildableFlow sourceFlow, IntegrationFlowBuilder <TBody> builder, Action <Integration <TBody>, ILogger> action, IServiceProvider serviceProvider)
        {
            var logStep = new LogStep <TBody>(serviceProvider.GetRequiredService <ILoggerFactory>()
                                              .CreateLogger(typeof(LogStep <TBody>)), action);

            sourceFlow.AddStep(logStep);
            return(builder);
        }
Ejemplo n.º 4
0
        public static FilterBuilder <TBody> Filter(Func <Integration, bool> filterFunction, IBuildableFlow sourceFlow, IntegrationFlowBuilder <TBody> builder)
        {
            if (filterFunction == null)
            {
                throw new ArgumentNullException(nameof(filterFunction));
            }

            return(new FilterBuilder <TBody>()
            {
                FilterFunction = filterFunction,
                Builder = builder,
                SourceFlow = sourceFlow
            });
        }
Ejemplo n.º 5
0
 public ChoiceStepBuilder(IBuildableFlow sourceFlow, ChoiceBuilder <TBody> builder, Func <Integration, bool> matcher)
     : base(sourceFlow, builder, matcher)
 {
 }
Ejemplo n.º 6
0
 private ChoiceBuilder(IBuildableFlow sourceFlow, IntegrationFlowBuilder <TBody> builder)
 {
     this.SourceFlow = sourceFlow;
     this.Builder    = builder;
 }
Ejemplo n.º 7
0
 public static ChoiceBuilder <TBody> Choice(IBuildableFlow sourceFlow, IntegrationFlowBuilder <TBody> builder)
 {
     return(new ChoiceBuilder <TBody>(sourceFlow, builder));
 }
        public static IntegrationFlowBuilder <TFrom> Translate(Func <TFrom, TTo> translator, IBuildableFlow sourceFlow, IntegrationFlowBuilder <TFrom> sourceBuilder)
        {
            var generatedStep = new TranslatorStep <TFrom, TTo>(translator);

            sourceFlow.AddStep(generatedStep);
            return(sourceBuilder);
        }
 protected BaseChoiceStepBuilder(IBuildableFlow sourceFlow, ChoiceBuilder <TBody> builder, Func <Integration, bool> matcher)
 {
     this.SourceFlow = sourceFlow ?? throw new ArgumentNullException(nameof(sourceFlow));
     this.Builder    = builder ?? throw new ArgumentNullException(nameof(builder));
     Matcher         = matcher ?? throw new ArgumentNullException(nameof(matcher));
 }