public static void UseCrystalQuartz( this IAppBuilder app, Func <IScheduler> schedulerProvider, CrystalQuartzOptions options) { app.UseCrystalQuartz(new FuncSchedulerProvider(schedulerProvider), options); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } var scheduler = CreateScheduler(); app.UseCrystalQuartz( () => scheduler, new CrystalQuartzOptions { JobDataMapInputTypes = CrystalQuartzOptions .CreateDefaultJobDataMapInputTypes() .Concat(new [] { new RegisteredInputType( new InputType("user", "User"), null, new FixedInputVariantsProvider( new InputVariant("john_smith", "John Smith"), new InputVariant("bob_doe", "Bob Doe"))), }) .ToArray() }); app.UseStaticFiles(); app.UseMvc(); }
public static void UseCrystalQuartz( this IAppBuilder app, IScheduler scheduler, CrystalQuartzOptions options) { app.UseCrystalQuartz(() => scheduler, options); }
public static Options ToRuntimeOptions( this CrystalQuartzOptions options, IDictionary <int, Func <ISchedulerEngine> > schedulerEngineResolvers, string frameworkVersion) { ErrorDetectionOptions errorDetectionOptions = options.ErrorDetectionOptions ?? new ErrorDetectionOptions(); ErrorExtractionSource errorExtractionSource = errorDetectionOptions.Source; var extractErrorsFromJobResults = (errorExtractionSource & ErrorExtractionSource.JobResult) == ErrorExtractionSource.JobResult; IJobResultAnalyser jobResultAnalyser = null; if (extractErrorsFromJobResults) { jobResultAnalyser = CreateJobResultAnalyzer(options.JobResultAnalyserOptions ?? new DictionaryJobResultAnalyzerOptions()); } return(new Options( options.TimelineSpan, schedulerEngineResolvers, options.LazyInit, options.CustomCssUrl, frameworkVersion, (options.JobDataMapDisplayOptions ?? new JobDataMapDisplayOptions()).ToTraversingOptions(), (errorExtractionSource & ErrorExtractionSource.UnhandledExceptions) == ErrorExtractionSource.UnhandledExceptions, extractErrorsFromJobResults, CreateExceptionTransformer(errorDetectionOptions), jobResultAnalyser, options.JobDataMapInputTypes, options.AllowedJobTypes ?? new Type[0])); }
public static void UseCrystalQuartz( this IApplicationBuilder app, Func <object> schedulerProvider, CrystalQuartzOptions options) { ISchedulerProvider provider = new FuncSchedulerProvider(schedulerProvider); UseCrystalQuartz(app, provider, options); }
public static void UseCrystalQuartz( this IAppBuilder app, ISchedulerProvider scheduleProvider, CrystalQuartzOptions options) { app.Map("/CrystalQuartzPanel.axd", privateApp => { privateApp.Use(typeof(CrystalQuartzPanelMiddleware), scheduleProvider, options ?? new CrystalQuartzOptions()); }); }
public CrystalQuartzPanelApplication( ISchedulerProvider schedulerProvider, ISchedulerDataProvider schedulerDataProvider, CrystalQuartzOptions options) : base(Assembly.GetAssembly(typeof(CrystalQuartzPanelApplication)), "CrystalQuartz.Application.Content.") { _schedulerProvider = schedulerProvider; _schedulerDataProvider = schedulerDataProvider; _options = options; }
public CrystalQuartzPanelMiddleware( OwinMiddleware next, ISchedulerProvider schedulerProvider, CrystalQuartzOptions options) : base(next) { Application application = new CrystalQuartzPanelApplication( schedulerProvider, new DefaultSchedulerDataProvider(schedulerProvider), options); _runningApplication = application.Run(); }
public static void UseCrystalQuartz( this IAppBuilder app, ISchedulerProvider scheduleProvider, CrystalQuartzOptions options) { CrystalQuartzOptions actualOptions = options ?? new CrystalQuartzOptions(); string url = actualOptions.Path ?? "/quartz"; app.Map(url, privateApp => { privateApp.Use(typeof(CrystalQuartzPanelMiddleware), scheduleProvider, actualOptions); }); }
static PagesHandler() { var options = new CrystalQuartzOptions { CustomCssUrl = Configuration.ConfigUtils.CustomCssUrl }; ISchedulerProvider schedulerProvider = Configuration.ConfigUtils.SchedulerProvider; Application application = new CrystalQuartzPanelApplication( schedulerProvider, options.ToRuntimeOptions(SchedulerEngineProviders.SchedulerEngineResolvers, FrameworkVersion.Value)); RunningApplication = application.Run(); }
public static void UseCrystalQuartz( this IApplicationBuilder app, ISchedulerProvider schedulerProvider, CrystalQuartzOptions options) { CrystalQuartzOptions actualOptions = options ?? new CrystalQuartzOptions(); string url = actualOptions.Path ?? "/quartz"; app.Map(url, privateApp => { privateApp.UseMiddleware <CrystalQuartzPanelMiddleware>( schedulerProvider, actualOptions.ToRuntimeOptions(SchedulerEngineProviders.SchedulerEngineResolvers, "Core 2.0")); }); }
private static async Task <IEnumerable <Claim> > Authenticate(CrystalQuartzOptions options, string username, string password) { return(await Task.Run <IEnumerable <Claim> >(() => { // authenticate user if (options.ValidateUser(username, password)) { return new List <Claim> { new Claim("name", username) }; } return null; })); }
static PagesHandler() { var options = new CrystalQuartzOptions { CustomCssUrl = Configuration.ConfigUtils.CustomCssUrl }; ISchedulerProvider schedulerProvider = Configuration.ConfigUtils.SchedulerProvider; ISchedulerDataProvider schedulerDataProvider = new DefaultSchedulerDataProvider(schedulerProvider); Application application = new CrystalQuartzPanelApplication( schedulerProvider, schedulerDataProvider, options); RunningApplication = application.Run(); }
public static void UseCrystalQuartz( this IAppBuilder app, ISchedulerProvider scheduleProvider, CrystalQuartzOptions options) { CrystalQuartzOptions actualOptions = options ?? new CrystalQuartzOptions(); string url = actualOptions.Path ?? "/quartz"; app.Map(url, privateApp => { if (actualOptions.UseAuthentication) { privateApp.UseBasicAuthentication("SecureApi", async(u, p) => await Authenticate(actualOptions, u, p)); } privateApp.Use(typeof(CrystalQuartzPanelMiddleware), scheduleProvider, actualOptions); }); }
public static void UseCrystalQuartz( this IAppBuilder app, ISchedulerProvider schedulerProvider, CrystalQuartzOptions options) { CrystalQuartzOptions actualOptions = options ?? new CrystalQuartzOptions(); string url = actualOptions.Path ?? "/quartz"; app.Map(url, privateApp => { privateApp.Use <CrystalQuartzPanelMiddleware>(schedulerProvider, new Options( actualOptions.TimelineSpan, SchedulerEngineProviders.SchedulerEngineResolvers, actualOptions.LazyInit, actualOptions.CustomCssUrl, FrameworkVersion.Value)); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Error"); } app.UseStaticFiles(); var scheduler = CreateScheduler(); app.UseCrystalQuartz( () => scheduler, new CrystalQuartzOptions { JobDataMapInputTypes = CrystalQuartzOptions .CreateDefaultJobDataMapInputTypes() .Concat(new [] { new RegisteredInputType( new InputType("user", "User"), null, new FixedInputVariantsProvider( new InputVariant("john_smith", "John Smith"), new InputVariant("bob_doe", "Bob Doe"))), }) .ToArray() }); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); }