Package org.yamcs.mdb
Class MdbFactory
java.lang.Object
org.yamcs.mdb.MdbFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Mdb
createInstance
(List<YConfiguration> treeConfig, boolean attemptToLoadSerialized, boolean saveSerialized) Load a XTCE database from a description.static Mdb
createInstanceByConfig
(String configSection) Creates a new instance of the database in memory. configSection is the top heading under which this appears in the mdb.yamlstatic Mdb
createInstanceByConfig
(String configSection, boolean attemptToLoadSerialized) static Mdb
getInstance
(String yamcsInstance) retrieves the MDB for the corresponding yamcsInstance. if yamcsInstance is null, then the first one in the mdb.yaml config file is loadedstatic Mdb
getInstanceByConfig
(String yamcsInstance, String config) static void
Removes the MDB corresponding to yamcsInstance from memorystatic void
reset()
forgets any singletonstatic void
Sets up this class (creation of cache directory).
-
Constructor Details
-
MdbFactory
public MdbFactory()
-
-
Method Details
-
createInstanceByConfig
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 Mdb createInstanceByConfig(String configSection, boolean attemptToLoadSerialized) throws ConfigurationException, DatabaseLoadException -
createInstance
public static Mdb 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:
ConfigurationException
DatabaseLoadException
-
getInstance
retrieves the MDB for the corresponding yamcsInstance. if yamcsInstance is null, then the first one in the mdb.yaml config file is loaded- Parameters:
yamcsInstance
-- Returns:
- Throws:
ConfigurationException
DatabaseLoadException
-
getInstanceByConfig
-
remove
Removes the MDB corresponding to yamcsInstance from memory -
reset
public static void reset()forgets any singleton -
setupTool
Sets up this class (creation of cache directory).This method is intended for client tools.
-