se.citerus.dddsample.application.impl
Class BookingServiceImpl

java.lang.Object
  extended by se.citerus.dddsample.application.impl.BookingServiceImpl
All Implemented Interfaces:
BookingService

public final class BookingServiceImpl
extends java.lang.Object
implements BookingService


Constructor Summary
BookingServiceImpl(CargoRepository cargoRepository, LocationRepository locationRepository, RoutingService routingService)
           
 
Method Summary
 void assignCargoToRoute(Itinerary itinerary, TrackingId trackingId)
           
 TrackingId bookNewCargo(UnLocode originUnLocode, UnLocode destinationUnLocode, java.util.Date arrivalDeadline)
          Registers a new cargo in the tracking system, not yet routed.
 void changeDestination(TrackingId trackingId, UnLocode unLocode)
          Changes the destination of a cargo.
 java.util.List<Itinerary> requestPossibleRoutesForCargo(TrackingId trackingId)
          Requests a list of itineraries describing possible routes for this cargo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BookingServiceImpl

public BookingServiceImpl(CargoRepository cargoRepository,
                          LocationRepository locationRepository,
                          RoutingService routingService)
Method Detail

bookNewCargo

@Transactional
public TrackingId bookNewCargo(UnLocode originUnLocode,
                                             UnLocode destinationUnLocode,
                                             java.util.Date arrivalDeadline)
Description copied from interface: BookingService
Registers a new cargo in the tracking system, not yet routed.

Specified by:
bookNewCargo in interface BookingService
Parameters:
originUnLocode - cargo origin
destinationUnLocode - cargo destination
arrivalDeadline - arrival deadline
Returns:
Cargo tracking id

requestPossibleRoutesForCargo

@Transactional
public java.util.List<Itinerary> requestPossibleRoutesForCargo(TrackingId trackingId)
Description copied from interface: BookingService
Requests a list of itineraries describing possible routes for this cargo.

Specified by:
requestPossibleRoutesForCargo in interface BookingService
Parameters:
trackingId - cargo tracking id
Returns:
A list of possible itineraries for this cargo

assignCargoToRoute

@Transactional
public void assignCargoToRoute(Itinerary itinerary,
                                             TrackingId trackingId)
Specified by:
assignCargoToRoute in interface BookingService
Parameters:
itinerary - itinerary describing the selected route
trackingId - cargo tracking id

changeDestination

@Transactional
public void changeDestination(TrackingId trackingId,
                                            UnLocode unLocode)
Description copied from interface: BookingService
Changes the destination of a cargo.

Specified by:
changeDestination in interface BookingService
Parameters:
trackingId - cargo tracking id
unLocode - UN locode of new destination


Copyright © 2009. All Rights Reserved.