/// <summary>
        /// Handles the GetGraphResources message from a customer.
        /// </summary>
        /// <param name="header">The message header.</param>
        /// <param name="getGraphResources">The GetGraphResources message.</param>
        protected virtual void HandleGetGraphResources(IMessageHeader header, GetGraphResources getGraphResources)
        {
            var args = Notify(OnGetGraphResources, header, getGraphResources, new List <Resource>());

            HandleGetGraphResources(args);

            if (!args.Cancel)
            {
                GetResourcesResponse(header, args.Context);
            }
        }
        /// <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
                                       ));
        }