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.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
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Return the currently active RegulatoryRules .
    getNutrition(String bevId, List<Double> volumes)
    Return NutritionInfo for the specified beverageId at the specified volumes.
    boolean
    loadActiveBrandSet(com.tccc.kos.commons.kab.KabFile kab)
    Load the specified brandset kab and make it the active brandset.
    void
    setGrantProperties(Map<String,String> grantProperties)
    Set the properties used to evaluate grants.
    void
    Set a RegulatoryRules implementation for the specified zone.

    Methods inherited from class com.tccc.kos.commons.core.service.AbstractService

    getHandle, getHandlePrefix

    Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean

    getReady, onBeanReady, onDependenciesReady

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener

    onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted

    Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware

    addHandleChild, getName, getPath

    Methods inherited from interface com.tccc.kos.commons.util.ready.Ready

    isReady, setReady

    Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener

    onDependenciesGroupReady
  • Field Details

  • Constructor Details

    • BrandSetService

      public BrandSetService()
  • Method Details

    • setRulesForZone

      public void setRulesForZone(String zone, RegulatoryRules rules)
      Set a RegulatoryRules implementation 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 name
      rules - 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

      public RegulatoryRules getActiveRegulatoryRules()
      Return the currently active RegulatoryRules . 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

      public void setGrantProperties(Map<String,String> grantProperties)
      Set the properties used to evaluate grants. This will cause the beverage graph to be rebuilt which will re-evaluate all the GrantAware objects in the graph.
    • getNutrition

      public NutritionInfo getNutrition(String bevId, List<Double> volumes)
      Return NutritionInfo for 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 in FreesyleBeveragePourEngine .
      Parameters:
      bevId - the beveageId to process
      volumes - the poured volume
    • getActiveBrandSet

      public BrandSet getActiveBrandSet()