Class SoldOutService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.ext.dispense.service.soldout.SoldOutService
- All Implemented Interfaces:
com.tccc.kos.commons.core.context.CtxEventListener
,com.tccc.kos.commons.core.service.handle.ContextHandleAware
,com.tccc.kos.commons.core.service.handle.HandleAware
,com.tccc.kos.commons.util.ready.Ready
,com.tccc.kos.commons.util.ready.ReadyListener
public class SoldOutService
extends com.tccc.kos.commons.core.service.AbstractService
Service that persists sold out containers and marks them sold out when
reinserted. This updates the
soldOut
flag in the associated
container object. This service has a configuration setting to make sold out
sticky or not. Sold outs are always persisted, but if not sticky, the sold
out will not be flagged during insertion. This allows containers to be
"tried again" by removing them and inserting them again. Many typical
container types don't support sold out as it typically requires external
sensors. If available, this service can be used to leverage those sensors.- Version:
- 2023-10-25
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
isContainerSoldOut
(Container container) Return true if the specified containerId is sold out.boolean
isSliceSoldOut
(ContainerSlice slice) Return true if the specified slice is sold out.Called to record a container sold out.soldOut
(ContainerSlice slice, String reason) Called to record a slice sold out.soldOutContainer
(Holder holder, String reason) Called to record a container sold out.soldOutSlice
(Holder holder, String reason) Called to record a slice sold out.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReady, onBeanReady, onDependenciesReady
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.commons.util.ready.Ready
isReady, setReady
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Field Details
-
REASON_soldOutOnInsert
- See Also:
-
-
Method Details
-
isContainerSoldOut
Return true if the specified containerId is sold out.- Parameters:
container
- the container to check
-
isSliceSoldOut
Return true if the specified slice is sold out.- Parameters:
slice
- the slice to check
-
soldOut
Called to record a slice sold out. This will also set thesoldOut
flag in the slice and create aSliceSoldOutTrouble
.- Parameters:
slice
- the container slice that is sold outreason
- the sold out reason for the trouble
-
soldOutSlice
Called to record a slice sold out. This will also set thesoldOut
flag in the slice and create aSliceSoldOutTrouble
.- Parameters:
holder
- associated slice will be sold outreason
- the sold out reason for the trouble
-
soldOut
Called to record a container sold out. This will also set thesoldOut
flag in the container and create aContainerSoldOutTrouble
for the container.- Parameters:
container
- the container that is sold outreason
- the sold out reason for the trouble
-
soldOutContainer
Called to record a container sold out. This will also set thesoldOut
flag in the container and create aContainerSoldOutTrouble
for the container.- Parameters:
holder
- the holder associated with the containerreason
- the sold out reason for the trouble
-