Package com.saasovation.common.event.sourcing

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


    @Override
    public Discussion discussionOfId(Tenant aTenant, DiscussionId aDiscussionId) {
        // snapshots not currently supported; always use version 1

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

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

        Discussion Discussion = new Discussion(eventStream.events(), eventStream.version());
View Full Code Here


        return new DiscussionId(UUID.randomUUID().toString().toUpperCase());
    }

    @Override
    public void save(Discussion aDiscussion) {
        EventStreamId eventId =
                new EventStreamId(
                        aDiscussion.tenant().id(),
                        aDiscussion.discussionId().id(),
                        aDiscussion.mutatedVersion());

        this.eventStore().appendWith(eventId, aDiscussion.mutatingEvents());
View Full Code Here

    @Override
    public Forum forumOfId(Tenant aTenant, ForumId aForumId) {
        // snapshots not currently supported; always use version 1

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

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

        Forum forum = new Forum(eventStream.events(), eventStream.version());
View Full Code Here

        return new ForumId(UUID.randomUUID().toString().toUpperCase());
    }

    @Override
    public void save(Forum aForum) {
        EventStreamId eventId =
                new EventStreamId(
                        aForum.tenant().id(),
                        aForum.forumId().id(),
                        aForum.mutatedVersion());

        this.eventStore().appendWith(eventId, aForum.mutatingEvents());
View Full Code Here

    @Override
    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());
View Full Code Here

        return new PostId(UUID.randomUUID().toString().toUpperCase());
    }

    @Override
    public void save(Post aPost) {
        EventStreamId eventId =
                new EventStreamId(
                        aPost.tenant().id(),
                        aPost.postId().id(),
                        aPost.mutatedVersion());

        this.eventStore().appendWith(eventId, aPost.mutatingEvents());
View Full Code Here

    @Override
    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());
View Full Code Here

        return new CalendarEntryId(UUID.randomUUID().toString().toUpperCase());
    }

    @Override
    public void save(CalendarEntry aCalendarEntry) {
        EventStreamId eventId =
                new EventStreamId(
                        aCalendarEntry.tenant().id(),
                        aCalendarEntry.calendarEntryId().id(),
                        aCalendarEntry.mutatedVersion());

        this.eventStore().appendWith(eventId, aCalendarEntry.mutatingEvents());
View Full Code Here

    @Override
    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());
View Full Code Here

        return new CalendarId(UUID.randomUUID().toString().toUpperCase());
    }

    @Override
    public void save(Calendar aCalendar) {
        EventStreamId eventId =
                new EventStreamId(
                        aCalendar.tenant().id(),
                        aCalendar.calendarId().id(),
                        aCalendar.mutatedVersion());

        this.eventStore().appendWith(eventId, aCalendar.mutatingEvents());
View Full Code Here

TOP

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

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.