Ejemplo n.º 1
0
        public void AddRawEvent(RawApplicationEvent rae)
        {
            VerifyChainExists();
            SingleOriginEvent soe = chain.Parse(rae);

            outwardBound.AddEvent(soe);
        }
Ejemplo n.º 2
0
        protected override void ActualAddEntry(SingleOriginEvent ee)
        {
            EventEntryStoredElement newElement = new EventEntryStoredElement(ee, null, null);

            lock (lst) {
                lst.Add(newElement);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Calls each link in the chain attempting to create the event from the raw data.
        /// </summary>
        /// <param name="rae">The raw data</param>
        /// <returns>The formed single origin event</returns>
        public SingleOriginEvent Parse(RawApplicationEvent rae)
        {
            SingleOriginEvent result = TryParse(rae);

            if ((result == null) && (nextLink != null))
            {
                result = nextLink.Parse(rae);
            }
            return(result);
        }
Ejemplo n.º 4
0
        public bool IncludeEvent(SingleOriginEvent evt)
        {
            //b.Assert.True(chain != null, "Should not be possible, the constructor should force the chain to be initialised");

            if (evt == null)
            {
                throw new InvalidOperationException("The event can not be empty, you must have passed an event to check");
            }
            return(chain.IncludeEvent(evt));
        }
 protected override SingleOriginEvent TryParse(RawApplicationEvent rae)
 {
     if (IsV1TextString(rae.Text))
     {
         var result = new SingleOriginEvent(rae.Id);
         return(result);
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 6
0
        public SingleOriginEvent Parse(RawApplicationEvent rae)
        {
            #region entry code

            //b.Assert.True(ActiveChain != null, "The active chain must be completed before you are able to parse any entries");

            #endregion

            SingleOriginEvent result = ActiveChain.Parse(rae);

            // Fallback identity provider if the parser hasnt set it.
            if ((result != null) && (result.OriginIdentity < 0))
            {
                result.OriginIdentity = identityProvider.GetOriginIdentity(rae.Machine, rae.Process);
            }
            return(result);
        }
        protected override SingleOriginEvent TryParse(RawApplicationEvent rae)
        {
            if (rae == null)
            {
                return(null);
            }

            if (IsValidV2FormattedString(rae.Text))
            {
                SingleOriginEvent soe = new SingleOriginEvent(rae.Id);
                if (PopulateFromDebugString(rae.Text, soe))
                {
                    return(soe);
                }
            }
            return(null);
        }
        private bool PopulateFromDebugString(string debugString, SingleOriginEvent output)
        {
            if (groupMatchRegexCache == null)
            {
                groupMatchRegexCache = new Regex(V2MESSAGEPARSERREGEX, RegexOptions.Compiled);
            }

            Match m = groupMatchRegexCache.Match(debugString);
            // This should return 5 matches for a legit debug string
            string machineName = m.Captures[0].Value.Trim(new char[] { '[', ']' });

            m = m.NextMatch();
            string processId = m.Captures[0].Value.Trim(new char[] { '[', ']' });

            m = m.NextMatch();
            if (this.IdentityProvider != null)
            {
                output.OriginIdentity = this.IdentityProvider.GetOriginIdentity(machineName, processId);
            }
            output.ThreadId = m.Captures[0].Value.Trim(new char[] { '[', ']' });
            m = m.NextMatch();
            output.netThreadId = m.Captures[0].Value.Trim(new char[] { '[', ']' });
            m = m.NextMatch();
            output.ModuleName = m.Captures[0].Value.Trim(new char[] { '[', ']' });
            m = m.NextMatch();
            output.LineNumber = m.Captures[0].Value.Trim(new char[] { '[', ']' });
            m = m.NextMatch();
            output.moreLocInfo = m.Captures[0].Value.Trim(new char[] { '[', ']' });

            // Now get the command type and turn it into an enum
            Match cmdMatch = Regex.Match(debugString, V2COMMANDIDENTIFIERREGEX);

            output.Type = ConvertCommandTypeToMessageType(cmdMatch.Captures[0].Value);

            // finally get the rest of the string as the debug message
            output.Text = debugString.Substring(cmdMatch.Index + V2COMMANDSTRINGLENGTH);  // commandstrlen currently 5
            return(true);
        }
Ejemplo n.º 9
0
 protected abstract void ActualAddEntry(SingleOriginEvent ee);
Ejemplo n.º 10
0
 public void AddEntry(SingleOriginEvent ee)
 {
     currentCount++;
     ActualAddEntry(ee);
 }
Ejemplo n.º 11
0
 public void AddEvent(SingleOriginEvent soe)
 {
     primary.AddEntry(soe);
 }
Ejemplo n.º 12
0
 protected override bool Execute(SingleOriginEvent evt)
 {
     throw new NotImplementedException();
 }