Package com.tccc.kos.ext.dispense
Class Holder
java.lang.Object
com.tccc.kos.ext.dispense.Holder
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.handle.HandleAware
,com.tccc.kos.core.service.assembly.AssemblyAware
,PourAvailability
public class Holder
extends Object
implements com.tccc.kos.core.service.assembly.AssemblyAware, com.tccc.kos.commons.core.service.handle.HandleAware, PourAvailability
Abstraction of how a
ContainerSlice
attaches to a pump. In many cases
this is simply a hose that connects a BiB container to a pump, but in more
complex devices this represents a cartridge slot which may have associated
hardware, such as RFID antenna, indicator lights, and so on. This also holds
state about the availability of a pump to pump the connected ingredient.- Since:
- 1.0
- Version:
- 2023-01-16
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tccc.kos.ext.dispense.PourAvailability
PourAvailability.Type
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a pump to the holder.com.tccc.kos.core.service.assembly.Assembly
Return the object add to a trouble impact list to block beverage pouring.Returns the container associated with the holder.Return the containerId associated with this holder.com.tccc.kos.commons.core.service.handle.Handle
Return the object add to a trouble impact list to block all pouring.Return the ingredientId associated with this holder.Return theIngredientSource
id the holder is restricted to.Return the ingredient compatibility type that indicates which types of ingredients are compatible with this holder.getNext()
Get the optional nextHolder
after this one.getPrev()
Get the optional previousHolder
before this one.getPumps()
Returns the pumps associated with the holder.getSlice()
Returns the slice of the container that is inserted into the holder.void
Notifies the holder that the linked state has changed, so it should generate a change event fromHolderService
.void
setIngSourceId
(String ingSourceId) Set the ingredient source id the holder is restricted to.setIngType
(String ingType) Set the ingredient compatibility type that indicates which types of ingredients are compatible with this holder.void
Set the nextHolder
after this one.void
Set the previousHolder
before this one.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.core.service.assembly.AssemblyAware
getAssemblyName
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.ext.dispense.PourAvailability
getAvailbilityLock
-
Field Details
-
TOPIC_CHANGE
- See Also:
-
WATER
- See Also:
-
CARB
- See Also:
-
NS
- See Also:
-
NNS
- See Also:
-
MICROS
- See Also:
-
MACROS
- See Also:
-
-
Constructor Details
-
Holder
Creates a holder with the specified name.- Parameters:
assembly
- assembly the holder is part ofname
- the name of the holder
-
Holder
Creates a holder with the specified name and pump.- Parameters:
assembly
- assembly the holder is part ofname
- the name of the holderpump
- the pump to add to the holder
-
-
Method Details
-
getNext
Get the optional nextHolder
after this one. This is entirely optional but if specified, can be used byInsertionService
to automatically insert containers with multiple slices. -
setNext
Set the nextHolder
after this one. This is entirely optional but if specified, can be used byInsertionService
to automatically insert containers with multiple slices.If using
setNext()
,setPrev()
should also be used. -
getPrev
Get the optional previousHolder
before this one. This is entirely optional but if specified, can be used byInsertionService
to automatically insert containers with multiple slices. -
setPrev
Set the previousHolder
before this one. This is entirely optional but if specified, can be used byInsertionService
to automatically insert containers with multiple slices.If using
setPrev()
,setNext()
should also be used. -
getIngSourceId
Return theIngredientSource
id the holder is restricted to. If set, only ingredients from this source can be assigned to this holder. -
setIngSourceId
Set the ingredient source id the holder is restricted to. Only ingredients from this source can be assigned to this holder. This is typically only used to manage multipleIngredientSource
objects on a device with multiple nozzles that use different ingredients. For more typical compatibility checks within a givenIngredientSource
, such as ensuring BiB ingredients are assigned to syrup valves, use theingType
functionality which provides matching functionality in the UI sdk.- Parameters:
ingSourceId
- id of the source the holder is restricted to
-
notifyChanged
public void notifyChanged()Notifies the holder that the linked state has changed, so it should generate a change event fromHolderService
. -
add
Adds a pump to the holder. -
getPumps
Returns the pumps associated with the holder. -
getSlice
Returns the slice of the container that is inserted into the holder. This is null if no container is inserted. If not null, the ingredient cannot be used until the ready flag is true, as there are validation steps that may block a container from being usable, such as expiration date. -
getContainer
Returns the container associated with the holder. This is a convenience method that performs null checks on the slice. -
getIngType
Return the ingredient compatibility type that indicates which types of ingredients are compatible with this holder. If set, only ingredients with the same type may be assigned to this holder. If there is a container inserted and it is intrinsic, this will return"intrinsic"
regardless of whatingType
is set to. -
setIngType
Set the ingredient compatibility type that indicates which types of ingredients are compatible with this holder. If set, only ingredients with the same type may be assigned to this holder. -
getIngredientId
Return the ingredientId associated with this holder. -
getContainerId
Return the containerId associated with this holder. -
getAssembly
public com.tccc.kos.core.service.assembly.Assembly getAssembly()- Specified by:
getAssembly
in interfacecom.tccc.kos.core.service.assembly.AssemblyAware
-
getHandle
public com.tccc.kos.commons.core.service.handle.Handle getHandle()- Specified by:
getHandle
in interfacecom.tccc.kos.commons.core.service.handle.HandleAware
-
getBeverageAvailabilityLock
Description copied from interface:PourAvailability
Return the object add to a trouble impact list to block beverage pouring.- Specified by:
getBeverageAvailabilityLock
in interfacePourAvailability
-
getIngredientAvailabilityLock
Description copied from interface:PourAvailability
Return the object add to a trouble impact list to block all pouring.- Specified by:
getIngredientAvailabilityLock
in interfacePourAvailability
-