Files
Fileinterface_Cron_Job/FileinterfaceCronScheduler/Scheduler/CronJobConfig.cs
2026-08-19 19:27:41 +02:00

70 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
namespace FileInterface.Scheduler
{
public sealed class CronJobConfig
{
public string Id { get; set; }
public string Name { get; set; }
public bool Enabled { get; set; }
public string Cron { get; set; }
// File processing. If CallOnceWithoutFile=true, SourceDirectory/SearchPattern are ignored.
public bool CallOnceWithoutFile { get; set; }
public string SourceDirectory { get; set; }
public string SearchPattern { get; set; }
public bool IncludeSubdirectories { get; set; }
// Existing FileInterface-style preprocessing.
public bool RemoveEmptyLines { get; set; }
public string JoinSeparator { get; set; }
// iTAC CustomFunction.
public string CustomFunction { get; set; }
public List<string> InArgs { get; set; }
// File handling after successful CF call.
public bool MoveFileAfterSuccess { get; set; }
public string MoveTargetDirectory { get; set; }
public bool OverwriteTargetFile { get; set; }
public CronJobConfig()
{
Id = Guid.NewGuid().ToString("N");
Name = "New job";
Enabled = true;
Cron = "*/5 * * * *";
CallOnceWithoutFile = false;
SourceDirectory = "";
SearchPattern = "*.*";
IncludeSubdirectories = false;
RemoveEmptyLines = true;
JoinSeparator = ";";
CustomFunction = "";
InArgs = new List<string>();
MoveFileAfterSuccess = false;
MoveTargetDirectory = "";
OverwriteTargetFile = false;
}
}
public sealed class SchedulerOptions
{
public string ConfigFile { get; set; }
public string WatcherConfigFile { get; set; }
public string WebPrefix { get; set; }
public string WebUser { get; set; }
public string WebPassword { get; set; }
public SchedulerOptions()
{
ConfigFile = "cronjobs.json";
WatcherConfigFile = "watcherjobs.json";
WebPrefix = "http://127.0.0.1:8095/";
WebUser = "";
WebPassword = "";
}
}
}