Class AssignmentService

java.lang.Object
com.kosdev.kos.ext.dispense.service.assignment.AssignmentService

public final class AssignmentService extends Object
Service that allows ingredients to be manually assigned to holders. This will persist the assignments so they survive reboots. This can be used for typical dispensers that require that ingredient be manually mapped during installation / setup.
Since:
1
Version:
1
  • Method Details

    • setContainerFactory

      public void setContainerFactory(AssignmentContainerFactory factory)
      Set the container factory to use when creating containers to use for assignments. This allows applications to insert much more complex containers that have more features such as fuel gauges or whatever is desired. The assignment object contains optional factoryJson which allows complex data to be passed through to the factory.

      The default factory returns base Container instances. If replacing the factory, it should be replaced before the core assembly is installed as this triggers the containers to be created.

      Since:
      1
    • assign

      public void assign(Assignment a) throws Exception
      Assign an ingredient to a holder.
      Throws:
      Exception
      Since:
      1
    • unassign

      public void unassign(String holderPath)
      Unassign a holder if it is currently assigned.
      Since:
      1
    • getAssignments

      public Collection<Assignment> getAssignments()
      Return the collection of active assignments.
      Since:
      1
    • getContainerFactory

      public AssignmentContainerFactory getContainerFactory()