Ejemplo n.º 1
0
        /// <summary>
        /// Sends a WMLS_GetVersion message to a store.
        /// </summary>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <WMLS_GetVersion> WMLS_GetVersion(IMessageHeaderExtension extension = null)
        {
            var body = new WMLS_GetVersion()
            {
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends a StopStreaming message to a producer.
        /// </summary>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <StopStreaming> StopStreaming(IMessageHeaderExtension extension = null)
        {
            var body = new StopStreaming
            {
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sends a WMLS_GetCap message to a store.
        /// </summary>
        /// <param name="optionsIn">The input options.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <WMLS_GetCap> WMLS_GetCap(string optionsIn, IMessageHeaderExtension extension = null)
        {
            var body = new WMLS_GetCap()
            {
                OptionsIn = optionsIn ?? string.Empty,
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Sends a ChannelData message to a consumer.
        /// </summary>
        /// <param name="data">The list of <see cref="DataItem" /> objects.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelData> ChannelData(IList <DataItem> data, IMessageHeaderExtension extension = null)
        {
            var body = new ChannelData()
            {
                Data = data ?? new List <DataItem>(),
            };

            return(SendData(body, extension: extension));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Sends a CancelGetFrame message to a store.
        /// </summary>
        /// <param name="requestUuid">The request UUID.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <CancelGetFrame> CancelGetFrame(Guid requestUuid, IMessageHeaderExtension extension = null)
        {
            var body = new CancelGetFrame()
            {
                RequestUuid = requestUuid,
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Decodes the message.
        /// </summary>
        /// <param name="header">The message header</param>
        /// <param name="extension">The header extension</param>
        /// <param name="decoder">The decoder with binary message data.</param>
        /// <returns>The message if successful; <c>null</c> otherwise.</returns>
        public EtpMessage DecodeMessage(IMessageHeader header, IMessageHeaderExtension extension, IAvroDecoder decoder)
        {
            var messageKey = EtpExtensions.CreateMessageKey(header.Protocol, header.MessageType);

            Func <IAvroDecoder, IMessageHeader, IMessageHeaderExtension, EtpMessage> messageDecoder;

            if (!MessageDecoders.TryGetValue(messageKey, out messageDecoder))
            {
                return(null);
            }

            return(messageDecoder(decoder, header, extension));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Sends an GetDataspacesResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="dataspaces">The dataspaces.</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 <GetDataspacesResponse> GetDataspacesResponse(IMessageHeader correlatedHeader, IList <Datatypes.Object.Dataspace> dataspaces, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new GetDataspacesResponse
            {
                Dataspaces = dataspaces ?? new List <Datatypes.Object.Dataspace>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Sends a FindPartsResponse message to a customer.
 /// </summary>
 /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
 /// <param name="uri">The URI from the request.</param>
 /// <param name="parts">The list of <see cref="ObjectPart"/> objects.</param>
 /// <param name="serverSortOrder">The sort order.</param>
 /// <param name="format">The format of the data (XML or JSON).</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 <FindPartsResponse> FindPartsResponse(IMessageHeader correlatedHeader, string uri, IList <ObjectPart> parts, string serverSortOrder, string format = Formats.Xml, bool isFinalPart = true, IMessageHeaderExtension extension = null)
 {
     return(FindPartsResponse(correlatedHeader, parts, new ResponseContext {
         Uri = uri, ServerSortOrder = serverSortOrder, Format = format
     }, isFinalPart: isFinalPart, extension: extension));
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Sends a FindPartsResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="parts">The list of <see cref="ObjectPart"/> objects.</param>
        /// <param name="context">The response context.</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 <FindPartsResponse> FindPartsResponse(IMessageHeader correlatedHeader, IList <ObjectPart> parts, ResponseContext context, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new FindPartsResponse
            {
                Uri             = context?.Uri ?? string.Empty,
                Format          = context?.Format ?? Formats.Xml,
                ServerSortOrder = context?.ServerSortOrder ?? string.Empty,
                Parts           = parts ?? new List <ObjectPart>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Sends a FindParts message to a store.
        /// </summary>
        /// <param name="uri">The URI.</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 <FindParts> FindParts(string uri, string format = Formats.Xml, IMessageHeaderExtension extension = null)
        {
            var body = new FindParts
            {
                Uri    = uri ?? string.Empty,
                Format = format ?? Formats.Xml,
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Sends a DeleteParts message to a store.
        /// </summary>
        /// <param name="uri">The URI of the parent object.</param>
        /// <param name="uids">The UIDs of the parts within the growing object to delete.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <DeleteParts> DeleteParts(string uri, IDictionary <string, string> uids, IMessageHeaderExtension extension = null)
        {
            var body = new DeleteParts
            {
                Uri  = uri ?? string.Empty,
                Uids = uids ?? new Dictionary <string, string>(),
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Sends a Chunk message to a customer as part of a multi-part GetDataObjectsResponse message.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="blobId">The blob ID.</param>
        /// <param name="data">The chunk data.</param>
        /// <param name="final">Whether or not this is the final chunk for the blob ID.</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 <Chunk> GetDataObjectsResponseChunk(IMessageHeader correlatedHeader, Guid blobId, byte[] data, bool final, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new Chunk
            {
                BlobId = blobId,
                Data   = data ?? new byte[0],
                Final  = final,
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Sends a DeleteDataObjectsResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="deletedUris">The deleted URIs.</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 <DeleteDataObjectsResponse> DeleteDataObjectsResponse(IMessageHeader correlatedHeader, IDictionary <string, ArrayOfString> deletedUris, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new DeleteDataObjectsResponse
            {
                DeletedUris = deletedUris ?? new Dictionary <string, ArrayOfString>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 14
0
        /// <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));
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Sends a PutGrowingDataObjectsHeader message to a store.
        /// </summary>
        /// <param name="dataObjects">The collection of data object headers.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <PutGrowingDataObjectsHeader> PutGrowingDataObjectsHeader(IDictionary <string, DataObject> dataObjects, IMessageHeaderExtension extension = null)
        {
            var body = new PutGrowingDataObjectsHeader
            {
                DataObjects = dataObjects ?? new Dictionary <string, DataObject>(),
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Sends a GetGrowingDataObjectsHeader message to a store.
 /// </summary>
 /// <param name="uris">The collection of growing object URIs.</param>
 /// <param name="format">The format of the response (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 <GetGrowingDataObjectsHeader> GetGrowingDataObjectsHeader(IList <string> uris, string format = Formats.Xml, IMessageHeaderExtension extension = null) => GetGrowingDataObjectsHeader(uris.ToMap(), format: format, extension: extension);
Ejemplo n.º 17
0
        /// <summary>
        /// Sends a GetGrowingDataObjectsHeader message to a store.
        /// </summary>
        /// <param name="uris">The collection of growing object URIs.</param>
        /// <param name="format">The format of the response (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 <GetGrowingDataObjectsHeader> GetGrowingDataObjectsHeader(IDictionary <string, string> uris, string format = Formats.Xml, IMessageHeaderExtension extension = null)
        {
            var body = new GetGrowingDataObjectsHeader
            {
                Uris   = uris ?? new Dictionary <string, string>(),
                Format = format ?? Formats.Xml,
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Sends a ReplacePartsByRange message to a store.
        /// </summary>
        /// <param name="uri">The URI of the parent object.</param>
        /// <param name="deleteInterval">The index interval to delete.</param>
        /// <param name="includeOverlappingIntervals"><c>true</c> if overlapping intervals should be included; otherwise, <c>false</c>.</param>
        /// <param name="parts">The map of UIDs and data of the parts being put.</param>
        /// <param name="format">The format of the data (XML or JSON).</param>
        /// <param name="isFinalPart">Whether or not this is the final part of a multi-part message.</param>
        /// <param name="correlatedHeader">The message header that the message to send is correlated with.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ReplacePartsByRange> ReplacePartsByRange(string uri, IndexInterval deleteInterval, bool includeOverlappingIntervals, IList <ObjectPart> parts, string format = Formats.Xml, bool isFinalPart = true, IMessageHeader correlatedHeader = null, IMessageHeaderExtension extension = null)
        {
            var body = new ReplacePartsByRange
            {
                Uri            = uri ?? string.Empty,
                Format         = format ?? Formats.Xml,
                DeleteInterval = deleteInterval,
                IncludeOverlappingIntervals = includeOverlappingIntervals,
                Parts = parts ?? new List <ObjectPart>(),
            };

            return(SendRequest(body, extension: extension, isMultiPart: true, correlatedHeader: correlatedHeader, isFinalPart: isFinalPart));
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Sends a DeleteParts message to a store.
 /// </summary>
 /// <param name="uri">The URI of the parent object.</param>
 /// <param name="uids">The UIDs of the parts within the growing object to delete.</param>
 /// <param name="extension">The message header extension.</param>
 /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
 public virtual EtpMessage <DeleteParts> DeleteParts(string uri, IList <string> uids, IMessageHeaderExtension extension = null) => DeleteParts(uri, uids.ToMap(), extension: extension);
Ejemplo n.º 20
0
        /// <summary>
        /// Sends a multi-part set of GetDataObjectsResponse and Chunk messages to a customer.
        /// If there are no data objects, an empty GetDataObjectsResponse message is sent.
        /// </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="chunks">The chunks.</param>
        /// <param name="setFinalPart">Whether or not the final part flag should be set on the last message.</param>
        /// <param name="responseExtension">The message header extension for the GetDataObjectsResponse message.</param>
        /// <param name="chunkExtensions">The message header extensions for the Chunk messages.</param>
        /// <returns>The first message sent in the response on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <GetDataObjectsResponse> GetDataObjectsResponse(IMessageHeader correlatedHeader, IDictionary <string, DataObject> dataObjects, IList <Chunk> chunks = null, bool setFinalPart = true, IMessageHeaderExtension responseExtension = null, IList <IMessageHeaderExtension> chunkExtensions = null)
        {
            var message = GetDataObjectsResponse(correlatedHeader, dataObjects, isFinalPart: ((chunks == null || chunks.Count == 0) && setFinalPart), extension: responseExtension);

            if (message == null)
            {
                return(null);
            }

            if (chunks?.Count > 0)
            {
                for (int i = 0; i < chunks.Count; i++)
                {
                    var ret = GetDataObjectsResponseChunk(correlatedHeader, chunks[i].BlobId, chunks[i].Data, chunks[i].Final, isFinalPart: (i == chunks.Count - 1 && setFinalPart), extension: i < chunkExtensions?.Count ? chunkExtensions[i] : null);
                    if (ret == null)
                    {
                        return(null);
                    }
                }
            }

            return(message);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Sends a complete multi-part set of GetDataObjectsResponse, Chunk and ProtocolException messages to a customer.
        /// If there are no data objects, an empty GetDataObjectsResponse message is sent.
        /// If there are no errors, no ProtocolException message is sent.
        /// </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="errors">The errors.</param>
        /// <param name="chunks">The chunks.</param>
        /// <param name="setFinalPart">Whether or not the final part flag should be set on the last message.</param>
        /// <param name="responseExtension">The message header extension for the GetDataObjectsResponse message.</param>
        /// <param name="chunkExtensions">The message header extensions for the Chunk messages.</param>
        /// <param name="exceptionExtension">The message header extension for the ProtocolException message.</param>
        /// <returns>The first message sent in the response on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <GetDataObjectsResponse> GetDataObjectsResponse(IMessageHeader correlatedHeader, IDictionary <string, DataObject> dataObjects, IDictionary <string, IErrorInfo> errors, IList <Chunk> chunks = null, bool setFinalPart = true, IMessageHeaderExtension responseExtension = null, IList <IMessageHeaderExtension> chunkExtensions = null, IMessageHeaderExtension exceptionExtension = null)
        {
            var message = GetDataObjectsResponse(correlatedHeader, dataObjects, chunks, setFinalPart: ((errors == null || errors.Count == 0) && setFinalPart), responseExtension: responseExtension, chunkExtensions: chunkExtensions);

            if (message == null)
            {
                return(null);
            }

            if (errors?.Count > 0)
            {
                var ret = ProtocolException(errors, correlatedHeader: correlatedHeader, setFinalPart: setFinalPart, extension: exceptionExtension);
                if (ret == null)
                {
                    return(null);
                }
            }

            return(message);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Sends a PutDataSubarraysResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="success">The successes.</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 <PutDataSubarraysResponse> PutDataSubarraysResponse(IMessageHeader correlatedHeader, IDictionary <string, string> success, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new PutDataSubarraysResponse
            {
                Success = success ?? new Dictionary <string, string>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 23
0
 /// <summary>
 /// Sends a complete multi-part set of DeleteDataObjectsResponse and ProtocolException messages to a customer.
 /// If there are no deleted URIs, an empty DeleteDataObjectsResponse message is sent.
 /// If there are no errors, no ProtocolException message is sent.
 /// </summary>
 /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
 /// <param name="deletedUris">The deleted URIs.</param>
 /// <param name="errors">The errors.</param>
 /// <param name="setFinalPart">Whether or not the final part flag should be set on the last message.</param>
 /// <param name="responseExtension">The message header extension for the DeleteDataObjectsResponse message.</param>
 /// <param name="exceptionExtension">The message header extension for the ProtocolException message.</param>
 /// <returns>The first message sent in the response on success; <c>null</c> otherwise.</returns>
 public virtual EtpMessage <DeleteDataObjectsResponse> DeleteDataObjectsResponse(IMessageHeader correlatedHeader, IDictionary <string, ArrayOfString> deletedUris, IDictionary <string, IErrorInfo> errors, bool setFinalPart = true, IMessageHeaderExtension responseExtension = null, IMessageHeaderExtension exceptionExtension = null)
 {
     return(SendMapResponse(DeleteDataObjectsResponse, correlatedHeader, deletedUris, errors, setFinalPart: setFinalPart, responseExtension: responseExtension, exceptionExtension: exceptionExtension));
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Sends a GetDataArrayMetadataResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="arrayMetadata">The array metadata.</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 <GetDataArrayMetadataResponse> GetDataArrayMetadataResponse(IMessageHeader correlatedHeader, IDictionary <string, DataArrayMetadata> arrayMetadata, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new GetDataArrayMetadataResponse
            {
                ArrayMetadata = arrayMetadata ?? new Dictionary <string, DataArrayMetadata>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Sends a GetDataSubarraysResponse message to a customer.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="dataSubarrays">The data subarrays.</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 <GetDataSubarraysResponse> GetDataSubarraysResponse(IMessageHeader correlatedHeader, IDictionary <string, Datatypes.DataArrayTypes.DataArray> dataSubarrays, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new GetDataSubarraysResponse
            {
                DataSubarrays = dataSubarrays ?? new Dictionary <string, Datatypes.DataArrayTypes.DataArray>(),
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Sends a PutParts message to a store.
 /// </summary>
 /// <param name="uri">The URI of the parent object.</param>
 /// <param name="parts">The UIDs and data of the parts being put.</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 <PutParts> PutParts(string uri, IList <ObjectPart> parts, string format = Formats.Xml, IMessageHeaderExtension extension = null) => PutParts(uri, parts.ToMap(), format: format, extension: extension);
Ejemplo n.º 27
0
 /// <summary>
 /// Sends a complete multi-part set of PutDataSubarraysResponse and ProtocolException messages to a customer.
 /// If there are no successes, an empty PutDataSubarraysResponse message is sent.
 /// If there are no errors, no ProtocolException message is sent.
 /// </summary>
 /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
 /// <param name="success">The successes.</param>
 /// <param name="errors">The errors.</param>
 /// <param name="setFinalPart">Whether or not the final part flag should be set on the last message.</param>
 /// <param name="responseExtension">The message header extension for the PutDataSubarraysResponse message.</param>
 /// <param name="exceptionExtension">The message header extension for the ProtocolException message.</param>
 /// <returns>The first message sent in the response on success; <c>null</c> otherwise.</returns>
 public virtual EtpMessage <PutDataSubarraysResponse> PutDataSubarraysResponse(IMessageHeader correlatedHeader, IDictionary <string, string> success, IDictionary <string, IErrorInfo> errors, bool setFinalPart = true, IMessageHeaderExtension responseExtension = null, IMessageHeaderExtension exceptionExtension = null)
 {
     return(SendMapResponse(PutDataSubarraysResponse, correlatedHeader, success, errors, setFinalPart: setFinalPart, responseExtension: responseExtension, exceptionExtension: exceptionExtension));
 }
Ejemplo n.º 28
0
        /// <summary>
        /// Sends a GetFrameMetadata message to a store.
        /// </summary>
        /// <param name="uri">The frame URI.</param>
        /// <param name="includeAllChannelSecondaryIndexes">Whether or not to include all channel secondary indexes.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <GetFrameMetadata> GetFrameMetadata(string uri, bool includeAllChannelSecondaryIndexes, IMessageHeaderExtension extension = null)
        {
            var body = new GetFrameMetadata()
            {
                Uri = uri ?? string.Empty,
                IncludeAllChannelSecondaryIndexes = includeAllChannelSecondaryIndexes,
            };

            return(SendRequest(body, extension: extension));
        }
Ejemplo n.º 29
0
 /// <summary>
 /// Sends a complete multi-part set of GetDataArrayMetadataResponse and ProtocolException messages to a customer.
 /// If there are no array metadata, an empty DataArrayMetadataRecord message is sent.
 /// If there are no errors, no ProtocolException message is sent.
 /// </summary>
 /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
 /// <param name="arrayMetadata">The array metadata.</param>
 /// <param name="errors">The errors.</param>
 /// <param name="setFinalPart">Whether or not the final part flag should be set on the last message.</param>
 /// <param name="responseExtension">The message header extension for the GetDataArrayMetadataResponse message.</param>
 /// <param name="exceptionExtension">The message header extension for the ProtocolException message.</param>
 /// <returns>The first message sent in the response on success; <c>null</c> otherwise.</returns>
 public virtual EtpMessage <GetDataArrayMetadataResponse> GetDataArrayMetadataResponse(IMessageHeader correlatedHeader, IDictionary <string, DataArrayMetadata> arrayMetadata, IDictionary <string, IErrorInfo> errors, bool setFinalPart = true, IMessageHeaderExtension responseExtension = null, IMessageHeaderExtension exceptionExtension = null)
 {
     return(SendMapResponse(GetDataArrayMetadataResponse, correlatedHeader, arrayMetadata, errors, setFinalPart: setFinalPart, responseExtension: responseExtension, exceptionExtension: exceptionExtension));
 }
Ejemplo n.º 30
0
        /// <summary>
        /// Sends a GetFrame message to a store.
        /// </summary>
        /// <param name="uri">The frame URI.</param>
        /// <param name="includeAllChannelSecondaryIndexes">Whether or not to include all channel secondary indexes.</param>
        /// <param name="requestedInterval">The requested interval.</param>
        /// <param name="requestedSecondaryIntervals">The requested secondary intervals.</param>
        /// <param name="requestUuid">The request UUID.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <GetFrame> GetFrame(string uri, bool includeAllChannelSecondaryIndexes, IndexInterval requestedInterval, IList <IndexInterval> requestedSecondaryIntervals, Guid requestUuid, IMessageHeaderExtension extension = null)
        {
            var body = new GetFrame()
            {
                Uri = uri ?? string.Empty,
                IncludeAllChannelSecondaryIndexes = includeAllChannelSecondaryIndexes,
                RequestedInterval           = requestedInterval,
                RequestedSecondaryIntervals = requestedSecondaryIntervals ?? new List <IndexInterval>(),
                RequestUuid = requestUuid,
            };

            return(SendRequest(body, extension: extension));
        }