internal TaskManifest(IRevaleeRegistrar revalee, HttpContext context, IOptions <RevaleeOptions> option, IRevaleeClientRecurringSettings configuredTasks) { if (configuredTasks == null) { throw new ArgumentNullException(nameof(configuredTasks)); } _option = option.Value; _revalee = revalee; _context = context; _callbackBaseUri = configuredTasks.CallbackBaseUri; InitVariables(); var taskList = new List <ConfiguredTask>(); using (var taskBuilder = new TaskBuilder(_callbackBaseUri)) { foreach (var task in configuredTasks.TaskModel) { taskList.Add(taskBuilder.Create(_clockSource, task.Periodicity, task.Day.GetValueOrDefault(), task.Hour.GetValueOrDefault(), task.Minute, task.Url)); if (CallbackBaseUri == null) { ScavengeForCallbackBaseUri(task.Url); } } } _taskCollection = new ImmutableTaskCollection(taskList); }
public RecurringTaskModuleMiddleware(RequestDelegate next, IRevaleeClientRecurringSettings recurringConfig, IRevaleeRegistrar revalee, IOptions <RevaleeOptions> option) { _next = next; _recurringConfig = recurringConfig; _revalee = revalee; _option = option; }
internal TaskManifest(IRevaleeRegistrar revalee, HttpContext context, IOptions <RevaleeOptions> option) { InitVariables(); _option = option.Value; _revalee = revalee; _context = context; _taskCollection = new ImmutableTaskCollection(); }
/// <summary> /// Called when a process requests authorization for the marked callback action. /// </summary> /// <param name="filterContext">The filter context, which encapsulates information for using <see cref="T:Revalee.Client.Mvc.CallbackActionAttribute" />.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="filterContext" /> parameter is null.</exception> public void OnAuthorization(AuthorizationFilterContext filterContext) { if (filterContext == null) { Debug.Fail("Revalee Error", $"Revalee::{nameof(AuthorizationFilterContext)} parameter of {nameof(OnAuthorization)} method of {nameof(CallbackActionAttribute)} is null"); throw new ArgumentNullException(nameof(filterContext)); } _revalee = (IRevaleeRegistrar)filterContext.HttpContext.RequestServices.GetService(typeof(IRevaleeRegistrar)); _callBackState = (ICallbackStateCache)filterContext.HttpContext.RequestServices.GetService(typeof(ICallbackStateCache)); if (filterContext.HttpContext == null || filterContext.HttpContext.Request == null || !_revalee.ValidateCallback(filterContext.HttpContext)) // (filterContext.HttpContext.Request)) { filterContext.Result = new UnauthorizedResult(); } }
public HomeController(IRevaleeRegistrar revalee, IRecurringTaskModule recurringTask) { _revalee = revalee; _recurringTask = recurringTask; }
static async Task <TaskManifest> LoadManifest(HttpContext context, IRevaleeClientRecurringSettings recurringConfig, IRevaleeRegistrar revalee, IOptions <RevaleeOptions> option) { TaskManifest manifest = null; if (recurringConfig == null || !recurringConfig.TaskModel.Any()) { manifest = new TaskManifest(revalee, context, option); } else { manifest = new TaskManifest(revalee, context, option, recurringConfig); if (!manifest.IsEmpty) { await manifest.Start(); } } return(manifest); }
internal static async Task PrepareManifest(HttpContext context, IRevaleeClientRecurringSettings recurringConfig, IRevaleeRegistrar revalee, IOptions <RevaleeOptions> option) { _manifest = await LoadManifest(context, recurringConfig, revalee, option); }