/// <summary> /// Sends a GetSupportedTypes message to a store. /// </summary> /// <param name="uri">The uri to to discover instantiated or supported data types from.</param> /// <param name="scope">The scope to return supported types for.</param> /// <param name="returnEmptyTypes">Whether the store should return data types that it supports but for which it currently has no data.</param> /// <param name="countObjects">if set to <c>true</c>, request object counts.</param> /// <param name="extension">The message header extension.</param> /// <returns>The sent message on success; <c>null</c> otherwise.</returns> public virtual EtpMessage <GetSupportedTypes> GetSupportedTypes(string uri, ContextScopeKind scope, bool returnEmptyTypes = false, bool countObjects = false, IMessageHeaderExtension extension = null) { var body = new GetSupportedTypes { Uri = uri ?? string.Empty, Scope = scope, ReturnEmptyTypes = returnEmptyTypes, CountObjects = countObjects, }; return(SendRequest(body, extension: extension)); }
/// <summary> /// Sends a FindResources message to a store. /// </summary> /// <param name="context">The context information.</param> /// <param name="scope">The scope.</param> /// <param name="storeLastWriteFilter">An optional parameter to filter discovery on a date when an object last changed.</param> /// <param name="activeStatusFilter">if not <c>null</c>, request only objects with a matching active status.</param> /// <param name="extension">The message header extension.</param> /// <returns>The sent message on success; <c>null</c> otherwise.</returns> public virtual EtpMessage <FindResources> FindResources(ContextInfo context, ContextScopeKind scope, DateTime?storeLastWriteFilter = null, ActiveStatusKind?activeStatusFilter = null, IMessageHeaderExtension extension = null) { var body = new FindResources { Context = context, Scope = scope, StoreLastWriteFilter = storeLastWriteFilter, ActiveStatusFilter = activeStatusFilter, }; return(SendRequest(body, extension: extension)); }
/// <summary> /// Sends a GetResources message to a store. /// </summary> /// <param name="context">The context information.</param> /// <param name="scope">The scope.</param> /// <param name="storeLastWriteFilter">An optional parameter to filter discovery on a date when an object last changed.</param> /// <param name="activeStatusFilter">if not <c>null</c>, request only objects with a matching active status.</param> /// <param name="includeEdges">if set to <c>true</c>, request edges.</param> /// <param name="countObjects">if set to <c>true</c>, request object counts.</param> /// <param name="extension">The message header extension.</param> /// <returns>The sent message on success; <c>null</c> otherwise.</returns> public virtual EtpMessage <GetResources> GetResources(ContextInfo context, ContextScopeKind scope, DateTime?storeLastWriteFilter = null, ActiveStatusKind?activeStatusFilter = null, bool includeEdges = false, bool countObjects = false, IMessageHeaderExtension extension = null) { var body = new GetResources { Context = context, Scope = scope, StoreLastWriteFilter = storeLastWriteFilter, ActiveStatusFilter = activeStatusFilter, IncludeEdges = includeEdges, CountObjects = countObjects, }; return(SendRequest(body, extension: extension)); }
/// <summary> /// Sends a GetGraphResources message to a store. /// </summary> /// <param name="contextInfo">The context information.</param> /// <param name="scope">The scope.</param> /// <param name="groupByType">if set to <c>true</c> group by type.</param> /// <returns>The message identifier.</returns> public virtual long GetGraphResources(ContextInfo contextInfo, ContextScopeKind scope, bool groupByType) { var header = CreateMessageHeader(Protocols.Discovery, MessageTypes.Discovery.GetGraphResources); var getResources = new GetGraphResources { Context = contextInfo, Scope = scope, GroupByType = groupByType }; return(Session.SendMessage(header, getResources, h => _requests[h.MessageId] = contextInfo.Uri // Cache requested URIs by message ID )); }
/// <summary> /// Sends a FindDataObjects message to a store. /// </summary> /// <param name="context">The context information.</param> /// <param name="scope">The scope.</param> /// <param name="storeLastWriteFilter">An optional parameter to filter results on a date when an object last changed.</param> /// <param name="activeStatusFilter">if not <c>null</c>, request only objects with a matching active status.</param> /// <param name="format">The format of the data (XML or JSON).</param> /// <param name="extension">The message header extension.</param> /// <returns>The sent message on success; <c>null</c> otherwise.</returns> public virtual EtpMessage <FindDataObjects> FindDataObjects(ContextInfo context, ContextScopeKind scope, DateTime?storeLastWriteFilter = null, ActiveStatusKind?activeStatusFilter = null, string format = Formats.Xml, IMessageHeaderExtension extension = null) { var body = new FindDataObjects { Context = context, Scope = scope, StoreLastWriteFilter = storeLastWriteFilter, ActiveStatusFilter = activeStatusFilter, Format = format ?? Formats.Xml, }; return(SendRequest(body, extension: extension)); }