Class ClaraYaml

java.lang.Object
org.jlab.utils.ClaraYaml

public class ClaraYaml extends Object
Read a CLARA YAML file, convert it to JSON (because that's what COATJAVA uses elsewhere), and provide the same filtering that CLARA does when it presents a service its EngineData.
Author:
baltzell
  • Constructor Details Link icon

    • ClaraYaml Link icon

      public ClaraYaml(String filename)
  • Method Details Link icon

    • valid Link icon

      public boolean valid()
      Whether it parsed ok.
      Returns:
    • show Link icon

      public void show()
      Print it to the screen, nicely.
    • showFiltered Link icon

      public void showFiltered(String serviceName)
      Print the service's configuration as presented by CLARA.
      Parameters:
      serviceName -
    • services Link icon

      public List<org.json.JSONObject> services()
      Get a list of services.
      Returns:
      services
    • schemaDirectory Link icon

      public String schemaDirectory()
    • filter Link icon

      public org.json.JSONObject filter(String serviceName)
      Get the service's configuration as presented by CLARA.
      Parameters:
      serviceName -
      Returns:
      json object
    • filter Link icon

      public static org.json.JSONObject filter(org.json.JSONObject claraJson, String serviceName)
      Emulate the way CLARA parses the full YAML and presents it in EngineData. The "global" and "service" subsections in the "configuration" section get squashed into one namespace, and service-specific keys override any globals of the same name.
      Parameters:
      claraJson - the full CLARA YAML contents
      serviceName - the name of the service in CLARA YAML (not class name)
      Returns:
      data in the format the given CLARA service would see
    • main Link icon

      public static void main(String[] args)