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
  • Field Details

  • Constructor Details

    • Holder

      public Holder(com.tccc.kos.core.service.assembly.Assembly assembly, String name)
      Creates a holder with the specified name.
      Parameters:
      assembly - assembly the holder is part of
      name - the name of the holder
    • Holder

      public Holder(com.tccc.kos.core.service.assembly.Assembly assembly, String name, Pump<?> pump)
      Creates a holder with the specified name and pump.
      Parameters:
      assembly - assembly the holder is part of
      name - the name of the holder
      pump - the pump to add to the holder
  • Method Details

    • getNext

      public Holder getNext()
      Get the optional next Holder after this one. This is entirely optional but if specified, can be used by InsertionService to automatically insert containers with multiple slices.
    • setNext

      public void setNext(Holder next)
      Set the next Holder after this one. This is entirely optional but if specified, can be used by InsertionService to automatically insert containers with multiple slices.

      If using setNext() , setPrev() should also be used.

    • getPrev

      public Holder getPrev()
      Get the optional previous Holder before this one. This is entirely optional but if specified, can be used by InsertionService to automatically insert containers with multiple slices.
    • setPrev

      public void setPrev(Holder prev)
      Set the previous Holder before this one. This is entirely optional but if specified, can be used by InsertionService to automatically insert containers with multiple slices.

      If using setPrev() , setNext() should also be used.

    • getIngSourceId

      public String getIngSourceId()
      Return the IngredientSource id the holder is restricted to. If set, only ingredients from this source can be assigned to this holder.
    • setIngSourceId

      public void setIngSourceId(String ingSourceId)
      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 multiple IngredientSource objects on a device with multiple nozzles that use different ingredients. For more typical compatibility checks within a given IngredientSource , such as ensuring BiB ingredients are assigned to syrup valves, use the ingType 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 from HolderService .
    • add

      public void add(Pump<?> pump)
      Adds a pump to the holder.
    • getPumps

      public List<Pump<?>> getPumps()
      Returns the pumps associated with the holder.
    • getSlice

      public ContainerSlice 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

      public Container getContainer()
      Returns the container associated with the holder. This is a convenience method that performs null checks on the slice.
    • getIngType

      public String 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 what ingType is set to.
    • setIngType

      public Holder setIngType(String ingType)
      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

      public String getIngredientId()
      Return the ingredientId associated with this holder.
    • getContainerId

      public String getContainerId()
      Return the containerId associated with this holder.
    • getAssembly

      public com.tccc.kos.core.service.assembly.Assembly getAssembly()
      Specified by:
      getAssembly in interface com.tccc.kos.core.service.assembly.AssemblyAware
    • getHandle

      public com.tccc.kos.commons.core.service.handle.Handle getHandle()
      Specified by:
      getHandle in interface com.tccc.kos.commons.core.service.handle.HandleAware
    • getBeverageAvailabilityLock

      public AvailabilityLock getBeverageAvailabilityLock()
      Description copied from interface: PourAvailability
      Return the object add to a trouble impact list to block beverage pouring.
      Specified by:
      getBeverageAvailabilityLock in interface PourAvailability
    • getIngredientAvailabilityLock

      public AvailabilityLock getIngredientAvailabilityLock()
      Description copied from interface: PourAvailability
      Return the object add to a trouble impact list to block all pouring.
      Specified by:
      getIngredientAvailabilityLock in interface PourAvailability