Interface TransportationService<T extends TransportOrder>

Type Parameters:
T - Any kind of TransportOrder
All Known Implementing Classes:
TransportationServiceImpl

public interface TransportationService<T extends TransportOrder>
A TransportationService offers some useful methods regarding the general handling of TransportOrders.
Author:
Heiko Scherrer
  • Method Details

    • findBy

      List<T> findBy(String barcode, String... states)
      FInd all TransportOrders for a TransportUnit in the given states.
      Parameters:
      barcode - The Barcode of the TransportUnit
      states - A set of TransportOrder states
      Returns:
      A List of all TransportOrders, never null
    • findByPKey

      T findByPKey(String pKey)
      Find and return the TransportOrder identified by the persisted key pKey.
      Parameters:
      pKey - The persisted key
      Returns:
      An TransportOrder instance
      Throws:
      org.ameba.exception.NotFoundException - if no entity was found
    • getNoTransportOrdersToTarget

      int getNoTransportOrdersToTarget(String target, String... states)
      Returns the number of TransportOrders that have the target as target and are in one of the states.
      Parameters:
      target - The target place to search TransportOrders for
      states - An array of TransportOrder states to filter TransportOrders for
      Returns:
      Number of all TransportOrders in one of the states that are on the way to the target
    • create

      T create(String barcode, String target, String priority)
      Create a new TransportOrder with the given target.
      Parameters:
      barcode - The ID of the TransportUnit to move
      target - The target of the TransportOrder to move to
      priority - A PriorityLevel of the new TransportOrder
      Returns:
      The newly created TransportOrder
    • update

      T update(T transportOrder)
      Modifies an existing TransportOrder according to the argument passed as TransportOrder.
      Parameters:
      transportOrder - Stores the ID of the TransportOrder to change as well as the state to change
      Returns:
      The modified instance
    • change

      Try to turn a list of TransportOrders into the given state.
      Parameters:
      state - The state to change all orders to
      pKeys - The persisted keys of TransportOrders
      Returns:
      A list of persisted keys of TransportOrders that have not been changed
    • change

      Collection<Message> change(String barcode, TransportOrderState currentState, TransportOrderState targetState, Message message)
      Request a state change for all TransportOrders for the TransportUnit with the given barcode.
      Parameters:
      barcode - The ID of the TransportUnit to move
      currentState - The state of TransportOrders to change
      targetState - The state to change all orders to
      message - A messages attached to the changed TransportOrder, may be null
      Returns:
      A list of Messages according to the TransportOrders that have not been changed