Package org.eso.ias.cdb.structuredtext
Class StructuredTextWriter
java.lang.Object
org.eso.ias.cdb.structuredtext.StructuredTextWriter
- All Implemented Interfaces:
CdbWriter
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CdbFiles
cdbFileNames return the names of the files to readfinal TextFileType
The type of the files of the CDBprotected final AtomicBoolean
Signal if the reader has been closedprotected final AtomicBoolean
Signal if the reader has been initialized -
Constructor Summary
ConstructorDescriptionStructuredTextWriter
(File parentFolder) StructuredTextWriter
(CdbFiles cdbFileNames) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.databind.ObjectMapper
Get theObjectMapper
depending on the type of files in the CDBvoid
init()
Initialize the CDBvoid
shutdown()
Close the CDB and release the associated resourcesvoid
Serialize the ASCE in the JSON file.void
writeClientConfig
(ClientConfigDao clientConfigDao) Write the configuration of the client with the passed identifier.void
Serialize the DASU in the JSON file.void
Serialize the ias in the JSON file.void
writeIasio
(IasioDao iasio, boolean append) Serialize the IASIO in the structured text file by delegation towriteIasios(Set, boolean)
void
writeIasios
(Set<IasioDao> iasios, boolean append) Serialize the IASIOs in the JSON file.void
writePluginConfig
(PluginConfigDao pluginConfigDao) Write the configuration of the passed pluginvoid
writeSupervisor
(SupervisorDao superv) Serialize the Supervisor in the JSON file.void
writeTemplate
(TemplateDao templateDao) Write the passed template to the CDBvoid
writeTransferFunction
(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:
init
in interfaceCdbWriter
- Throws:
IasCdbException
-
shutdown
Close the CDB and release the associated resources- Specified by:
shutdown
in interfaceCdbWriter
- Throws:
IasCdbException
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Get theObjectMapper
depending on the type of files in the CDB- Returns:
- The
ObjectMapper
to parse the files
-
writeIas
Serialize the ias in the JSON file.- Specified by:
writeIas
in 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:
writeSupervisor
in 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:
writeIasio
in interfaceCdbWriter
- Parameters:
iasio
- The IASIO configuration to write in the fileappend
- : iftrue
the 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
append
isfalse
then a new file is created otherwise the IASIOs in the passed files are written at the end of the file.
If a IASIO iniasios
already exists in the file, the latter is replaced by that in the set.- Specified by:
writeIasios
in interfaceCdbWriter
- Parameters:
iasios
- The IASIOs to write in the fileappend
- : iftrue
the 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:
writeDasu
in 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:
writeAsce
in 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:
writeTransferFunction
in 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:
writeTemplate
in 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:
writePluginConfig
in 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:
writeClientConfig
in interfaceCdbWriter
- Parameters:
clientConfigDao
- the configuraton of the client- Throws:
IasCdbException
- In case of error writing the configuration
-