Beispiel #1
0
 private static ClientMessage.ReadStreamEventsForwardCompleted NoData(ClientMessage.ReadStreamEventsForward msg,
                                                                      ReadStreamResult result, long lastCommitPosition, long lastEventNumber = -1, string error = null)
 {
     return(new ClientMessage.ReadStreamEventsForwardCompleted(
                msg.CorrelationId, msg.EventStreamId, msg.FromEventNumber, msg.MaxCount, result,
                EmptyRecords, null, false, error ?? string.Empty, -1, lastEventNumber, true, lastCommitPosition));
 }
Beispiel #2
0
            public ReadStreamEventsForwardCompleted(Guid correlationId, string eventStreamId, int fromEventNumber, int maxCount,
                                                    ReadStreamResult result, ResolvedEvent[] events,
                                                    StreamMetadata streamMetadata, bool isCachePublic,
                                                    string error, int nextEventNumber, int lastEventNumber, bool isEndOfStream,
                                                    long tfLastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                if (result != ReadStreamResult.Success)
                {
                    Ensure.Equal(nextEventNumber, -1, "nextEventNumber");
                    Ensure.Equal(isEndOfStream, true, "isEndOfStream");
                }

                CorrelationId   = correlationId;
                EventStreamId   = eventStreamId;
                FromEventNumber = fromEventNumber;
                MaxCount        = maxCount;

                Result               = result;
                Events               = events;
                StreamMetadata       = streamMetadata;
                IsCachePublic        = isCachePublic;
                Error                = error;
                NextEventNumber      = nextEventNumber;
                LastEventNumber      = lastEventNumber;
                IsEndOfStream        = isEndOfStream;
                TfLastCommitPosition = tfLastCommitPosition;
            }
Beispiel #3
0
 public static ReadStreamEventsBackwardCompleted NoData(ReadStreamResult result, Guid correlationId, string eventStreamId,
                                                        int fromEventNumber, int maxCount, long lastCommitPosition, string message = null)
 {
     return(new ReadStreamEventsBackwardCompleted(correlationId, eventStreamId, fromEventNumber, maxCount,
                                                  result, EmptyRecords, null, false, message ?? string.Empty,
                                                  -1, -1, true, lastCommitPosition));
 }
        private void HandleDeletedStream(string stream, long sequenceNumber, ReadStreamResult result)
        {
            var correlationId = _consumer.HandledMessages.OfType <ClientMessage.ReadStreamEventsForward>().Last(x => x.EventStreamId == stream).CorrelationId;

            _edp.Handle(
                new ClientMessage.ReadStreamEventsForwardCompleted(
                    correlationId, stream, sequenceNumber, 100, result, new ResolvedEvent[] {}, null, false, "", -1, sequenceNumber, true, 200)
                );
        }
            public ReadStreamEventsBackwardCompleted(Guid correlationId,
                                                     string eventStreamId,
                                                     int fromEventNumber,
                                                     int maxCount,
                                                     ReadStreamResult result,
                                                     ResolvedEvent[] events,
                                                     StreamMetadata streamMetadata,
                                                     bool isCachePublic,
                                                     string error,
                                                     int nextEventNumber,
                                                     int lastEventNumber,
                                                     bool isEndOfStream,
                                                     long tfLastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                if (result != ReadStreamResult.Success)
                {
                    Ensure.Equal(nextEventNumber, -1, "nextEventNumber");
                    Ensure.Equal(isEndOfStream, true, "isEndOfStream");
                }

                CorrelationId = correlationId;
                EventStreamId = eventStreamId;
                FromEventNumber = fromEventNumber;
                MaxCount = maxCount;

                Result = result;
                Events = events;
                StreamMetadata = streamMetadata;
                IsCachePublic = isCachePublic;
                Error = error;
                NextEventNumber = nextEventNumber;
                LastEventNumber = lastEventNumber;
                IsEndOfStream = isEndOfStream;
                TfLastCommitPosition = tfLastCommitPosition;
            }
Beispiel #6
0
 private static ClientMessage.ReadStreamEventsBackwardCompleted NoData(ClientMessage.ReadStreamEventsBackward msg, ReadStreamResult result, long lastCommitPosition, string error = null)
 {
     return(ClientMessage.ReadStreamEventsBackwardCompleted.NoData(
                result, msg.CorrelationId, msg.EventStreamId, msg.FromEventNumber, msg.MaxCount, lastCommitPosition, error));
 }
            public ReadStreamEventsBackwardCompleted(Guid correlationId,
                                                     string eventStreamId,
                                                     int fromEventNumber,
                                                     int maxCount,
                                                     ReadStreamResult result,
                                                     ResolvedEvent[] events,
                                                     string message,
                                                     int nextEventNumber,
                                                     int lastEventNumber,
                                                     bool isEndOfStream,
                                                     long lastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                if (result != ReadStreamResult.Success)
                {
                    Ensure.Equal(nextEventNumber, -1, "nextEventNumber");
                    Ensure.Equal(lastEventNumber, -1, "lastEventNumber");
                    Ensure.Equal(isEndOfStream, true, "isEndOfStream");
                }

                CorrelationId = correlationId;
                EventStreamId = eventStreamId;
                FromEventNumber = fromEventNumber;
                MaxCount = maxCount;

                Result = result;
                Events = events;
                Message = message;
                NextEventNumber = nextEventNumber;
                LastEventNumber = lastEventNumber;
                IsEndOfStream = isEndOfStream;
                LastCommitPosition = lastCommitPosition;
            }
Beispiel #8
0
 public static ReadStreamEventsBackwardCompleted NoData(ReadStreamResult result, Guid correlationId, string eventStreamId,
                                                        int fromEventNumber, int maxCount, long lastCommitPosition, string message = null)
 {
     return new ReadStreamEventsBackwardCompleted(correlationId, eventStreamId, fromEventNumber, maxCount,
                                                  result, EmptyRecords, null, message ?? string.Empty,
                                                  -1, -1, true, lastCommitPosition);
 }