java.lang.Object
org.yamcs.mdb.XtceLoader
- All Implemented Interfaces:
SpaceSystemLoader
XTCE XML loader. Used when the MDB configuration contains the type "xtce". For example in yamcs.instance.yaml:
mdb:
- type: xtce
args:
file: "mdb/BogusSAT-1.xml"
The loader is tolerant for XTCE versions 1.1 and 1.2.
For strict adherence to the standard, the file can be verified against the XSD with an external tool.
Options:
- file: the XML file to be loaded. Can be an absolute path or relative to the server directory. Mandatory.
- autoTmPartitions: if true (default) all the
SequenceContainerwill be automatically set as archive partitions unless they have a parent in the hierarchy that is manually configured for TM partitions. The manual configuration for TM partitions can be achieved using an AncillaryData property with the name Yamcs and the value UseAsArchivingPartition. SeeSequenceContainer.useAsArchivePartition(boolean)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe filename used to save the database after all the loaders have loaded it, is based on a concatenation of the config names returned by the loaders.This method is called when the writable property of a sub-tree is set true in the mdb configuration.booleanIf the SpaceSystemLoader supports a corresponding writer (that can write to disk the MDB modifications)org.yamcs.xtce.SpaceSystemload()loads the SpaceSystem database in memory.List<org.yamcs.xtce.SpaceSystem>loadList()Loads a list of SpaceSystems.booleanneedsUpdate(RandomAccessFile consistencyDateFile) voidwriteConsistencyDate(FileWriter consistencyDateFile)
-
Constructor Details
-
XtceLoader
-
XtceLoader
-
-
Method Details
-
needsUpdate
public boolean needsUpdate(RandomAccessFile consistencyDateFile) throws IOException, ConfigurationException - Specified by:
needsUpdatein interfaceSpaceSystemLoader- Parameters:
consistencyDateFile- check in this file when the last database has been loaded- Returns:
- if this loader has to reload the database from its source
- Throws:
IOException- if the consistencyDateFile can not be read for some reasonConfigurationException
-
loadList
public List<org.yamcs.xtce.SpaceSystem> loadList() throws ConfigurationException, DatabaseLoadExceptionDescription copied from interface:SpaceSystemLoaderLoads a list of SpaceSystems.They will be added to the parent in the order in which they appear in the list.
By default this method calls the
SpaceSystemLoader.load()and returns a list with one element.- Specified by:
loadListin interfaceSpaceSystemLoader- Returns:
- - the list of
- Throws:
DatabaseLoadExceptionConfigurationException
-
getConfigName
Description copied from interface:SpaceSystemLoaderThe filename used to save the database after all the loaders have loaded it, is based on a concatenation of the config names returned by the loaders. Thus if a loader can have multiple versions of the database, they should be saved in multiple files.- Specified by:
getConfigNamein interfaceSpaceSystemLoader- Returns:
- a string to be used as the filename where the serialised instance will be stored.
- Throws:
ConfigurationException- in case some of the configuration properties do not exist
-
writeConsistencyDate
- Specified by:
writeConsistencyDatein interfaceSpaceSystemLoader- Parameters:
consistencyDateFile- the file in which the consistency date should be written- Throws:
IOException- if the consistency date file can't be written for some reason
-
load
Description copied from interface:SpaceSystemLoaderloads the SpaceSystem database in memory. Some references may be unresolved- Specified by:
loadin interfaceSpaceSystemLoader- Throws:
DatabaseLoadExceptionConfigurationException
-
isWritable
public boolean isWritable()Description copied from interface:SpaceSystemLoaderIf the SpaceSystemLoader supports a corresponding writer (that can write to disk the MDB modifications)- Specified by:
isWritablein interfaceSpaceSystemLoader- Returns:
-
getWriter
Description copied from interface:SpaceSystemLoaderThis method is called when the writable property of a sub-tree is set true in the mdb configuration.If the SpaceSystem loader supports writing, this will return a writer that will be called each time the subsystem is modified.
If the loader does not support writing, it returns null.
May throw ConfigurationException if the writer is supported but the file to be written is read-only or does not have write permissions.
- Specified by:
getWriterin interfaceSpaceSystemLoader- Returns:
-