Package org.yamcs.xtceproc
Class XtceDbFactory
- java.lang.Object
-
- org.yamcs.xtceproc.XtceDbFactory
-
public class XtceDbFactory extends Object
-
-
Constructor Summary
Constructors Constructor Description XtceDbFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static XtceDbcreateInstance(List<YConfiguration> treeConfig, boolean attemptToLoadSerialized, boolean saveSerialized)Load a XTCE database from a description.static XtceDbcreateInstanceByConfig(String configSection)Creates a new instance of the database in memory. configSection is the top heading under which this appears in the mdb.yamlstatic XtceDbcreateInstanceByConfig(String configSection, boolean attemptToLoadSerialized)static XtceDbgetInstance(String yamcsInstance)retrieves the XtceDb for the corresponding yamcsInstance. if yamcsInstance is null, then the first one in the mdb.yaml config file is loadedstatic XtceDbgetInstanceByConfig(String yamcsInstance, String config)static voidremove(String yamcsInstance)Removes the Xtcedb corresponding to yamcsInstance from memorystatic voidreset()forgets any singleton
-
-
-
Method Detail
-
createInstanceByConfig
public static XtceDb createInstanceByConfig(String configSection) throws DatabaseLoadException
Creates a new instance of the database in memory. configSection is the top heading under which this appears in the mdb.yaml- Throws:
DatabaseLoadException
-
createInstanceByConfig
public static XtceDb createInstanceByConfig(String configSection, boolean attemptToLoadSerialized) throws ConfigurationException, DatabaseLoadException
-
createInstance
public static XtceDb createInstance(List<YConfiguration> treeConfig, boolean attemptToLoadSerialized, boolean saveSerialized) throws ConfigurationException, DatabaseLoadException
Load a XTCE database from a description.- Parameters:
treeConfig- this should be a list of maps as it would come out of the mdb.yaml definition.attemptToLoadSerialized- if true, it will attempt to load a serialized version from the disk instead of creating a new object by loading all elements from the tree definition.saveSerialized- if the result should be saved as a serialized file. If the database has been loaded from a serialized file, this option will have no effect.- Returns:
- a newly created XTCE database object.
- Throws:
ConfigurationExceptionDatabaseLoadException
-
getInstance
public static XtceDb getInstance(String yamcsInstance) throws ConfigurationException
retrieves the XtceDb for the corresponding yamcsInstance. if yamcsInstance is null, then the first one in the mdb.yaml config file is loaded- Parameters:
yamcsInstance-- Returns:
- Throws:
ConfigurationExceptionDatabaseLoadException
-
remove
public static void remove(String yamcsInstance)
Removes the Xtcedb corresponding to yamcsInstance from memory
-
reset
public static void reset()
forgets any singleton
-
-