Package com.saasovation.common.domain.model

Examples of com.saasovation.common.domain.model.DomainEvent


    private List<Notification> notificationsFrom(List<StoredEvent> aStoredEvents) {
        List<Notification> notifications =
            new ArrayList<Notification>(aStoredEvents.size());

        for (StoredEvent storedEvent : aStoredEvents) {
            DomainEvent domainEvent = storedEvent.toDomainEvent();

            Notification notification =
                new Notification(storedEvent.eventId(), domainEvent);

            notifications.add(notification);
View Full Code Here


    private List<Notification> notificationsFrom(List<StoredEvent> aStoredEvents) {
        List<Notification> notifications =
            new ArrayList<Notification>(aStoredEvents.size());

        for (StoredEvent storedEvent : aStoredEvents) {
            DomainEvent domainEvent = storedEvent.toDomainEvent();

            Notification notification =
                new Notification(storedEvent.eventId(), domainEvent);

            notifications.add(notification);
View Full Code Here

            return;
        }

//        System.out.println("Dispatching: " + aDispatchableDomainEvent.domainEvent().getClass().getSimpleName());

        DomainEvent domainEvent = aDispatchableDomainEvent.domainEvent();

        Class<? extends AbstractProjection> rootType = this.getClass();

        Class<? extends DomainEvent> eventType = domainEvent.getClass();

        String key = rootType.getName() + ":" + eventType.getName();

        Method mutatorMethod = projectionMethods.get(key);
View Full Code Here

            String eventBody = entry.value();

            Class<DomainEvent> eventClass =
                    (Class<DomainEvent>) Class.forName(eventClassName);

            DomainEvent domainEvent =
                    this.serializer().deserialize(eventBody, eventClass);

            events.add(domainEvent);
        }
View Full Code Here

            String eventBody = entry.value();

            Class<DomainEvent> eventClass =
                    (Class<DomainEvent>) Class.forName(eventClassName);

            DomainEvent domainEvent =
                    this.serializer().deserialize(eventBody, eventClass);

            events.add(new DispatchableDomainEvent(entry.journalSequence(), domainEvent));
        }
View Full Code Here

        assertEquals(2, eventStream.version());
        assertEquals(2, eventStream.events().size());

        for (int idx = 1; idx <= 2; ++idx) {
            DomainEvent domainEvent = eventStream.events().get(idx - 1);

            assertEquals(idx, ((TestableDomainEvent) domainEvent).id());
        }
    }
View Full Code Here

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

            assertEquals(10, eventStream.version());
            assertEquals(10 - idx + 1, eventStream.events().size());

            DomainEvent domainEvent = eventStream.events().get(0);

            assertEquals(idx, ((TestableDomainEvent) domainEvent).id());
        }

        try {
View Full Code Here

        assertEquals(4, eventStream.version());
        assertEquals(4, eventStream.events().size());

        for (int idx = 1; idx <= 4; ++idx) {
            DomainEvent domainEvent = eventStream.events().get(idx - 1);

            assertEquals(idx, ((TestableDomainEvent) domainEvent).id());
        }
    }
View Full Code Here

        assertEquals(2, eventStream.version());
        assertEquals(2, eventStream.events().size());

        for (int idx = 1; idx <= 2; ++idx) {
            DomainEvent domainEvent = eventStream.events().get(idx - 1);

            assertEquals(idx, ((TestableDomainEvent) domainEvent).id());
        }
    }
View Full Code Here

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

            assertEquals(10, eventStream.version());
            assertEquals(10 - idx + 1, eventStream.events().size());

            DomainEvent domainEvent = eventStream.events().get(0);

            assertEquals(idx, ((TestableDomainEvent) domainEvent).id());
        }

        try {
View Full Code Here

TOP

Related Classes of com.saasovation.common.domain.model.DomainEvent

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.