org.openwms.common.service.spring
Class LocationGroupServiceImpl

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

@Service
@Transactional
public class LocationGroupServiceImpl
extends EntityServiceImpl<LocationGroup,Long>
implements LocationGroupService<LocationGroup>

A LocationGroupServiceImpl.

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
LocationGroupServiceImpl()
           
 
Method Summary
 void changeGroupState(LocationGroup locationGroup)
          Changes the GroupStates of a LocationGroup.
Both, the GroupStateIn and the GroupStateOut of all child LocationGroups are changed according to the parent locationGroup.
protected  void changeGroupState(LocationGroup persisted, LocationGroup locationGroup)
          Regarding at least one groupState has changed the state is set on the LocationGroup directly.
 List<LocationGroup> getLocationGroupsAsList()
          Returns a List of all LocationGroups.
 TreeNode<LocationGroup> getLocationGroupsAsTree()
          Returns a hierarchical Tree of all LocationGroups.
protected  LocationGroup mergeLocationGroup(LocationGroup persisted, LocationGroup locationGroup)
          Save changed fields by setting them directly.
 LocationGroup save(LocationGroup locationGroup)
          Save an entity of type T.
 
Methods inherited from class org.openwms.core.service.spring.EntityServiceImpl
add, findAll, remove, 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
 

Constructor Detail

LocationGroupServiceImpl

public LocationGroupServiceImpl()
Method Detail

changeGroupState

public void changeGroupState(LocationGroup locationGroup)
Changes the GroupStates of a LocationGroup.
Both, the GroupStateIn and the GroupStateOut of all child LocationGroups are changed according to the parent locationGroup. This call is executed recursively to all child LocationGroups of the locationGroup Entity.

Specified by:
changeGroupState in interface LocationGroupService<LocationGroup>
Parameters:
locationGroup - The LocationGroup to change

save

public LocationGroup save(LocationGroup locationGroup)
Save an entity of type T.

Specified by:
save in interface LocationGroupService<LocationGroup>
Specified by:
save in interface EntityService<LocationGroup>
Overrides:
save in class EntityServiceImpl<LocationGroup,Long>
Parameters:
locationGroup - Instance to be saved
Returns:
The saved instance

mergeLocationGroup

protected LocationGroup mergeLocationGroup(LocationGroup persisted,
                                           LocationGroup locationGroup)
Save changed fields by setting them directly. Merging the instance automatically will not work.

Parameters:
persisted - The instance read from the persisted storage
locationGroup -
Returns:
The merged persisted object

changeGroupState

protected void changeGroupState(LocationGroup persisted,
                                LocationGroup locationGroup)
Regarding at least one groupState has changed the state is set on the LocationGroup directly. Whether a state change is allowed or not is checked within the LocationGroup itself but we do a basic check before. When the parent LocationGroup is blocked the current LocationGroup cannot be turned to AVAILABLE.

Parameters:
persisted - The instance read from the persisted storage
locationGroup - The instance holding the new values to save
Throws:
ServiceRuntimeException - when a state change is not allowed

getLocationGroupsAsTree

@Transactional(readOnly=true)
public TreeNode<LocationGroup> getLocationGroupsAsTree()
Returns a hierarchical Tree of all LocationGroups. Used by the user interface to show all LocationGroups in a tree form.

Specified by:
getLocationGroupsAsTree in interface LocationGroupService<LocationGroup>
Returns:
All LocationGroups as hierarchical tree

getLocationGroupsAsList

@Transactional(readOnly=true)
public List<LocationGroup> getLocationGroupsAsList()
Returns a List of all LocationGroups.

Specified by:
getLocationGroupsAsList in interface LocationGroupService<LocationGroup>
Returns:
All LocationGroups as a list


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