se.citerus.dddsample.domain.model.handling
Class HandlingEvent

java.lang.Object
  extended by 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.


Nested Class Summary
static class HandlingEvent.Type
          Handling event type.
 
Constructor Summary
HandlingEvent(Cargo cargo, java.util.Date completionTime, java.util.Date registrationTime, HandlingEvent.Type type, Location location)
           
HandlingEvent(Cargo cargo, java.util.Date completionTime, java.util.Date registrationTime, HandlingEvent.Type type, Location location, Voyage voyage)
           
 
Method Summary
 Cargo cargo()
           
 java.util.Date completionTime()
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 Location location()
           
 java.util.Date registrationTime()
           
 boolean sameEventAs(HandlingEvent other)
           
 java.lang.String toString()
           
 HandlingEvent.Type type()
           
 Voyage voyage()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HandlingEvent

public HandlingEvent(Cargo cargo,
                     java.util.Date completionTime,
                     java.util.Date registrationTime,
                     HandlingEvent.Type type,
                     Location location,
                     Voyage voyage)
Parameters:
cargo - cargo
completionTime - completion time, the reported time that the event actually happened (e.g. the receive took place).
registrationTime - registration time, the time the message is received
type - type of event
location - where the event took place
voyage - the voyage

HandlingEvent

public HandlingEvent(Cargo cargo,
                     java.util.Date completionTime,
                     java.util.Date registrationTime,
                     HandlingEvent.Type type,
                     Location location)
Parameters:
cargo - cargo
completionTime - completion time, the reported time that the event actually happened (e.g. the receive took place).
registrationTime - registration time, the time the message is received
type - type of event
location - where the event took place
Method Detail

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.