Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
 internal OutboundDeleteStreamResponseWireMessage(Guid streamId, StreamWireProtocolResponse response)
     : base(streamId, StreamWireProtocolMessageKind.DeleteStreamResponse, response)
 {
 }
Ejemplo n.º 5
0
 internal OutboundResetPartnerStreamsResponseWireMessage(Guid era, StreamWireProtocolResponse response)
     : base(era, StreamWireProtocolMessageKind.ResetPartnerStreamsResponse, response)
 {
 }
Ejemplo n.º 6
0
 internal OutboundProtocolResponseWireMessage(Guid streamId, StreamWireProtocolMessageKind messageKind, StreamWireProtocolResponse response)
     : base(messageKind, streamId, StreamConstants.StreamProtocolResponseMessageSequenceNumber)
 {
     this.Payload = BitConverter.GetBytes((int)response);
 }