/// <summary> /// Sends a PartsReplacedByRange message to a customer. /// </summary> /// <param name="request">The request.</param> /// <param name="uri">The URI.</param> /// <param name="uid">The uid.</param> /// <param name="contentType">The content type.</param> /// <param name="data">The data.</param> /// <param name="startIndex">The start index.</param> /// <param name="endIndex">The end index.</param> /// <param name="uom">The unit of measure.</param> /// <param name="depthDatum">The depth datum.</param> /// <param name="includeOverlappingIntervals"><c>true</c> if overlapping intervals should be included; otherwise, <c>false</c>.</param> /// <param name="changeTime">The change time.</param> /// <returns>The message identifier.</returns> public long PartsReplacedByRange(IMessageHeader request, string uri, string uid, string contentType, byte[] data, object startIndex, object endIndex, string uom, string depthDatum, bool includeOverlappingIntervals, long changeTime) { var header = CreateMessageHeader(Protocols.GrowingObjectNotification, MessageTypes.GrowingObjectNotification.PartsReplacedByRange, request.MessageId); var message = new PartsReplacedByRange { Uri = uri, Uid = uid, ContentType = contentType, Data = data, DeletedInterval = new IndexInterval { StartIndex = new IndexValue { Item = startIndex }, EndIndex = new IndexValue { Item = endIndex }, Uom = uom ?? string.Empty, DepthDatum = depthDatum ?? string.Empty }, IncludeOverlappingIntervals = includeOverlappingIntervals, ChangeTime = changeTime }; return(Session.SendMessage(header, message)); }
/// <summary> /// Sends a PartsReplacedByRange message to a customer. /// </summary> /// <param name="requestUuid">The request UUID.</param> /// <param name="uri">The URI.</param> /// <param name="deletedInterval">The index interval for the deleted range.</param> /// <param name="includeOverlappingIntervals"><c>true</c> if overlapping intervals were included; otherwise, <c>false</c>.</param> /// <param name="parts">The map of UIDs and data of the parts that were put.</param> /// <param name="changeTime">The change time.</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 <PartsReplacedByRange> PartsReplacedByRange(Guid requestUuid, string uri, IndexInterval deletedInterval, bool includeOverlappingIntervals, IList <ObjectPart> parts, DateTime changeTime, string format = Formats.Xml, bool isFinalPart = true, IMessageHeaderExtension extension = null) { var body = new PartsReplacedByRange { RequestUuid = requestUuid, Uri = uri ?? string.Empty, DeletedInterval = deletedInterval, IncludeOverlappingIntervals = includeOverlappingIntervals, Parts = parts ?? new List <ObjectPart>(), Format = format ?? Formats.Xml, ChangeTime = changeTime, }; return(SendNotification(body, extension: extension, isMultiPart: true, isFinalPart: isFinalPart)); }
/// <summary> /// Handles the PartsReplacedByRange message from a store. /// </summary> /// <param name="header">The message header.</param> /// <param name="notification">The PartsReplacedByRange message.</param> protected virtual void HandlePartsReplacedByRange(IMessageHeader header, PartsReplacedByRange notification) { Notify(OnPartsReplacedByRange, header, notification); }