Package org.yamcs.mdb
Class AbstractFileLoader
java.lang.Object
org.yamcs.mdb.AbstractFileLoader
- All Implemented Interfaces:
SpaceSystemLoader
- Direct Known Subclasses:
BaseSpreadsheetLoader
Abstract class for MDB loaders that load data from files (or directories with files)
-
Field Summary
-
Constructor Summary
-
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.boolean
needsUpdate
(RandomAccessFile consistencyDateFile) void
writeConsistencyDate
(FileWriter consistencyDateFile) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.mdb.SpaceSystemLoader
getWriter, isWritable, load, loadList
-
Field Details
-
log
-
configName
-
path
-
-
Constructor Details
-
AbstractFileLoader
- Throws:
ConfigurationException
-
-
Method Details
-
needsUpdate
public boolean needsUpdate(RandomAccessFile consistencyDateFile) throws IOException, ConfigurationException - Specified by:
needsUpdate
in 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
-
writeConsistencyDate
- Specified by:
writeConsistencyDate
in 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
-
getConfigName
Description copied from interface:SpaceSystemLoader
The 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:
getConfigName
in 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
-