Class AssignmentService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.ext.dispense.service.assignment.AssignmentService
- 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.ReadyAndReadyListener,com.tccc.kos.commons.util.ready.ReadyListener,com.tccc.kos.core.service.assembly.AssemblyListener,InsertionHolderListener,InsertionListener,PumpListener,ReplaceLineListener
public final class AssignmentService
extends com.tccc.kos.commons.core.service.AbstractService
implements com.tccc.kos.core.service.assembly.AssemblyListener, InsertionHolderListener, ReplaceLineListener
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.0
- Version:
- 2023-01-25
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(Assignment a) Assign an ingredient to a holder.Return the collection of active assignments.booleanvoidonContainerInsertStart(Container container, Holder[] holders) Called when a container is inserted into one or more holders.voidonContainerRemove(Container container, Holder[] holders) Called when a container is removed from holder(s).voidonLineReplaced(Holder holder) Called when a line is replaced for the holder.voidonPostInstall(com.tccc.kos.core.service.assembly.Assembly assembly) voidonUninstall(com.tccc.kos.core.service.assembly.Assembly assembly) voidSet the container factory to use when creating containers to use for assignments.voidUnassign a holder if it is currently assigned.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefixMethods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReadyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.core.service.assembly.AssemblyListener
onInstall, onPostUninstall, onPreInstall, onPreUninstallMethods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompletedMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPathMethods inherited from interface com.tccc.kos.commons.util.ready.Ready
isReady, setReadyMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyAndReadyListener
onDependenciesReadyMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Constructor Details
-
AssignmentService
public AssignmentService()
-
-
Method Details
-
onBeanReady
public boolean onBeanReady()- Specified by:
onBeanReadyin interfacecom.tccc.kos.commons.util.ready.ReadyAndReadyListener
-
setContainerFactory
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 optionalfactoryJsonwhich allows complex data to be passed through to the factory.The default factory returns base
Containerinstances. If replacing the factory, it should be replaced before the core assembly is installed as this triggers the containers to be created. -
assign
Assign an ingredient to a holder.- Throws:
Exception
-
unassign
Unassign a holder if it is currently assigned. -
getAssignments
Return the collection of active assignments. -
onPostInstall
public void onPostInstall(com.tccc.kos.core.service.assembly.Assembly assembly) - Specified by:
onPostInstallin interfacecom.tccc.kos.core.service.assembly.AssemblyListener
-
onUninstall
public void onUninstall(com.tccc.kos.core.service.assembly.Assembly assembly) - Specified by:
onUninstallin interfacecom.tccc.kos.core.service.assembly.AssemblyListener
-
onContainerInsertStart
Description copied from interface:InsertionHolderListenerCalled when a container is inserted into one or more holders. This is called when the insertion request is first created and the container is linked to the holders. Availability to use the pumps will be subject to filters blocking the insert.- Specified by:
onContainerInsertStartin interfaceInsertionHolderListener- Parameters:
container- the container that was insertedholders- the holders inserted into
-
onContainerRemove
Description copied from interface:InsertionHolderListenerCalled when a container is removed from holder(s).- Specified by:
onContainerRemovein interfaceInsertionHolderListener- Parameters:
container- the container that was removedholders- the associated holders
-
onLineReplaced
Description copied from interface:ReplaceLineListenerCalled when a line is replaced for the holder.- Specified by:
onLineReplacedin interfaceReplaceLineListener- Parameters:
holder- the holder with the line being replaced
-
getContainerFactory
-