org.openwms.tms.domain.order
Class TransportOrder

java.lang.Object
  extended by org.openwms.core.domain.AbstractEntity
      extended by org.openwms.tms.domain.order.TransportOrder
All Implemented Interfaces:
Serializable, DomainObject<Long>

public class TransportOrder
extends AbstractEntity
implements DomainObject<Long>, Serializable

A TransportOrder is used to move TransportUnits from a current Location to a target Location.

Since:
0.1
Version:
$Revision: 1583 $
Author:
Heiko Scherrer
See Also:
TransportUnit, Location, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openwms.core.domain.AbstractEntity
AbstractEntity.AbstractEntityListener
 
Field Summary
static String NQ_FIND_ALL
          Query to find all TransportOrders.
static String NQ_FIND_BY_TU
          Query to find all TransportOrders for a certain TransportUnit.
static String NQ_FIND_FOR_TU_IN_STATE
          Query to find all TransportOrders for a particular TransportUnit in certain states.
 
Fields inherited from class org.openwms.core.domain.AbstractEntity
FIND_ALL, FIND_BY_ID
 
Constructor Summary
TransportOrder()
           
 
Method Summary
 Date getCreationDate()
          Returns the date when the TransportOrder was created.
 Date getDateUpdated()
          Get the date when the TransportOrder was changed last time.
 Date getEndDate()
          Get the endDate.
 Long getId()
          Return the technical key value.
 PriorityLevel getPriority()
          Returns the priority level of the TransportOrder.
 Problem getProblem()
          Get the last Problem.
 Location getSourceLocation()
          Get the sourceLocation.
 Date getStartDate()
          Returns the date when the TransportOrder was started.
 TransportOrderState getState()
          Returns the state of the TransportOrder.
 Location getTargetLocation()
          Get the target Location of this TransportOrder.
 LocationGroup getTargetLocationGroup()
          Get the targetLocationGroup.
 TransportUnit getTransportUnit()
          Get the TransportUnit assigned to the TransportOrder .
 long getVersion()
          Return the value of the optimistic locking field.
 boolean isNew()
          Check whether the instance is a transient or persisted one.
protected  void postUpdate()
          JPA Lifecycle callback method to set the dateUpdated property when the TransportOrder is being modified.
 void setPriority(PriorityLevel priority)
          Set the priority level of the TransportOrder.
 void setProblem(Problem problem)
          Set the last Problem.
 void setSourceLocation(Location sourceLocation)
          Set the sourceLocation.
 void setState(TransportOrderState newState)
          Change the state of the TransportOrder regarding some rules.
 void setTargetLocation(Location targetLocation)
          Set the target Location of this TransportOrder.
 void setTargetLocationGroup(LocationGroup targetLocationGroup)
          Set the targetLocationGroup.
 void setTransportUnit(TransportUnit transportUnit)
          Assign a TransportUnit to the TransportOrder.
protected  void validateStateChange(TransportOrderState newState)
          Validate whether a state change is valid or not.
 
Methods inherited from class org.openwms.core.domain.AbstractEntity
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NQ_FIND_ALL

public static final String NQ_FIND_ALL
Query to find all TransportOrders.

See Also:
Constant Field Values

NQ_FIND_BY_TU

public static final String NQ_FIND_BY_TU
Query to find all TransportOrders for a certain TransportUnit.
  • Query parameter name transportUnit : The TransportUnit to search for.
  • See Also:
    Constant Field Values

    NQ_FIND_FOR_TU_IN_STATE

    public static final String NQ_FIND_FOR_TU_IN_STATE
    Query to find all TransportOrders for a particular TransportUnit in certain states.
  • Query parameter name transportUnit : The TransportUnit to search for.
  • Query parameter name states : A list of TransportOrderStates.
  • See Also:
    Constant Field Values
    Constructor Detail

    TransportOrder

    public TransportOrder()
    Method Detail

    postUpdate

    protected void postUpdate()
    JPA Lifecycle callback method to set the dateUpdated property when the TransportOrder is being modified.


    getId

    public Long getId()
    Return the technical key value.

    Specified by:
    getId in interface DomainObject<Long>
    Returns:
    The technical, unique key

    isNew

    public boolean isNew()
    Check whether the instance is a transient or persisted one.

    Specified by:
    isNew in interface DomainObject<Long>
    Returns:
    true if transient (not persisted before), otherwise false

    getPriority

    public PriorityLevel getPriority()
    Returns the priority level of the TransportOrder.

    Returns:
    The priority

    setPriority

    public void setPriority(PriorityLevel priority)
    Set the priority level of the TransportOrder.

    Parameters:
    priority - The priority to set

    getStartDate

    public Date getStartDate()
    Returns the date when the TransportOrder was started.

    Returns:
    The date when started

    getTransportUnit

    public TransportUnit getTransportUnit()
    Get the TransportUnit assigned to the TransportOrder .

    Returns:
    The assigned transportUnit

    setTransportUnit

    public void setTransportUnit(TransportUnit transportUnit)
    Assign a TransportUnit to the TransportOrder. Setting the TransportUnit to null is allowed here to unlink both.

    Parameters:
    transportUnit - The transportUnit to be assigned

    getCreationDate

    public Date getCreationDate()
    Returns the date when the TransportOrder was created.

    Returns:
    The creation date

    getState

    public TransportOrderState getState()
    Returns the state of the TransportOrder.

    Returns:
    The state of the order

    validateStateChange

    protected void validateStateChange(TransportOrderState newState)
                                throws StateChangeException
    Validate whether a state change is valid or not. States must be changed in a defined order. Mostly the order is defined by the ordering if the states in TransportOrderState enum class. But some other rules are checked here too and an exception is thrown in case the sequence of states is violated.

    Parameters:
    newState - The new state of the order
    Throws:
    StateChangeException - when
  • newState is null or
  • the state shall be turned back to a prior state or
  • when the caller tries to leap the state TransportOrderState.INITIALIZED

  • setState

    public void setState(TransportOrderState newState)
                  throws StateChangeException
    Change the state of the TransportOrder regarding some rules.

    Parameters:
    newState - The new state of the order
    Throws:
    StateChangeException - in case

    getTargetLocation

    public Location getTargetLocation()
    Get the target Location of this TransportOrder.

    Returns:
    The targetLocation if any, otherwise null

    setTargetLocation

    public void setTargetLocation(Location targetLocation)
    Set the target Location of this TransportOrder.

    Parameters:
    targetLocation - The location to move on

    getDateUpdated

    public Date getDateUpdated()
    Get the date when the TransportOrder was changed last time.

    Returns:
    The date of the last update

    getTargetLocationGroup

    public LocationGroup getTargetLocationGroup()
    Get the targetLocationGroup.

    Returns:
    The targetLocationGroup if any, otherwise null

    setTargetLocationGroup

    public void setTargetLocationGroup(LocationGroup targetLocationGroup)
    Set the targetLocationGroup.

    Parameters:
    targetLocationGroup - The targetLocationGroup to set.

    getProblem

    public Problem getProblem()
    Get the last Problem.

    Returns:
    The last problem.

    setProblem

    public void setProblem(Problem problem)
    Set the last Problem.

    Parameters:
    problem - The Problem to set.

    getEndDate

    public Date getEndDate()
    Get the endDate.

    Returns:
    The date the order ended

    getSourceLocation

    public Location getSourceLocation()
    Get the sourceLocation.

    Returns:
    The sourceLocation

    setSourceLocation

    public void setSourceLocation(Location sourceLocation)
    Set the sourceLocation.

    Parameters:
    sourceLocation - The sourceLocation to set

    getVersion

    public long getVersion()
    Return the value of the optimistic locking field.

    Specified by:
    getVersion in interface DomainObject<Long>
    Returns:
    the version number


    Copyright © 2005-2011 openwms.org. All Rights Reserved.