コード例 #1
0
 public TriggerResetEnvironmentsNodeContextBlock(
     IGetProxyContainerPipeline getProxyContainerPipeline,
     IStartEnvironmentPipeline startEnvironmentPipeline)
     : base(null)
 {
     this._getProxyContainerPipeline = getProxyContainerPipeline;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MigrateListsBlock" /> class.
 /// </summary>
 /// <param name="getListsNamesPipeline">The get lists names pipeline.</param>
 /// <param name="migrateListPipeline">The migrate list pipeline.</param>
 /// <param name="startEnvironmentPipeline">The start environment pipeline.</param>
 public MigrateListsBlock(
     IGetListsNamesPipeline getListsNamesPipeline,
     IMigrateListPipeline migrateListPipeline,
     IStartEnvironmentPipeline startEnvironmentPipeline)
 {
     this._getListsNamesPipeline    = getListsNamesPipeline;
     this._migrateListPipeline      = migrateListPipeline;
     this._startEnvironmentPipeline = startEnvironmentPipeline;
 }
コード例 #3
0
        public static void Start(this IStartEnvironmentPipeline startEnvironmentPipeline, NodeContext node, IConfigurationRoot configuration)
        {
            // Starting the environment to register Minion policies and run Minions
            var environmentName = configuration.GetSection("AppSettings:EnvironmentName").Value;

            node.AddDataMessage("EnvironmentStartup", $"StartEnvironment={environmentName}");

            startEnvironmentPipeline.Run(environmentName, node.GetPipelineContextOptions()).Wait();
        }
コード例 #4
0
        public void Configure(
            IApplicationBuilder app,
            IConfigureServiceApiPipeline contextPipeline,
            IStartNodePipeline startNodePipeline,
            IConfigureOpsServiceApiPipeline contextOpsServiceApiPipeline,
            IStartEnvironmentPipeline startEnvironmentPipeline,
            ILoggerFactory loggerFactory)
        {
            app.UseApplicationInsightsRequestTelemetry();
            app.UseApplicationInsightsExceptionTelemetry();
            app.UseDiagnostics();
            app.UseStaticFiles();
            app.ConfigureErrorPage(_hostEnv);

            startNodePipeline.Start(this._node);
            startEnvironmentPipeline.Start(this._node, this._configuration);

            app.ConfigureOData(contextPipeline, contextOpsServiceApiPipeline, _node);
        }
コード例 #5
0
        /// <summary>
        /// Configures the specified application.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="contextPipeline">The context pipeline.</param>
        /// <param name="startNodePipeline">The start node pipeline.</param>
        /// <param name="contextOpsServiceApiPipeline">The API pipeline.</param>
        /// <param name="startEnvironmentPipeline">The start environment pipeline.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        public void Configure(
            IApplicationBuilder app,
            IConfigureServiceApiPipeline contextPipeline,
            IStartNodePipeline startNodePipeline,
            IConfigureOpsServiceApiPipeline contextOpsServiceApiPipeline,
            IStartEnvironmentPipeline startEnvironmentPipeline,
            ILoggerFactory loggerFactory)
        {
            // Add Application Insights monitoring to the request pipeline as a very first middleware.
            app.UseApplicationInsightsRequestTelemetry();

            // Add Application Insights exceptions handling to the request pipeline.
            app.UseApplicationInsightsExceptionTelemetry();

            app.UseDiagnostics();

            // Add static files to the request pipeline.
            app.UseStaticFiles();

            // Set the error page
            if (this._hostEnv.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseStatusCodePages();
            }

            startNodePipeline.Run(this.NodeContext, this.NodeContext.GetPipelineContextOptions()).Wait();

            // Starting the environment to register Minion policies and run Minions
            var environmentName = this._configuration.GetSection("AppSettings:EnvironmentName").Value;

            ////this.NodeContext.AddDataMessage("EnvironmentStartup", $"StartEnvironment={environmentName}");

            ////startEnvironmentPipeline.Run(environmentName, this.NodeContext.GetPipelineContextOptions()).Wait();

            // Initialize plugins OData contexts
            app.InitializeODataBuilder();
            var modelBuilder = new ODataConventionModelBuilder();

            // Run the pipeline to configure the plugin's OData context
            var contextResult = contextPipeline.Run(modelBuilder, this.NodeContext.GetPipelineContextOptions()).Result;

            contextResult.Namespace = "Sitecore.Commerce.Engine";

            // Get the model and register the ODataRoute
            var model = contextResult.GetEdmModel();

            app.UseRouter(new ODataRoute("Api", model));

            // Register the bootstrap context for the engine
            modelBuilder = new ODataConventionModelBuilder();
            var contextOpsResult = contextOpsServiceApiPipeline.Run(modelBuilder, this.NodeContext.GetPipelineContextOptions()).Result;

            contextOpsResult.Namespace = "Sitecore.Commerce.Engine";

            // Get the model and register the ODataRoute
            model = contextOpsResult.GetEdmModel();
            app.UseRouter(new ODataRoute("CommerceOps", model));
        }