Ejemplo n.º 1
0
 public static void CreateEvtLogFeed(TheRequestData pRequest, List <TheEventLogData> pLogData, int MaxCnt)
 {
     if (pRequest.RequestUri != null && !string.IsNullOrEmpty(pRequest.RequestUri.Query) && pRequest.RequestUri.Query.Length > 1)
     {
         var QParts = TheCommonUtils.ParseQueryString(pRequest.RequestUri.Query); //.Split('=');
         //if (QParts.ContainsKey("SID") && (!TheScopeManager.IsValidScopeID(TheScopeManager.GetScrambledScopeIDFromEasyID(QParts["SID"])) || QParts.ContainsKey("NID")))
         //{
         //    pRequest.SessionState.SScopeID = TheScopeManager.GetScrambledScopeIDFromEasyID(QParts["SID"]);
         //    Guid tTarget = Guid.Empty;
         //    if (QParts.ContainsKey("NID"))
         //        tTarget = TheCommonUtils.CGuid(QParts["NID"]);
         //    TheHttpService.cdeStreamFile(pRequest, true, 300, tTarget);
         //    if (pRequest.ResponseBuffer == null)
         //        TheRSSGenerator.CreateRSS(pRequest, new List<TheEventLogData>() { new TheEventLogData() { EventName = "Relay did not answer" } }, 1);
         //    return;
         //}
     }
     if (pLogData != null)
     {
         TheRSSGenerator.CreateRSS(pRequest, pLogData, 200);
     }
     else
     {
         TheRSSGenerator.CreateRSS(pRequest, new List <TheEventLogData>()
         {
             new TheEventLogData()
             {
                 EventName = "No Eventlog on this Node"
             }
         }, 1);
     }
 }
Ejemplo n.º 2
0
 internal void InterceptRSSEvtRequest(TheRequestData pRequest)
 {
     if (pRequest == null)
     {
         return;
     }
     try
     {
         TheStorageMirror <TheEventLogData> tEventLog = TheCDEngines.GetStorageMirror("EventLog") as TheStorageMirror <TheEventLogData>;
         if (tEventLog != null)
         {
             CreateEvtLogFeed(pRequest, tEventLog?.TheValues.OrderByDescending(s => s.cdeCTIM).ThenByDescending(s => s.cdeCTIM.Millisecond).ToList(), 200);
         }
         else
         {
             TheRSSGenerator.CreateRSS(pRequest, new List <TheEventLogData>()
             {
                 new TheEventLogData()
                 {
                     EventName = "No Eventlog on this Node"
                 }
             }, 1);
         }
     }
     catch
     {
         //ignored
     }
 }
Ejemplo n.º 3
0
        public static void CreateSysLogFeed(TheRequestData pRequest, int MaxCnt)
        {
            if (pRequest.RequestUri != null && !string.IsNullOrEmpty(pRequest.RequestUri.Query) && pRequest.RequestUri.Query.Length > 1)
            {
                var QParts = TheCommonUtils.ParseQueryString(pRequest.RequestUri.Query); //.Split('=');
                //if (QParts.ContainsKey("SID") && (!TheScopeManager.IsValidScopeID(TheScopeManager.GetScrambledScopeIDFromEasyID(QParts["SID"])) || QParts.ContainsKey("NID")))
                //{
                //    pRequest.SessionState.SScopeID = TheScopeManager.GetScrambledScopeIDFromEasyID(QParts["SID"]);
                //    Guid tTarget = Guid.Empty;
                //    if (QParts.ContainsKey("NID"))
                //        tTarget = TheCommonUtils.CGuid(QParts["NID"]);
                //    Communication.HttpService.TheHttpService.cdeStreamFile(pRequest, true, 10, tTarget);
                //    if (pRequest.ResponseBuffer == null)
                //        TheRSSGenerator.CreateRSS(pRequest, new List<TheEventLogData>() { new TheEventLogData() { EventName = "Relay did not answer" } }, 1);
                //    return;
                //}
            }
            TheStorageMirror <TheEventLogEntry> tEventLog = TheCDEngines.GetStorageMirror($"{typeof(TheEventLogEntry)}") as TheStorageMirror <TheEventLogEntry>;

            TheRSSGenerator.CreateRSS(pRequest, tEventLog.TheValues.OrderByDescending(s => s.cdeCTIM).ThenByDescending(s => s.cdeCTIM.Millisecond).ToList(), MaxCnt);
        }