Class ClaraYaml
java.lang.Object
org.jlab.utils.ClaraYaml
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObjectGet the service's configuration as presented by CLARA.static org.json.JSONObjectEmulate the way CLARA parses the full YAML and presents it in EngineData.static StringConvert short (base)name into absolute path, for "stock" schema.static voidList<org.json.JSONObject> services()Get a list of services.voidsetSchemaDirectory(String dir) Set the schema_dir directory.final voidSet the schema_dir, assuming it's currently the short (basename) of a "stock" schema, but only if it doesn't already look like an absolute path.voidshow()Print it to the screen, nicely.voidshowFiltered(String serviceName) Print the service's configuration as presented by CLARA.booleanvalid()Whether it parsed ok.
-
Constructor Details
-
ClaraYaml
-
-
Method Details
-
valid
public boolean valid()Whether it parsed ok.- Returns:
-
show
public void show()Print it to the screen, nicely. -
showFiltered
Print the service's configuration as presented by CLARA.- Parameters:
serviceName-
-
services
-
schemaDirectory
-
getSchemaDirectory
-
setSchemaDirectory
Set the schema_dir directory.- Parameters:
dir- path to schema_dir directory
-
setStockSchemaDirectory
public final void setStockSchemaDirectory()Set the schema_dir, assuming it's currently the short (basename) of a "stock" schema, but only if it doesn't already look like an absolute path. -
getStockSchemaDirectory
-
filter
Get the service's configuration as presented by CLARA.- Parameters:
serviceName-- Returns:
- json object
-
filter
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 contentsserviceName- the name of the service in CLARA YAML (not class name)- Returns:
- data in the format the given CLARA service would see
-
main
-