/// <summary> /// Returns the value to use as the item path from a given Atom entry. /// </summary> /// <remarks> /// Subclasses may override this value to support alternative methods /// of determining a member's path. /// </remarks> /// <param name="entry">The <see cref="AtomEntry"/>.</param> /// <returns>The alternate path.</returns> protected virtual string ItemPath(AtomEntry entry) { return(entry.Links["alternate"]); }
/// <summary> /// Returns the value to use as the item key from a given Atom entry. /// </summary> /// <remarks> /// Subclasses may override this value for collections that use /// something other than title as the key. /// </remarks> /// <param name="entry">The <see cref="AtomEntry"/>.</param> /// <returns>The title.</returns> protected virtual string ItemKey(AtomEntry entry) { return(entry.Title); }
/// <summary> /// Returns the job's unique search identifier (SID), which is used as /// this item's key. /// </summary> /// <param name="entry">The Atom entry.</param> /// <returns>The SID.</returns> protected override string ItemKey(AtomEntry entry) { return((string)entry.Content["sid"]); }
/// <summary> /// Creates a collection member corresponding to a given /// Atom entry. /// </summary> /// <remarks> /// This base implementation uses the class object that was /// passed in when the generic <see cref="ResourceCollection{T}"/> was /// created. Subclasses may override this method to provide alternative /// means of instantiating collection items. /// </remarks> /// <param name="entry">The <see cref="AtomEntry"/>.</param> /// <returns>The new object.</returns> protected virtual T CreateItem(AtomEntry entry) { return(this.CreateItem( this.itemClass, this.ItemPath(entry), this.SplunkNamespace(entry))); }
/// <summary> /// Creates a new instance of the <see cref="AtomEntry"/> class. /// </summary> /// <returns>An Atom entry.</returns> private static AtomEntry Create() { AtomEntry atomEntry = new AtomEntry(); atomEntry.Links = new Dictionary<string, string>(); return atomEntry; }