Class BrandSetService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.ext.freestyle.service.brandset.BrandSetService
- 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
public final class BrandSetService
extends com.tccc.kos.commons.core.service.AbstractService
BrandSet service used to load a Freestyle
BrandSet from
a brandset kab file and manage the currently active brandset.
This will automatically add the active brandset to
IngredientService as the default source. While
IngredientService allows multiple IngredientSource's
to be installed at the same time, BrandSetService only
allows a single active brandset. The active brandset will
automatically be used by FreestyleBeveragePourEngine for
micro-dosing applications.- Since:
- 1.0
- Version:
- 2023-08-12
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the currently activeRegulatoryRules.getNutrition(String bevId, List<Double> volumes) ReturnNutritionInfofor the specified beverageId at the specified volumes.booleanloadActiveBrandSet(com.tccc.kos.commons.kab.KabFile kab) Load the specified brandset kab and make it the active brandset.voidsetGrantProperties(Map<String, String> grantProperties) Set the properties used to evaluate grants.voidsetRulesForZone(String zone, RegulatoryRules rules) Set aRegulatoryRulesimplementation for the specified zone.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.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
onBeanReady, onDependenciesReadyMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Field Details
-
BRANDSET_SOURCE_ID
- See Also:
-
KAB_TYPE_BRANDSET
- See Also:
-
BRANDSET_AUTHORITY
- See Also:
-
-
Constructor Details
-
BrandSetService
public BrandSetService()
-
-
Method Details
-
setRulesForZone
Set aRegulatoryRulesimplementation for the specified zone. This can add additional zones or replace the rules for an existing zone.Regulatory zones are specified as part of the region.xml file.
- Parameters:
zone- the zone namerules- the regulatory rules implementation
-
loadActiveBrandSet
public boolean loadActiveBrandSet(com.tccc.kos.commons.kab.KabFile kab) Load the specified brandset kab and make it the active brandset.- Parameters:
kab- the kab containing a Freestyle brandset
-
getActiveRegulatoryRules
Return the currently activeRegulatoryRules. This will extract the regulatory zone from the active region and return the corresponding regulatory rules. If there is no selected region or no corresponding rules, this will return null. -
setGrantProperties
Set the properties used to evaluate grants. This will cause the beverage graph to be rebuilt which will re-evaluate all theGrantAwareobjects in the graph. -
getNutrition
ReturnNutritionInfofor the specified beverageId at the specified volumes. This will return results for the preferred recipe in the beverage which does not necessarily correspond to the recipe that will actually be poured as that is determined by the inserted ingredients. To return nutrition data for the actually poured beverage, use the call inFreesyleBeveragePourEngine.- Parameters:
bevId- the beveageId to processvolumes- the poured volume
-
getActiveBrandSet
-