iSchedulerXMLProcessor.cs
8.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
//namespace iSchedulerMonitorXXXX
//{
// using System;
// using System.Collections.Generic;
// using System.Linq;
// using System.Text;
// using System.Threading.Tasks;
// using System.Xml.Linq;
// using Vrh.XmlProcessing;
// //using Vrh.Web.Common.Lib;
// #region iSchedulerXMLProcessor class
// public class iSchedulerXMLProcessor : LinqXMLProcessorBase
// {
// #region Elements and Attributes private classes
// private class Elements
// {
// public const string DATABASECONNECTIONSTRING = "DatabaseConnectionString";
// public const string OBJECTTYPE = "ObjectType";
// public const string GROUPID = "GroupId";
// public const string MONITORSERVICE = "MonitorService";
// public const string CHECKINTERVAL = "CheckInterval";
// public const string ISCHEDULERPARAMETERS = "iSchedulerParameters";
// }
// private class Attributes
// {
// }
// #endregion Elements and Attributes private classes
// #region Properties
// /// <summary>
// /// Feldolgozás közben keletkezett hibaüzenetek.
// /// </summary>
// public string ErrorMessage { get; private set; } = string.Empty;
// /// <summary>
// /// Itt a model létrejöttekor egy fix érték: "en-US".
// /// </summary>
// public string LCID { get; private set; }
// /// <summary>
// /// Az adatbázishoz való kapcsolódás adatai.
// /// A ConnectionStringStore által feloldott érték, ha nem tudta feloldani akkor ami az xml-ben van.
// /// </summary>
// private string _DatabaseConnectionStringName = null;
// private string _DatabaseConnectionString = null;
// public string DatabaseConnectionString
// {
// get
// {
// if (_DatabaseConnectionString == null)
// {
// _DatabaseConnectionStringName = GetValue(GetXElement(Elements.DATABASECONNECTIONSTRING), "");
// try { _DatabaseConnectionString = ConnectionStringStore.GetSQL(_DatabaseConnectionStringName); }
// catch { _DatabaseConnectionString = _DatabaseConnectionStringName; }
// if (string.IsNullOrWhiteSpace(_DatabaseConnectionString)) { throw new ApplicationException($"The <{Elements.DATABASECONNECTIONSTRING}> element is missing or empty!"); }
// }
// return _DatabaseConnectionString;
// }
// }
// #region ObjectType property
// /// <summary>
// /// Az xml-ben található object type.
// /// Az ütemezések lekérdezéséhez szükséges.
// /// </summary>
// public string ObjectType
// {
// get
// {
// if (_ObjectType == null)
// {
// _ObjectType = GetValue(GetXElement(Elements.OBJECTTYPE), "");
// if (string.IsNullOrWhiteSpace(_ObjectType)) { throw new ApplicationException($"The <{Elements.OBJECTTYPE}> element is missing or empty!"); }
// }
// return _ObjectType;
// }
// }
// private string _ObjectType = null;
// #endregion ObjectType property
// #region GroupId property
// /// <summary>
// /// Az xml-ben található GroupId érték.
// /// Az ütemezések lekérdezéséhez szükséges.
// /// </summary>
// public string GroupId
// {
// get
// {
// if (_GroupId == null)
// {
// _GroupId = GetValue(GetXElement(Elements.GROUPID), "");
// if (string.IsNullOrWhiteSpace(_GroupId)) { throw new ApplicationException($"The <{Elements.GROUPID}> element is missing or empty!"); }
// else if (_GroupId.Trim() == "*") { throw new ApplicationException($"The value of the <{Elements.GROUPID}> element can not equal '*'!"); }
// }
// return _GroupId;
// }
// }
// private string _GroupId = null;
// #endregion GroupId property
// #region CheckInterval property
// /// <summary>
// /// Az időzítések figyelése ennyi időközönként (másodperc) fog megtörténni.
// /// Minimum: 60 sec (1perc), maximum: 86400 sec (1nap).
// /// Ha a tulajdonság nem létezik, vagy értelmezhetetlen, akkor a minimum lesz.
// /// </summary>
// public int CheckInterval
// {
// get
// {
// if (_CheckInterval < CheckIntervalMinimum)
// {
// string chckint = GetValue(GetXElement(Elements.MONITORSERVICE, Elements.CHECKINTERVAL), "");
// if (string.IsNullOrEmpty(chckint))
// {
// _CheckInterval = CheckIntervalMinimum;
// }
// else
// {
// if (!int.TryParse(chckint, out _CheckInterval)) { _CheckInterval = CheckIntervalMinimum; }
// }
// _CheckInterval = Math.Min(Math.Max(_CheckInterval, CheckIntervalMinimum), CheckIntervalMaximum);
// }
// return _CheckInterval;
// }
// }
// private int _CheckInterval;
// #endregion CheckInterval properties
// #region iSchedulerParameters property
// /// <summary>
// /// Az iScheduler xml paraméter file pontos elérési útja.
// /// Ha nincs megadva a plugin InstanceData paramétereként, akkor ez lesz használatos, ha pedig ez sincs megadva,
// /// akkor maga a plug InstanceConfig paramétereként megadott file.
// /// Minimum: 60 sec (1perc), maximum: 86400 sec (1nap).
// /// Ha a tulajdonság nem létezik, vagy értelmezhetetlen, akkor a minimum lesz.
// /// </summary>
// public string iSchedulerParameters
// {
// get { return GetValue(GetXElement(Elements.MONITORSERVICE, Elements.ISCHEDULERPARAMETERS), ""); }
// }
// //private string _iSchedulerParameters;
// #endregion iSchedulerParameters properties
// /// <summary>
// /// Az időzítések figyelésének minimum értéke.
// /// </summary>
// public int CheckIntervalMinimum { get; private set; }
// /// <summary>
// /// Az időzítések figyelésének maximum értéke.
// /// </summary>
// public int CheckIntervalMaximum { get; private set; }
// public string ScheduleMonitorXmlPath { get; private set; }
// public string ScheduleXmlPath { get; private set; }
// #endregion Properties
// public iSchedulerXMLProcessor(string scheduleMonitorXmlPath, string scheduleXmlPath = null) : base(scheduleMonitorXmlPath)
// {
// try
// {
// base._xmlNameSpace = string.Empty;
// base._xmlFileDefinition = scheduleMonitorXmlPath;
// this.SetThrowException(true);
// XElement rootXE = base.GetRootElement(); // csak azért, hogy kiderüljenek az XML hibák!
// this.SetThrowException(false);
// //rootXE = base.GetRootElement(); // csak azért, hogy kiderüljenek az XML hibák!
// LCID = "en-US"; //fix érték, mert nincs honnan megtudni a beállítást!
// CheckIntervalMinimum = 60; // 1 perc
// CheckIntervalMaximum = 86400; // 1 nap
// this.ScheduleMonitorXmlPath = scheduleMonitorXmlPath;
// this.ScheduleXmlPath = string.IsNullOrEmpty(scheduleXmlPath) ? this.iSchedulerParameters : scheduleXmlPath;
// this.ScheduleXmlPath = string.IsNullOrEmpty(this.ScheduleXmlPath) ? this.ScheduleMonitorXmlPath : this.ScheduleXmlPath;
// this._CheckInterval = -1; // annak jelzése, hogy a beállítás még nem történt meg.
// if (ErrorMessage != string.Empty) { throw new ApplicationException(ErrorMessage); }
// }
// catch (Exception ex)
// {
// throw new ApplicationException("Error occured while xml processing!", ex);
// }
// }
// }
// #endregion iSchedulerXMLProcessor class
//}