Currently the life cycle of a reservation is bound to the life cycle of an instance of the Reservation interface and the other way around. The current states correspond to the states of a Guava Service instance (new, starting, running, shutting down and terminated) and there are two life cycle events being propagated over the PortalEventBus: ReservationStartedEvent and ReservationEndedEvent.
After fixing the life cycle of the reservation (domain logic) should have the following states:
scheduled (after making a reservation in the RS)
running
ended
cancelled
State transitions into cancelled can occur from both scheduled and running. The cancelled state also contains the timestamp of the cancellation making it the effective end time of the reservation so that reserved resources can be reused again.
For every transition in the state machine there shall be pre- and post-transition events fired:
Currently the life cycle of a reservation is bound to the life cycle of an instance of the
Reservation
interface and the other way around. The current states correspond to the states of a Guava Service instance (new, starting, running, shutting down and terminated) and there are two life cycle events being propagated over the PortalEventBus:ReservationStartedEvent
andReservationEndedEvent
.After fixing the life cycle of the reservation (domain logic) should have the following states:
scheduled
(after making a reservation in the RS)running
ended
cancelled
State transitions into cancelled can occur from both
scheduled
andrunning
. Thecancelled
state also contains the timestamp of the cancellation making it the effective end time of the reservation so that reserved resources can be reused again.For every transition in the state machine there shall be pre- and post-transition events fired:
ReservationMadeEvent
ReservationStartingEvent
ReservationStartedEvent
ReservationCancellingEvent
ReservationCancelledEvent
ReservationEndingEvent
ReservationEndedEvent