/// <summary> /// Copy constructor used for updates to avoid in memory update that would change "committed" state in the store before commit /// especially when the object is acquired through Get /// </summary> /// <param name="stableParameters"></param> internal OutboundStreamStableParameters(OutboundStreamStableParameters stableParameters) { // Init base parameters this.InitializeBaseParameters( StreamMetadataKind.OutboundStableParameters, stableParameters.StreamName, stableParameters.PartnerId, stableParameters.CurrentState, stableParameters.CloseMessageSequenceNumber); this.AcceptanceResponse = stableParameters.AcceptanceResponse; this.MessageQuota = stableParameters.MessageQuota; }
internal OutboundStreamStableParameters(Uri streamName, PartitionKey partnerId, int messageQuota) { // Init base parameters this.InitializeBaseParameters( StreamMetadataKind.OutboundStableParameters, streamName, partnerId, PersistentStreamState.Initialized, StreamConstants.InitialValueOfLastSequenceNumberInStream); this.AcceptanceResponse = StreamWireProtocolResponse.Unknown; this.MessageQuota = messageQuota; }
/// <summary> /// Cstor for InboundProtocolResponseValue /// Validate the payload for valid protocol response and store. /// </summary> /// <param name="inboundStreamMessage"></param> /// <param name="expectedType"></param> internal InboundProtocolResponseValue(InboundBaseStreamWireMessage inboundStreamMessage, StreamWireProtocolMessageKind expectedType) { Diagnostics.Assert( inboundStreamMessage.Kind == expectedType, "Unexpected StreamWireProtocolMessageKind in InboundBaseStreamWireMessage used to construct InboundProtocolResponseValue"); Diagnostics.Assert( inboundStreamMessage.Payload != null, "null ProtocolResponseValue payload in InboundBaseStreamWireMessage used to construct InboundProtocolResponseValue"); Diagnostics.Assert( inboundStreamMessage.Payload.Length == sizeof(int), "payload in InboundBaseStreamWireMessage used to construct InboundProtocolResponseValue contains more than ProtocolResponseValue"); // Store appropriate decoded Protocol Response this.Response = (StreamWireProtocolResponse)BitConverter.ToInt32(inboundStreamMessage.Payload, 0); }
internal OutboundDeleteStreamResponseWireMessage(Guid streamId, StreamWireProtocolResponse response) : base(streamId, StreamWireProtocolMessageKind.DeleteStreamResponse, response) { }
internal OutboundResetPartnerStreamsResponseWireMessage(Guid era, StreamWireProtocolResponse response) : base(era, StreamWireProtocolMessageKind.ResetPartnerStreamsResponse, response) { }
internal OutboundProtocolResponseWireMessage(Guid streamId, StreamWireProtocolMessageKind messageKind, StreamWireProtocolResponse response) : base(messageKind, streamId, StreamConstants.StreamProtocolResponseMessageSequenceNumber) { this.Payload = BitConverter.GetBytes((int)response); }