Package org.eso.ias.cdb.structuredtext
Class StructuredTextWriter
java.lang.Object
org.eso.ias.cdb.structuredtext.StructuredTextWriter
- All Implemented Interfaces:
CdbWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CdbFilescdbFileNames return the names of the files to readfinal TextFileTypeThe type of the files of the CDBprotected final AtomicBooleanSignal if the reader has been closedprotected final AtomicBooleanSignal if the reader has been initialized -
Constructor Summary
ConstructorsConstructorDescriptionStructuredTextWriter(File parentFolder) StructuredTextWriter(CdbFiles cdbFileNames) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.databind.ObjectMapperGet theObjectMapperdepending on the type of files in the CDBvoidinit()Initialize the CDBvoidshutdown()Close the CDB and release the associated resourcesvoidSerialize the ASCE in the JSON file.voidwriteClientConfig(ClientConfigDao clientConfigDao) Write the configuration of the client with the passed identifier.voidSerialize the DASU in the JSON file.voidSerialize the ias in the JSON file.voidwriteIasio(IasioDao iasio, boolean append) Serialize the IASIO in the structured text file by delegation towriteIasios(Set, boolean)voidwriteIasios(Set<IasioDao> iasios, boolean append) Serialize the IASIOs in the JSON file.voidwritePluginConfig(PluginConfigDao pluginConfigDao) Write the configuration of the passed pluginvoidwriteSupervisor(SupervisorDao superv) Serialize the Supervisor in the JSON file.voidwriteTemplate(TemplateDao templateDao) Write the passed template to the CDBvoidwriteTransferFunction(TransferFunctionDao transferFunction) Write the transfer function to the CDB
-
Field Details
-
initialized
Signal if the reader has been initialized -
closed
Signal if the reader has been closed -
cdbFileNames
cdbFileNames return the names of the files to read -
cdbFilesType
The type of the files of the CDB
-
-
Constructor Details
-
StructuredTextWriter
Constructor- Parameters:
cdbFileNames- The files of the CDB
-
StructuredTextWriter
- Throws:
IasCdbException
-
-
Method Details
-
init
Initialize the CDB- Specified by:
initin interfaceCdbWriter- Throws:
IasCdbException
-
shutdown
Close the CDB and release the associated resources- Specified by:
shutdownin interfaceCdbWriter- Throws:
IasCdbException
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Get theObjectMapperdepending on the type of files in the CDB- Returns:
- The
ObjectMapperto parse the files
-
writeIas
Serialize the ias in the JSON file.- Specified by:
writeIasin interfaceCdbWriter- Parameters:
ias- The IAS configuration to write in the file- Throws:
IasCdbException- In case of error writing the IAS
-
writeSupervisor
Serialize the Supervisor in the JSON file.- Specified by:
writeSupervisorin interfaceCdbWriter- Parameters:
superv- The Supervisor configuration to write in the file- Throws:
IasCdbException- In case of error writing the Supervisor
-
writeIasio
Serialize the IASIO in the structured text file by delegation towriteIasios(Set, boolean)- Specified by:
writeIasioin interfaceCdbWriter- Parameters:
iasio- The IASIO configuration to write in the fileappend- : iftruethe passed iasio is appended to the file otherwise a new file is created- Throws:
IasCdbException- In case of error writing the IASIO- See Also:
-
writeIasios
Serialize the IASIOs in the JSON file.If
appendisfalsethen a new file is created otherwise the IASIOs in the passed files are written at the end of the file.
If a IASIO iniasiosalready exists in the file, the latter is replaced by that in the set.- Specified by:
writeIasiosin interfaceCdbWriter- Parameters:
iasios- The IASIOs to write in the fileappend- : iftruethe passed iasios are appended to the file otherwise a new file is created- Throws:
IasCdbException- In case of error writing the IASIOs- See Also:
-
writeDasu
Serialize the DASU in the JSON file.- Specified by:
writeDasuin interfaceCdbWriter- Parameters:
dasu- The DASU configuration to write in the file- Throws:
IasCdbException- In case of error writing the DASU
-
writeAsce
Serialize the ASCE in the JSON file.- Specified by:
writeAscein interfaceCdbWriter- Parameters:
asce- The ASCE configuration to write in the file- Throws:
IasCdbException- In case of error writing the ASCE
-
writeTransferFunction
Write the transfer function to the CDB- Specified by:
writeTransferFunctionin interfaceCdbWriter- Parameters:
transferFunction- The TF configuration to write in the file- Throws:
IasCdbException- In case of error writing the TF
-
writeTemplate
Write the passed template to the CDB- Specified by:
writeTemplatein interfaceCdbWriter- Parameters:
templateDao- The template DAO to write in the file- Throws:
IasCdbException- In case of error writing the TF
-
writePluginConfig
Write the configuration of the passed plugin- Specified by:
writePluginConfigin interfaceCdbWriter- Parameters:
pluginConfigDao- the configuraton of the plugin- Throws:
IasCdbException- In case of error writing the configuration
-
writeClientConfig
Write the configuration of the client with the passed identifier. The configuration is written as it is i.e. without converting to JSON because the format of the config is defined by each client- Specified by:
writeClientConfigin interfaceCdbWriter- Parameters:
clientConfigDao- the configuraton of the client- Throws:
IasCdbException- In case of error writing the configuration
-