Exemplo n.º 1
0
        /// <summary>
        /// Sends a GetDataObjectsResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="dataObjects">The data objects.</param>
        /// <param name="isFinalPart">Whether or not this is the final part of a multi-part message.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <GetDataObjectsResponse> GetDataObjectsResponse(IMessageHeader correlatedHeader, IDictionary <string, DataObject> dataObjects, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new GetDataObjectsResponse
            {
                DataObjects = dataObjects ?? new Dictionary <string, DataObject>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sends an GetDataObjectsResponse message to a customer.
        /// </summary>
        /// <param name="correlationId">The correlation identifier.</param>
        /// <param name="dataObjects">The data objects.</param>
        /// <param name="errors">The errors.</param>
        /// <param name="messageFlag">The message flag.</param>
        /// <returns>The message identifier.</returns>
        public virtual long GetDataObjectsResponse(long correlationId, IList <DataObject> dataObjects, IList <ErrorInfo> errors, MessageFlags messageFlag = MessageFlags.MultiPartAndFinalPart)
        {
            var header = CreateMessageHeader(Protocols.Store, MessageTypes.Store.GetDataObjectsResponse, correlationId, messageFlag);

            var response = new GetDataObjectsResponse
            {
                DataObjects = dataObjects,
                Errors      = errors
            };

            return(Session.SendMessage(header, response));
        }
 /// <summary>
 /// Handles the GetDataObjectsResponse message from a store.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="response">The GetDataObjectsResponse message.</param>
 protected virtual void HandleGetDataObjectsResponse(IMessageHeader header, GetDataObjectsResponse response)
 {
     Notify(OnGetDataObjectsResponse, header, response);
 }