org.openwms.common.service.spring
Class TransportUnitServiceImpl

java.lang.Object
  extended by org.openwms.core.service.spring.EntityServiceImpl<TransportUnit,Long>
      extended by org.openwms.common.service.spring.TransportUnitServiceImpl
All Implemented Interfaces:
TransportUnitService<TransportUnit>, EntityService<TransportUnit>, org.springframework.context.ApplicationContextAware

@Service
@Transactional
public class TransportUnitServiceImpl
extends EntityServiceImpl<TransportUnit,Long>
implements TransportUnitService<TransportUnit>

A TransportUnitServiceImpl.

Since:
0.1
Version:
$Revision: 1409 $
Author:
Heiko Scherrer
See Also:
EntityServiceImpl

Field Summary
 
Fields inherited from class org.openwms.core.service.spring.EntityServiceImpl
ctx
 
Constructor Summary
TransportUnitServiceImpl()
           
 
Method Summary
 TransportUnit createTransportUnit(Barcode barcode, TransportUnitType transportUnitType, LocationPK actualLocation)
          Create a new TransportUnit with the type TransportUnitType placed on an initial Location.
 TransportUnitType createTransportUnitType(TransportUnitType transportUnitType)
          Create a new TransportUnitType.
 void deleteTransportUnits(List<TransportUnit> transportUnits)
          Delete already persisted TransportUnits from the persistence storage.
 void deleteTransportUnitTypes(List<TransportUnitType> transportUnitTypes)
          Delete already persisted TransportUnitType instances.
 List<TransportUnit> getAllTransportUnits()
          Returns an unsorted List of all TransportUnits.
 List<TransportUnitType> getAllTransportUnitTypes()
          Returns an unsorted List of all TransportUnitTypes.
 List<Rule> loadRules(String transportUnitType)
          Return a List of all Rules that belong to this TransportUnitType type.
 void moveTransportUnit(Barcode barcode, LocationPK targetLocationPK)
          Move a TransportUnit identified by its Barcode to the given target Location identified by the LocationPK.
 TransportUnitType saveTransportUnitType(TransportUnitType transportUnitType)
          Save an already persisted instance of TransportUnitType.
 void setOnRemovalListener(OnRemovalListener<TransportUnit> onRemovalListener)
           
 TransportUnitType updateRules(String type, List<LocationType> newAssigned, List<LocationType> newNotAssigned)
          Update the List of TypePlacingRules for the given TransportUnitType type.
 
Methods inherited from class org.openwms.core.service.spring.EntityServiceImpl
add, findAll, remove, save, setApplicationContext, setDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openwms.core.service.EntityService
add, findAll, remove, save
 

Constructor Detail

TransportUnitServiceImpl

public TransportUnitServiceImpl()
Method Detail

setOnRemovalListener

public void setOnRemovalListener(OnRemovalListener<TransportUnit> onRemovalListener)

createTransportUnit

public TransportUnit createTransportUnit(Barcode barcode,
                                         TransportUnitType transportUnitType,
                                         LocationPK actualLocation)
Create a new TransportUnit with the type TransportUnitType placed on an initial Location. The new TransportUnit has the given Barcode as identifier.

Specified by:
createTransportUnit in interface TransportUnitService<TransportUnit>
Parameters:
barcode - Barcode of the new TransportUnit
transportUnitType - The type of the new TransportUnit
actualLocation - The Location where the TransportUnit is placed on
Returns:
The new created TransportUnit instance

getAllTransportUnits

@Transactional(readOnly=true)
public List<TransportUnit> getAllTransportUnits()
Returns an unsorted List of all TransportUnits.

Specified by:
getAllTransportUnits in interface TransportUnitService<TransportUnit>
Returns:
A List of all TransportUnits

getAllTransportUnitTypes

@Transactional(readOnly=true)
public List<TransportUnitType> getAllTransportUnitTypes()
Returns an unsorted List of all TransportUnitTypes.

Specified by:
getAllTransportUnitTypes in interface TransportUnitService<TransportUnit>
Returns:
A list of all TransportUnitTypes

loadRules

public List<Rule> loadRules(String transportUnitType)
Return a List of all Rules that belong to this TransportUnitType type.

Specified by:
loadRules in interface TransportUnitService<TransportUnit>
Parameters:
transportUnitType - The TransportUnitType to search for.
Returns:
The requested List or null if no Rule was found.

createTransportUnitType

public TransportUnitType createTransportUnitType(TransportUnitType transportUnitType)
Create a new TransportUnitType.

Specified by:
createTransportUnitType in interface TransportUnitService<TransportUnit>
Parameters:
transportUnitType - The type to be created
Returns:
The new created TransportUnitType instance.

deleteTransportUnitTypes

public void deleteTransportUnitTypes(List<TransportUnitType> transportUnitTypes)
Delete already persisted TransportUnitType instances. The implementation uses the id to find the TransportUnitType to be removed and will removed the type when found.

Specified by:
deleteTransportUnitTypes in interface TransportUnitService<TransportUnit>
Parameters:
transportUnitTypes - A list of all instances to be deleted.

saveTransportUnitType

public TransportUnitType saveTransportUnitType(TransportUnitType transportUnitType)
Save an already persisted instance of TransportUnitType.

Specified by:
saveTransportUnitType in interface TransportUnitService<TransportUnit>
Parameters:
transportUnitType - The instance to be updated
Returns:
The updated instance

moveTransportUnit

public void moveTransportUnit(Barcode barcode,
                              LocationPK targetLocationPK)
Move a TransportUnit identified by its Barcode to the given target Location identified by the LocationPK.

Specified by:
moveTransportUnit in interface TransportUnitService<TransportUnit>
Parameters:
barcode - Barcode of the TransportUnit to move
targetLocationPK - Unique identifier of the target Location

deleteTransportUnits

public void deleteTransportUnits(List<TransportUnit> transportUnits)
Delete already persisted TransportUnits from the persistence storage. It is not allowed in all cases to delete a TransportUnit , potentially an active TransportOrder exists or Inventory is still linked with the transportUnit. A ServiceRuntimeException is thrown when other TransportUnits are placed on a TransportUnit that shall be removed. Also TransportUnit with active TransportOrders won't be removed, if a proper delegate exists.

Specified by:
deleteTransportUnits in interface TransportUnitService<TransportUnit>
Parameters:
transportUnits - The collection of TransportUnits to delete

updateRules

public TransportUnitType updateRules(String type,
                                     List<LocationType> newAssigned,
                                     List<LocationType> newNotAssigned)
Update the List of TypePlacingRules for the given TransportUnitType type.

Specified by:
updateRules in interface TransportUnitService<TransportUnit>
Parameters:
type - The TransportUnitType to update.
newAssigned - A new List of LocationTypes that are allowed for the TransportUnitType.
newNotAssigned - A List of LocationTypes. All TypePlacingRules will be removed which have one of this LocationTypes and the requested TransportUnitType type.
Returns:
The updated TransportUnitType.


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