Class CatalogueConfig
- java.lang.Object
-
- uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig
-
public class CatalogueConfig extends Object
Deals purely with the (de)serialisation of an XML config file for aDatasetCatalogue
.- Author:
- Guy Griffiths
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CatalogueConfig.DatasetStorage
Defines an entry point for what to do once aDataset
has been loaded (i.e.
-
Field Summary
Fields Modifier and Type Field Description protected File
configFile
-
Constructor Summary
Constructors Modifier Constructor Description protected
CatalogueConfig()
CatalogueConfig(File configFile)
Creates a NEW config with an empty fileCatalogueConfig(DatasetConfig[] datasets, CacheInfo cacheInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataset(DatasetConfig dataset)
void
changeDatasetId(DatasetConfig dataset, String newId)
static CatalogueConfig
deserialise(Reader xmlConfig)
void
generateSchema(String path)
CacheInfo
getCacheSettings()
DatasetConfig
getDatasetInfo(String datasetId)
DatasetConfig[]
getDatasets()
void
loadDatasets()
static CatalogueConfig
readFromFile(File configFile)
void
removeDataset(DatasetConfig dataset)
void
save()
void
serialise(Writer writer)
void
setDatasetLoadedHandler(CatalogueConfig.DatasetStorage datasetStorage)
static void
shutdown()
String
toString()
-
-
-
Field Detail
-
configFile
protected File configFile
-
-
Constructor Detail
-
CatalogueConfig
protected CatalogueConfig()
-
CatalogueConfig
public CatalogueConfig(File configFile) throws IOException, javax.xml.bind.JAXBException
Creates a NEW config with an empty file- Parameters:
configFile
-- Throws:
IOException
javax.xml.bind.JAXBException
-
CatalogueConfig
public CatalogueConfig(DatasetConfig[] datasets, CacheInfo cacheInfo)
-
-
Method Detail
-
setDatasetLoadedHandler
public void setDatasetLoadedHandler(CatalogueConfig.DatasetStorage datasetStorage)
-
loadDatasets
public void loadDatasets()
-
getCacheSettings
public CacheInfo getCacheSettings()
-
getDatasetInfo
public DatasetConfig getDatasetInfo(String datasetId)
-
getDatasets
public DatasetConfig[] getDatasets()
-
addDataset
public void addDataset(DatasetConfig dataset)
-
removeDataset
public void removeDataset(DatasetConfig dataset)
-
changeDatasetId
public void changeDatasetId(DatasetConfig dataset, String newId)
-
save
public void save() throws IOException
- Throws:
IOException
-
shutdown
public static void shutdown()
-
serialise
public void serialise(Writer writer) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
generateSchema
public void generateSchema(String path) throws IOException, javax.xml.bind.JAXBException
- Throws:
IOException
javax.xml.bind.JAXBException
-
deserialise
public static CatalogueConfig deserialise(Reader xmlConfig) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
readFromFile
public static CatalogueConfig readFromFile(File configFile) throws javax.xml.bind.JAXBException, IOException
- Throws:
javax.xml.bind.JAXBException
IOException
-
-