예제 #1
0
        public static ITrigger GetTrigger(this SnapshotRule rule)
        {
            TriggerBuilder builder = TriggerBuilder.Create()
                                     .WithIdentity(rule.ToString(), "SnapshotJob")
                                     .WithCronSchedule(rule.GeneratedCron)
                                     .StartAt(rule.PeriodStart)
                                     .UsingJobData("RuleId", rule.Id)
                                     .WithDescription(rule.ToString());

            if (rule.PeriodEndEnabled)
            {
                builder = builder.EndAt(rule.PeriodEnd);
            }

            if (rule.HasCalendar())
            {
                builder = builder.ModifiedByCalendar(rule.GetCalendarName());
            }

            return(builder.Build());
        }
예제 #2
0
 public static string GetCalendarName(this SnapshotRule rule)
 {
     return(rule.ToString());
 }