Package com.saasovation.common.event.sourcing

Examples of com.saasovation.common.event.sourcing.EventStream


    public Post postOfId(Tenant aTenantId, PostId aPostId) {
        // snapshots not currently supported; always use version 1

        EventStreamId eventId = new EventStreamId(aTenantId.id(), aPostId.id());

        EventStream eventStream = this.eventStore().eventStreamSince(eventId);

        Post Post = new Post(eventStream.events(), eventStream.version());

        return Post;
    }
View Full Code Here


    public CalendarEntry calendarEntryOfId(Tenant aTenant, CalendarEntryId aCalendarEntryId) {
        // snapshots not currently supported; always use version 1

        EventStreamId eventId = new EventStreamId(aTenant.id(), aCalendarEntryId.id());

        EventStream eventStream = this.eventStore().eventStreamSince(eventId);

        CalendarEntry calendarEntry = new CalendarEntry(eventStream.events(), eventStream.version());

        return calendarEntry;
    }
View Full Code Here

    public Calendar calendarOfId(Tenant aTenant, CalendarId aCalendarId) {
        // snapshots not currently supported; always use version 1

        EventStreamId eventId = new EventStreamId(aTenant.id(), aCalendarId.id());

        EventStream eventStream = this.eventStore().eventStreamSince(eventId);

        Calendar calendar = new Calendar(eventStream.events(), eventStream.version());

        return calendar;
    }
View Full Code Here

            statement.setString(1, anIdentity.streamName());
            statement.setInt(2, anIdentity.streamVersion());

            result = statement.executeQuery();

            EventStream eventStream = this.buildEventStream(result);

            if (eventStream.version() == 0) {
                throw new EventStoreException(
                        "There is no such event stream: "
                        + anIdentity.streamName()
                        + " : "
                        + anIdentity.streamVersion());
View Full Code Here

TOP

Related Classes of com.saasovation.common.event.sourcing.EventStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.