org.openwms.common.domain
Class Location

java.lang.Object
  extended by org.openwms.core.domain.AbstractEntity
      extended by org.openwms.common.domain.Location
All Implemented Interfaces:
Serializable, Target, DomainObject<Long>

public class Location
extends AbstractEntity
implements DomainObject<Long>, Target

A Location, represents some physical as well as virtual place in a warehouse.

Could be something like a storage location in the stock or a location on a conveyer. Also virtual or error locations can be modeled with a Location entity.

Multiple Locations are grouped to a LocationGroup.

Since:
0.1
Version:
$Revision: 1601 $
Author:
Heiko Scherrer
See Also:
LocationGroup, 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 Locations.
static String NQ_FIND_ALL_EAGER
          Query to find all Locations with all Messages and LocationTypes (eager loaded).
static String NQ_FIND_BY_UNIQUE_QUERY
          Query to find one Location by its natural key.
 
Fields inherited from class org.openwms.core.domain.AbstractEntity
FIND_ALL, FIND_BY_ID
 
Constructor Summary
Location(LocationPK locationId)
          Create a new Location with the business key.
 
Method Summary
 boolean addMessage(Message message)
          Add a new Message to this Location.
 String getCheckState()
          Returns the checkState to indicate the stock check procedure.
 String getDescription()
          Returns the description of the Location.
 Long getId()
          Return the technical key.
 Date getLastAccess()
          Return the date when the Location was updated the last time.
 LocationGroup getLocationGroup()
          Return the LocationGroup where the Location belongs to.
 LocationPK getLocationId()
          Returns the locationId (natural key) of the Location.
 LocationType getLocationType()
          Returns the type of Location.
 BigDecimal getMaximumWeight()
          Return the maximum allowed weight on the Location.
 Set<Message> getMessages()
          Returns an unmodifiable Set of Messages stored for the Location.
 short getNoMaxTransportUnits()
          Returns the maximum number of TransportUnits allowed on the Location.
 short getPlcState()
          Return the current set plc state.
 long getVersion()
          Return the value of the optimistic locking field.
 boolean isConsideredInAllocation()
          Determine whether the Location is considered during allocation.
 boolean isCountingActive()
          Determine whether TransportUnits should be counted on this Location or not.
 boolean isIncomingActive()
          Determine whether incoming mode is activated and TransportUnits can be put on this Location.
 boolean isInfeedBlocked()
          Check whether infeed is blocked and moving TransportUnits to here is forbidden.
 boolean isLocationGroupCountingActive()
          Determine whether the Location is part of the parent LocationGroups calculation procedure of TransportUnits.
 boolean isNew()
          Check whether the instance is a transient or persisted one.
 boolean isOutfeedBlocked()
          Check whether outfeed is blocked and moving TransportUnits from here is forbidden.
 boolean isOutgoingActive()
          Determine whether outgoing mode is activated and TransportUnits can leave this Location.
protected  void preUpdate()
          On update or insert the lastAccess is updated to the current date.
 boolean removeMessages(Message... messages)
          Remove one or more Messages from this Location.
 void setCheckState(String checkState)
          Change the checkState of the Location.
 void setConsideredInAllocation(boolean consideredInAllocation)
          Change the behavior whether the Location shall be considered in the allocation procedure or not.
 void setCountingActive(boolean countingActive)
          Change the behavior whether the Location shall be considered in the calculation of TransportUnits or not.
 void setDescription(String description)
          Change the description of the Location.
 void setIncomingActive(boolean incomingActive)
          Change the incoming state of the Location.
 void setLastAccess(Date lastAccess)
          Change the date when the Location was updated the last time.
 void setLocationGroup(LocationGroup locationGroup)
          Add this Location to the locationGroup.
 void setLocationGroupCountingActive(boolean locationGroupCountingActive)
          Define whether or not the Location shall be considered in counting TransportUnits of the parent LocationGroup.
 void setLocationType(LocationType locationType)
          Change the type of the Location.
 void setMaximumWeight(BigDecimal maximumWeight)
          Change the maximum allowed weight of the Location.
 void setNoMaxTransportUnits(short noMaxTransportUnits)
          Change the maximum number of TransportUnits allowed on the Location.
 void setOutgoingActive(boolean outgoingActive)
          Change the outgoing state of the Location.
 void setPlcState(short plcState)
          Change the current plc state.
 String toString()
          Return the LocationPK as String.
 
Methods inherited from class org.openwms.core.domain.AbstractEntity
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NQ_FIND_ALL

public static final String NQ_FIND_ALL
Query to find all Locations.

See Also:
Constant Field Values

NQ_FIND_ALL_EAGER

public static final String NQ_FIND_ALL_EAGER
Query to find all Locations with all Messages and LocationTypes (eager loaded).

See Also:
Constant Field Values

NQ_FIND_BY_UNIQUE_QUERY

public static final String NQ_FIND_BY_UNIQUE_QUERY
Query to find one Location by its natural key.
  • Query parameter index 1 : The locationId of the Location to search for
  • See Also:
    Constant Field Values
    Constructor Detail

    Location

    public Location(LocationPK locationId)
    Create a new Location with the business key.

    Parameters:
    locationId - The unique natural key of the Location
    Method Detail

    addMessage

    public boolean addMessage(Message message)
    Add a new Message to this Location.

    Parameters:
    message - The Message to be added
    Returns:
    true if the Message is new in the collection of messages, otherwise false

    getCheckState

    public String getCheckState()
    Returns the checkState to indicate the stock check procedure.

    Returns:
    The checkState

    isConsideredInAllocation

    public boolean isConsideredInAllocation()
    Determine whether the Location is considered during allocation.

    Returns:
    true when considered in allocation, otherwise false

    isCountingActive

    public boolean isCountingActive()
    Determine whether TransportUnits should be counted on this Location or not.

    Returns:
    true when counting is active, otherwise false

    getDescription

    public String getDescription()
    Returns the description of the Location.

    Returns:
    The description text

    getId

    public Long getId()
    Return the technical key.

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

    isIncomingActive

    public boolean isIncomingActive()
    Determine whether incoming mode is activated and TransportUnits can be put on this Location.

    Returns:
    true when incoming mode is activated, otherwise false

    isInfeedBlocked

    public boolean isInfeedBlocked()
    Check whether infeed is blocked and moving TransportUnits to here is forbidden.

    Returns:
    true is blocked, otherwise false

    getLastAccess

    public Date getLastAccess()
    Return the date when the Location was updated the last time.

    Returns:
    Timestamp of the last update

    getLocationGroup

    public LocationGroup getLocationGroup()
    Return the LocationGroup where the Location belongs to.

    Returns:
    The LocationGroup of the Location

    isLocationGroupCountingActive

    public boolean isLocationGroupCountingActive()
    Determine whether the Location is part of the parent LocationGroups calculation procedure of TransportUnits.

    Returns:
    true if calculation is activated, otherwise false

    getLocationId

    public LocationPK getLocationId()
    Returns the locationId (natural key) of the Location.

    Returns:
    The locationId

    getLocationType

    public LocationType getLocationType()
    Returns the type of Location.

    Returns:
    The type

    getMaximumWeight

    public BigDecimal getMaximumWeight()
    Return the maximum allowed weight on the Location.

    Returns:
    The maximum allowed weight

    getMessages

    public Set<Message> getMessages()
    Returns an unmodifiable Set of Messages stored for the Location.

    Returns:
    An unmodifiable Set

    getNoMaxTransportUnits

    public short getNoMaxTransportUnits()
    Returns the maximum number of TransportUnits allowed on the Location.

    Returns:
    The maximum number of TransportUnits

    isOutgoingActive

    public boolean isOutgoingActive()
    Determine whether outgoing mode is activated and TransportUnits can leave this Location.

    Returns:
    true when outgoing mode is activated, otherwise false

    isOutfeedBlocked

    public boolean isOutfeedBlocked()
    Check whether outfeed is blocked and moving TransportUnits from here is forbidden.

    Returns:
    true is blocked, otherwise false

    getPlcState

    public short getPlcState()
    Return the current set plc state.

    Returns:
    the plc state

    getVersion

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

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

    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

    removeMessages

    public boolean removeMessages(Message... messages)
    Remove one or more Messages from this Location.

    Parameters:
    messages - An array of Messages to be removed
    Returns:
    true if the Messages were found and removed, otherwise false
    Throws:
    IllegalArgumentException - when messages is null

    setCheckState

    public void setCheckState(String checkState)
    Change the checkState of the Location.

    Parameters:
    checkState - The new state to set

    setConsideredInAllocation

    public void setConsideredInAllocation(boolean consideredInAllocation)
    Change the behavior whether the Location shall be considered in the allocation procedure or not.

    Parameters:
    consideredInAllocation - true allocation active, otherwise false

    setCountingActive

    public void setCountingActive(boolean countingActive)
    Change the behavior whether the Location shall be considered in the calculation of TransportUnits or not.

    Parameters:
    countingActive - true counting active, otherwise false

    setDescription

    public void setDescription(String description)
    Change the description of the Location.

    Parameters:
    description - The new description text

    setIncomingActive

    public void setIncomingActive(boolean incomingActive)
    Change the incoming state of the Location.

    Parameters:
    incomingActive - true The Location can pick up TransportUnits, otherwise false

    setLastAccess

    public void setLastAccess(Date lastAccess)
    Change the date when the Location was updated the last time.

    Parameters:
    lastAccess - The date of change.

    setLocationGroup

    public void setLocationGroup(LocationGroup locationGroup)
    Add this Location to the locationGroup. When the argument is null an existing LocationGroup is removed from the Location.

    Parameters:
    locationGroup - The LocationGroup to be assigned

    setLocationGroupCountingActive

    public void setLocationGroupCountingActive(boolean locationGroupCountingActive)
    Define whether or not the Location shall be considered in counting TransportUnits of the parent LocationGroup.

    Parameters:
    locationGroupCountingActive - true if considered, otherwise false

    setLocationType

    public void setLocationType(LocationType locationType)
    Change the type of the Location.

    Parameters:
    locationType - The new type to set

    setMaximumWeight

    public void setMaximumWeight(BigDecimal maximumWeight)
    Change the maximum allowed weight of the Location.

    Parameters:
    maximumWeight - The new weight to set

    setNoMaxTransportUnits

    public void setNoMaxTransportUnits(short noMaxTransportUnits)
    Change the maximum number of TransportUnits allowed on the Location.

    Parameters:
    noMaxTransportUnits - The number of TransportUnits to set

    setOutgoingActive

    public void setOutgoingActive(boolean outgoingActive)
    Change the outgoing state of the Location.

    Parameters:
    outgoingActive - true TransportUnits can be moved away from the Location, otherwise false

    setPlcState

    public void setPlcState(short plcState)
    Change the current plc state.

    Parameters:
    plcState - The new state to set

    toString

    public String toString()
    Return the LocationPK as String.

    Overrides:
    toString in class Object
    Returns:
    String locationId
    See Also:
    LocationPK.toString()

    preUpdate

    protected void preUpdate()
    On update or insert the lastAccess is updated to the current date. (JPA lifecycle callback method).



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