public HttpMockServer(IRecordMatcher matcher) { instanceCount++; this.matcher = matcher; this.Records = new Records(matcher); if (Mode == HttpRecorderMode.Playback) { Records.EnqueueRange(sessionRecords); } }
private void Process(String[] filePaths, IRecordSourceFactory recordSourceFactory, IRecordMatcher recordMatcher, IRecordWriter2 recordWriter) { foreach (String filePath in filePaths) { var recordSource = recordSourceFactory.CreateSource(filePath); while (!recordMatcher.HasReachedMatchQuota && recordSource.GotRecord) { if (recordMatcher.IsMatch(recordSource)) { recordWriter.WriteMatchedRecord(recordSource); } else { recordWriter.WriteUnmatchedRecord(recordSource); } recordSource.MoveToNextRecord(); } recordSource.Close(); } }
/// <summary> /// Sorts all records on the page /// </summary> /// <param name="ClusterKey"></param> public virtual void Sort(IRecordMatcher SortKey) { this._Elements.Sort(SortKey); this._Version++; }
public Records(Dictionary <string, Queue <RecordEntry> > records, IRecordMatcher matcher) { this.sessionRecords = new Dictionary <string, Queue <RecordEntry> >(records); this.matcher = matcher; }
public Records(IRecordMatcher matcher) : this(new Dictionary <string, Queue <RecordEntry> >(), matcher) { }
/// <summary> /// Turn off sorting /// </summary> /// <param name="ClusterKey"></param> public override void Sort(IRecordMatcher SortKey) { throw new ArgumentException("Cannot sort a sorted page; it's already sorted and the key cannot be changed"); }
public SortedPage(Page Primitive, IRecordMatcher Matcher) : this(Primitive.PageSize, Primitive.PageID, Primitive.LastPageID, Primitive.NextPageID, Primitive.FieldCount, Primitive.UsedSpace, Matcher) { this._Elements = Primitive.Cache; }
public SortedPage(int PageSize, int PageID, int LastPageID, int NextPageID, int FieldCount, int UsedSpace, IRecordMatcher Matcher) : base(PageSize, PageID, LastPageID, NextPageID, FieldCount, UsedSpace) { this._Matcher = Matcher; }