|
|
@@ -8,12 +8,20 @@ import java.util.Comparator;
|
|
8
|
8
|
import java.util.Date;
|
|
9
|
9
|
|
|
10
|
10
|
/**
|
|
11
|
|
- * A HandlingEvent is used to register the event when, for instance, a cargo is unloaded from a carrier at a some loacation at a given time. The
|
|
12
|
|
- * HandlingEvent's are sent from different Incident Logging Applications some time after the event occured and contain information about the
|
|
13
|
|
- * {@link TrackingId}, {@link Location}, timestamp of the completion of the event, and possibly, if applicable a {@link CarrierMovement}.
|
|
14
|
|
- * <br><br>
|
|
15
|
|
- * HandlingEvent's could contain information about a {@link CarrierMovement} and if so, the event type must be either {@link Type#LOAD} or
|
|
16
|
|
- * {@link Type#UNLOAD}. All other events must be of {@link Type#RECEIVE}, {@link Type#CLAIM} or {@link Type#CUSTOMS}.
|
|
|
11
|
+ * A HandlingEvent is used to register the event when, for instance,
|
|
|
12
|
+ * a cargo is unloaded from a carrier at a some loacation at a given time.
|
|
|
13
|
+ * <p/>
|
|
|
14
|
+ * The HandlingEvent's are sent from different Incident Logging Applications
|
|
|
15
|
+ * some time after the event occured and contain information about the
|
|
|
16
|
+ * {@link TrackingId}, {@link Location}, timestamp of the completion of the event,
|
|
|
17
|
+ * and possibly, if applicable a {@link CarrierMovement}.
|
|
|
18
|
+ * <p/>
|
|
|
19
|
+ * This class is the only member, and consequently the root, of the HandlingEvent aggregate.
|
|
|
20
|
+ * <p/>
|
|
|
21
|
+ * HandlingEvent's could contain information about a {@link CarrierMovement} and if so,
|
|
|
22
|
+ * the event type must be either {@link Type#LOAD} or {@link Type#UNLOAD}.
|
|
|
23
|
+ * <p/>
|
|
|
24
|
+ * All other events must be of {@link Type#RECEIVE}, {@link Type#CLAIM} or {@link Type#CUSTOMS}.
|
|
17
|
25
|
*/
|
|
18
|
26
|
public final class HandlingEvent implements DomainEvent<HandlingEvent> {
|
|
19
|
27
|
|
|
|
@@ -33,6 +41,10 @@ public final class HandlingEvent implements DomainEvent<HandlingEvent> {
|
|
33
|
41
|
private Date registrationTime;
|
|
34
|
42
|
private Cargo cargo;
|
|
35
|
43
|
|
|
|
44
|
+ /**
|
|
|
45
|
+ * Handling event type. Either requires or prohibits a carrier movement
|
|
|
46
|
+ * association, it's never optional.
|
|
|
47
|
+ */
|
|
36
|
48
|
public enum Type {
|
|
37
|
49
|
LOAD(true),
|
|
38
|
50
|
UNLOAD(true),
|
|
|
@@ -45,7 +57,7 @@ public final class HandlingEvent implements DomainEvent<HandlingEvent> {
|
|
45
|
57
|
/**
|
|
46
|
58
|
* Private enum constructor.
|
|
47
|
59
|
*
|
|
48
|
|
- * @param carrierMovementRequired Required status.
|
|
|
60
|
+ * @param carrierMovementRequired whether or not a carrier movement is associated with this event type
|
|
49
|
61
|
*/
|
|
50
|
62
|
private Type(final boolean carrierMovementRequired) {
|
|
51
|
63
|
this.carrierMovementRequired = carrierMovementRequired;
|