32 |
public static readonly string queueNameMysql = "DAO.ALL"; |
public static readonly string queueNameMysql = "DAO.ALL"; |
33 |
public static readonly string queueNameStore = "DAO.STORE"; |
public static readonly string queueNameStore = "DAO.STORE"; |
34 |
|
|
35 |
|
TimeSpan silentPeriodBegin; |
36 |
|
TimeSpan silentPeriodEnd; |
37 |
|
|
38 |
protected FilterController() |
protected FilterController() |
39 |
{ |
{ |
86 |
|
|
87 |
//////////// |
//////////// |
88 |
|
|
89 |
|
string silentBeginStr = (string)key.GetValue("SilentPeriodBegin"); |
90 |
|
if (silentBeginStr == null || silentBeginStr.Length == 0) |
91 |
|
{ |
92 |
|
key.SetValue("SilentPeriodBegin", "", RegistryValueKind.String); |
93 |
|
throw new System.ArgumentException("SilentPeriodBegin cannot be null or empty"); |
94 |
|
} |
95 |
|
silentPeriodBegin = TimeSpan.Parse(silentBeginStr); |
96 |
|
|
97 |
|
string silentEndStr = (string)key.GetValue("SilentPeriodEnd"); |
98 |
|
if (silentEndStr == null || silentEndStr.Length == 0) |
99 |
|
{ |
100 |
|
key.SetValue("SilentPeriodEnd", "", RegistryValueKind.String); |
101 |
|
throw new System.ArgumentException("SilentPeriodEnd cannot be null or empty"); |
102 |
|
} |
103 |
|
silentPeriodEnd = TimeSpan.Parse(silentEndStr); |
104 |
|
|
105 |
|
//////////// |
106 |
|
|
107 |
String tmpFilterTransactions = (string)key.GetValue("FilterTransactions"); |
String tmpFilterTransactions = (string)key.GetValue("FilterTransactions"); |
108 |
if (tmpFilterTransactions == null || tmpFilterTransactions.Length == 0) |
if (tmpFilterTransactions == null || tmpFilterTransactions.Length == 0) |
109 |
{ |
{ |
134 |
catch (Exception e) |
catch (Exception e) |
135 |
{ |
{ |
136 |
logFile.addSingleLogEntry("Error during transportAllMessages: " + e.Message); |
logFile.addSingleLogEntry("Error during transportAllMessages: " + e.Message); |
137 |
|
Console.WriteLine(e.StackTrace); |
138 |
} |
} |
139 |
} |
} |
140 |
|
|
181 |
queueIndbakke.Get(mqMsg, mqGetMsgOpts); |
queueIndbakke.Get(mqMsg, mqGetMsgOpts); |
182 |
if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0) |
if (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) == 0) |
183 |
{ |
{ |
184 |
|
if (mqMsg.MessageLength == 0) //Skip empty transactions (so far only seen on my test server) |
185 |
|
continue; |
186 |
|
|
187 |
|
//System.Console.WriteLine("LEN>" + mqMsg.MessageLength); |
188 |
string salt2String = mqMsg.ReadString(mqMsg.MessageLength); |
string salt2String = mqMsg.ReadString(mqMsg.MessageLength); |
189 |
//System.Console.WriteLine(msgString); |
|
190 |
|
|
191 |
|
|
192 |
// validér at headeren er gyldig |
// validér at headeren er gyldig |
277 |
private Boolean saveForLater(Salt2Header header) |
private Boolean saveForLater(Salt2Header header) |
278 |
{ |
{ |
279 |
|
|
280 |
DateTime now = DateTime.Now; |
TimeSpan now = DateTime.Now.TimeOfDay; |
281 |
int hour = now.Hour; |
|
282 |
if (hour >= 14 && hour < 18) |
if (now >= silentPeriodBegin && now < silentPeriodEnd) |
283 |
{ |
{ |
284 |
|
|
285 |
|
if (header.afsender == "DAO") //DAO transaktioner må altid komme igennem |
286 |
|
return false; |
287 |
|
|
288 |
if (contains(header.transaktionForkortelse, this.filterTranscations) ) //Så længe vi skal være .net3.0 kompatible er LINQ problematisk (LINQ kræver 3.5) |
if (contains(header.transaktionForkortelse, this.filterTranscations) ) //Så længe vi skal være .net3.0 kompatible er LINQ problematisk (LINQ kræver 3.5) |
289 |
{ |
{ |