Ejemplo n.º 1
0
            public ReadEventsFromTFCompleted(Guid correlationId, ResolvedEventRecord[] events, RangeReadResult result)
            {
                Ensure.NotNull(events, "events");

                CorrelationId = correlationId;
                Events        = events;
                Result        = result;
            }
Ejemplo n.º 2
0
        public ReadStreamResult(RangeReadResult result, EventRecord[] records, int nextEventNumber, int lastEventNumber, bool isEndOfStream)
        {
            Ensure.NotNull(records, "records");

            Result = result;
            Records = records;
            NextEventNumber = nextEventNumber;
            LastEventNumber = lastEventNumber;
            IsEndOfStream = isEndOfStream;
        }
Ejemplo n.º 3
0
 public ReadEventsForwardCompleted(Guid correlationId,
                                   string eventStreamId,
                                   EventRecord[] events,
                                   EventRecord[] linkToEvents,
                                   RangeReadResult result,
                                   int nextEventNumber,
                                   long?lastCommitPosition)
     : base(correlationId, eventStreamId, events, linkToEvents, result, nextEventNumber, lastCommitPosition)
 {
 }
Ejemplo n.º 4
0
        public ReadStreamResult(RangeReadResult result, EventRecord[] records, int nextEventNumber, int lastEventNumber, bool isEndOfStream)
        {
            Ensure.NotNull(records, "records");

            Result          = result;
            Records         = records;
            NextEventNumber = nextEventNumber;
            LastEventNumber = lastEventNumber;
            IsEndOfStream   = isEndOfStream;
        }
Ejemplo n.º 5
0
        public ReadStreamResult(RangeReadResult result)
        {
            if (result == RangeReadResult.Success)
                throw new ArgumentException(string.Format("Wrong RangeReadResult provided for failure constructor: {0}.", result), "result");

            Result = result;
            NextEventNumber = -1;
            LastEventNumber = -1;
            IsEndOfStream = false;
            Records = ReadIndex.EmptyRecords;
        }
Ejemplo n.º 6
0
            public ReadStreamEventsBackwardCompleted(string eventStreamId,
                                                     EventLinkPair[] events,
                                                     RangeReadResult result,
                                                     long?lastCommitPosition)
            {
                Ensure.NotNullOrEmpty(eventStreamId, "streamId");

                EventStreamId      = eventStreamId;
                Events             = events;
                Result             = (int)result;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 7
0
        public ReadStreamResult(RangeReadResult result)
        {
            if (result == RangeReadResult.Success)
            {
                throw new ArgumentException(string.Format("Wrong RangeReadResult provided for failure constructor: {0}.", result), "result");
            }

            Result          = result;
            NextEventNumber = -1;
            LastEventNumber = -1;
            IsEndOfStream   = false;
            Records         = ReadIndex.EmptyRecords;
        }
Ejemplo n.º 8
0
 public static SliceReadStatus Convert(RangeReadResult code)
 {
     switch (code)
     {
         case RangeReadResult.Success:
             return SliceReadStatus.Success;
         case RangeReadResult.NoStream:
             return SliceReadStatus.StreamNotFound;
         case RangeReadResult.StreamDeleted:
             return SliceReadStatus.StreamDeleted;
         default:
             throw new ArgumentOutOfRangeException("code");
     }
 }
Ejemplo n.º 9
0
            public ReadStreamEventsBackwardCompleted(Guid correlationId,
                                                     string eventStreamId,
                                                     EventLinkPair[] events,
                                                     RangeReadResult result,
                                                     int nextEventNumber,
                                                     long?lastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                CorrelationId      = correlationId;
                EventStreamId      = eventStreamId;
                Events             = events;
                Result             = result;
                NextEventNumber    = nextEventNumber;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 10
0
            public ReadEventsFromBeginningCompleted(Guid correlationId,
                                                    string eventStreamId,
                                                    EventRecord[] events,
                                                    EventRecord[] linkToEvents,
                                                    RangeReadResult result,
                                                    long?lastCommitPosition)
            {
                Ensure.NotNullOrEmpty(eventStreamId, "eventStreamId");

                CorrelationId      = correlationId.ToByteArray();
                EventStreamId      = eventStreamId;
                Events             = events;
                LinkToEvents       = linkToEvents;
                Result             = (int)result;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 11
0
        public static SliceReadStatus Convert(RangeReadResult code)
        {
            switch (code)
            {
            case RangeReadResult.Success:
                return(SliceReadStatus.Success);

            case RangeReadResult.NoStream:
                return(SliceReadStatus.StreamNotFound);

            case RangeReadResult.StreamDeleted:
                return(SliceReadStatus.StreamDeleted);

            default:
                throw new ArgumentOutOfRangeException("code");
            }
        }
Ejemplo n.º 12
0
            protected ReadEventsCompletedMessage(Guid correlationId,
                                                 string eventStreamId,
                                                 EventRecord[] events,
                                                 EventRecord[] linkToEvents,
                                                 RangeReadResult result,
                                                 int nextEventNumber,
                                                 long?lastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                CorrelationId      = correlationId;
                EventStreamId      = eventStreamId;
                Events             = events;
                LinkToEvents       = linkToEvents;
                Result             = result;
                NextEventNumber    = nextEventNumber;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 13
0
 public ReadResult(RangeReadResult result, EventRecord[] events)
 {
     Result = result;
     Events = events;
 }
Ejemplo n.º 14
0
            public ReadEventsFromBeginningCompleted(Guid correlationId,
                                                    string eventStreamId,
                                                    EventRecord[] events,
                                                    EventRecord[] linkToEvents,
                                                    RangeReadResult result,
                                                    long? lastCommitPosition)
            {
                Ensure.NotNullOrEmpty(eventStreamId, "eventStreamId");

                CorrelationId = correlationId.ToByteArray();
                EventStreamId = eventStreamId;
                Events = events;
                LinkToEvents = linkToEvents;
                Result = (int)result;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 15
0
 public ReadEventsForwardCompleted(Guid correlationId,
                                   string eventStreamId,
                                   EventRecord[] events,
                                   EventRecord[] linkToEvents,
                                   RangeReadResult result,
                                   int nextEventNumber,
                                   long? lastCommitPosition)
     : base(correlationId, eventStreamId, events, linkToEvents, result, nextEventNumber, lastCommitPosition)
 {
 }
Ejemplo n.º 16
0
            public ReadStreamEventsBackwardCompleted(string eventStreamId,
                                                     EventLinkPair[] events,
                                                     RangeReadResult result,
                                                     long? lastCommitPosition)
            {
                Ensure.NotNullOrEmpty(eventStreamId, "streamId");

                EventStreamId = eventStreamId;
                Events = events;
                Result = (int)result;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 17
0
            public ReadEventsFromTFCompleted(Guid correlationId, ResolvedEventRecord[] events, RangeReadResult result)
            {
                Ensure.NotNull(events, "events");

                CorrelationId = correlationId;
                Events = events;
                Result = result;
            }
Ejemplo n.º 18
0
            public ReadStreamEventsForwardCompleted(Guid correlationId,
                                                    string eventStreamId,
                                                    EventLinkPair[] events,
                                                    RangeReadResult result,
                                                    int nextEventNumber,
                                                    int lastEventNumber,
                                                    bool isEndOfStream,
                                                    long? lastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                CorrelationId = correlationId;
                EventStreamId = eventStreamId;
                Events = events;
                Result = result;
                NextEventNumber = nextEventNumber;
                LastEventNumber = lastEventNumber;
                IsEndOfStream = isEndOfStream;
                LastCommitPosition = lastCommitPosition;
            }
Ejemplo n.º 19
0
 public ReadResult(RangeReadResult result, EventRecord[] events)
 {
     Result = result;
     Events = events;
 }
Ejemplo n.º 20
0
            protected ReadEventsCompletedMessage(Guid correlationId, 
                                                 string eventStreamId, 
                                                 EventRecord[] events,
                                                 EventRecord[] linkToEvents,
                                                 RangeReadResult result, 
                                                 int nextEventNumber,
                                                 long? lastCommitPosition)
            {
                Ensure.NotNull(events, "events");

                CorrelationId = correlationId;
                EventStreamId = eventStreamId;
                Events = events;
                LinkToEvents = linkToEvents;
                Result = result;
                NextEventNumber = nextEventNumber;
                LastCommitPosition = lastCommitPosition;
            }