se.citerus.dddsample.domain.model.handling
Class HandlingEvent
java.lang.Object
se.citerus.dddsample.domain.model.handling.HandlingEvent
- All Implemented Interfaces:
- DomainEvent<HandlingEvent>
public final class HandlingEvent
- extends java.lang.Object
- implements DomainEvent<HandlingEvent>
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 HandlingEvent's are sent from different Incident Logging Applications
some time after the event occured and contain information about the
TrackingId
, Location
, timestamp of the completion of the event,
and possibly, if applicable a Voyage
.
This class is the only member, and consequently the root, of the HandlingEvent aggregate.
HandlingEvent's could contain information about a Voyage
and if so,
the event type must be either HandlingEvent.Type.LOAD
or HandlingEvent.Type.UNLOAD
.
All other events must be of HandlingEvent.Type.RECEIVE
, HandlingEvent.Type.CLAIM
or HandlingEvent.Type.CUSTOMS
.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
HandlingEvent
public HandlingEvent(Cargo cargo,
java.util.Date completionTime,
java.util.Date registrationTime,
HandlingEvent.Type type,
Location location,
Voyage voyage)
- Parameters:
cargo
- cargocompletionTime
- completion time, the reported time that the event actually happened (e.g. the receive took place).registrationTime
- registration time, the time the message is receivedtype
- type of eventlocation
- where the event took placevoyage
- the voyage
HandlingEvent
public HandlingEvent(Cargo cargo,
java.util.Date completionTime,
java.util.Date registrationTime,
HandlingEvent.Type type,
Location location)
- Parameters:
cargo
- cargocompletionTime
- completion time, the reported time that the event actually happened (e.g. the receive took place).registrationTime
- registration time, the time the message is receivedtype
- type of eventlocation
- where the event took place
type
public HandlingEvent.Type type()
voyage
public Voyage voyage()
completionTime
public java.util.Date completionTime()
registrationTime
public java.util.Date registrationTime()
location
public Location location()
cargo
public Cargo cargo()
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
sameEventAs
public boolean sameEventAs(HandlingEvent other)
- Specified by:
sameEventAs
in interface DomainEvent<HandlingEvent>
- Parameters:
other
- The other domain event.
- Returns:
true
if the given domain event and this event are regarded as being the same event.
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2009. All Rights Reserved.