Using "notifyOf..." naming convention in ApplicationEvents.
HandlingEvents now have a unique sequence number, and CargoUpdater looks events based on that to update the cargo in question.
First version of pessimistic locking of cargo during rerouting.
Cargo is now a facade for aggregate-internal classes Delivery and Projections.
Delivery calculates current voyage, last known location and transport status on the fly.
Introduced a tracking id generator domain service for getting next tracking id, instead of doing it in the cargo repository.
Extracted a Projections value object in the Cargo aggregate, which handles predictions about the future of the cargo (next expected activity, ETA).
Migrating to a much cleaner way to propagate handling updates to the cargo aggregate: Cargo.handled(HandlingActivity).
Moved some logic into *Status enums, making them richer.
Improvements to a number of toString()s
Expanded voyage rescheduling scenario test to include the case where a voyage is rescheduled so that the old itinerary is no longer maintainable, and modified the domain model to handle that case.
HandlingEvent now has a HandlingActivity field internally. HaAct is moved to shared package, as it's being used persistently by both Cargo and HandlingEvent.
Also improved a few toString() methods and added a CargoFactoryTest.
Added loadCargoForRouting application service call, which will put a pessimistic lock on a cargo during (re-)routing in order to show benefits of aggregate separation explicitly. Not implemented yet though.
Collected all event-driven application services under the dddsample.application.event package and renamed CargoInspectionService to CargoDeliveryUpdater.
Made cargo delivery update cause an event to be published and subscribed to (and acted upon), instead of performing checks at the same time the delivery is updated.
Removed unused events from ApplicationEvents.
Removed programmatic JMS adapters in favor of Spring adadpters.
Eric- Changed behavior of Empty Itinerary to expect nothing. No event is appropriate for a Cargo with an empty itinerary, rather than any event being acceptable. Added tests for this into ItineraryTest. There was another test that depended on this behavior simply as a way to not have to populate the Itinerary the setup. That one is now a TODO.
Eric - Removed origin from Cargo. Now RouteSpecification is the only place with origin. Changed hibernate mappings to remove Cargo origin. Removed test that looked for case when Cargo origin was different from RouteSpecification origin. This rule isn't quite right. The rule should be that the origin cannot change after there is an event.
Eric - Fixed bug in CargoTrackingViewAdapterTest.java, which worked only for Central Europe Time.
Changed TrackingViewAdapter to show time in the time zone of the location of the event.
To do this, we added a TimeZone to the Location, which is passed into the constructor.
Added assertions to HandlingHistory that ensures that it refers to a unique cargo, and that a Cargo can't derive its delivery progress from a handling history of another cargo. There are also two descriptive static factory methods for the different possibilities of creating a HandlingHistory.
HandlingEventRepository now looks up handling events from Cargo instead of TrackingId.
Fixed a problem with Hibernate lazy proxies not being initialised when reading a field.