View Javadoc

1   package se.citerus.dddsample.application;
2   
3   import se.citerus.dddsample.domain.model.cargo.TrackingId;
4   import se.citerus.dddsample.domain.model.handling.CannotCreateHandlingEventException;
5   import se.citerus.dddsample.domain.model.handling.HandlingEvent;
6   import se.citerus.dddsample.domain.model.location.UnLocode;
7   import se.citerus.dddsample.domain.model.voyage.VoyageNumber;
8   
9   import java.util.Date;
10  
11  /**
12   * Handling event service.
13   */
14  public interface HandlingEventService {
15  
16    /**
17     * Registers a handling event in the system, and notifies interested
18     * parties that a cargo has been handled.
19     *
20     * @param completionTime when the event was completed
21     * @param trackingId cargo tracking id
22     * @param voyageNumber voyage number
23     * @param unLocode UN locode for the location where the event occurred
24     * @param type type of event
25     * @throws se.citerus.dddsample.domain.model.handling.CannotCreateHandlingEventException
26     *  if a handling event that represents an actual event that's relevant to a cargo we're tracking
27     *  can't be created from the parameters 
28     */
29    void registerHandlingEvent(Date completionTime,
30                               TrackingId trackingId,
31                               VoyageNumber voyageNumber,
32                               UnLocode unLocode,
33                               HandlingEvent.Type type) throws CannotCreateHandlingEventException;
34  
35  }