Interface CdbReader

All Known Implementing Classes:
RdbReader, StructuredTextReader

public interface CdbReader
Interface to read data from the configuration database. All get methods return an Optional that is empty if the data to read was not found in the CDB. They throw an exception in case of error. Life cycle:
  • init() must be called before reading data from the CDB, to get the resources
  • shutdown() must be invoked when te CDB reader is not needed anymore, to free the allocated resources
Author:
acaproni
  • Method Details

    • getIas

      Optional<IasDao> getIas() throws IasCdbException
      Get the Ias configuration from a CDB.
      Returns:
      The ias configuration read from the CDB
      Throws:
      IasCdbException - In case of error getting the IAS
    • getIasios

      Optional<Set<IasioDao>> getIasios() throws IasCdbException
      Get the IASIOs.
      Returns:
      The IASIOs read from the CDB
      Throws:
      IasCdbException - In case of error getting the IASIOs
    • getIasio

      Optional<IasioDao> getIasio(String id) throws IasCdbException
      Get the IASIO with the given ID
      Parameters:
      id - The ID of the IASIO to read the configuration
      Returns:
      The IASIO read from the CDB
      Throws:
      IasCdbException - In case of error getting the IASIO
    • getSupervisor

      Optional<SupervisorDao> getSupervisor(String id) throws IasCdbException
      Read the supervisor configuration from the CDB.
      Parameters:
      id - The not null nor empty supervisor identifier
      Returns:
      The Supervisor read from the CDB
      Throws:
      IasCdbException - In case of error getting the Supervisor
    • getTransferFunction

      Optional<TransferFunctionDao> getTransferFunction(String tf_id) throws IasCdbException
      Read the transfer function configuration from the CDB.
      Parameters:
      tf_id - The not null nor empty transfer function identifier
      Returns:
      The transfer function read from the CDB
      Throws:
      IasCdbException - in case of error reading from the CDB
    • getTransferFunctions

      Optional<Set<TransferFunctionDao>> getTransferFunctions() throws IasCdbException
      Get the transfer functions.
      Returns:
      The transfer functions read from the CDB
      Throws:
      IasCdbException - In case of error getting the transfer functions
    • getTemplate

      Optional<TemplateDao> getTemplate(String template_id) throws IasCdbException
      Read the ttemplate configuration from the CDB.
      Parameters:
      template_id - The not null nor empty identifier of the template
      Returns:
      The template read from the CDB
      Throws:
      IasCdbException - in case of error reading from the CDB
    • getTemplates

      Optional<Set<TemplateDao>> getTemplates() throws IasCdbException
      Get the templates.
      Returns:
      The templates read from the CDB
      Throws:
      IasCdbException - In case of error getting the templates
    • getAsce

      Optional<AsceDao> getAsce(String id) throws IasCdbException
      Read the ASCE configuration from the CDB.
      Parameters:
      id - The not null nor empty ASCE identifier
      Returns:
      The ASCE read from the file
      Throws:
      IasCdbException - In case of error getting the ASCE
    • getDasu

      Optional<DasuDao> getDasu(String id) throws IasCdbException
      Read the DASU configuration from the CDB.
      Parameters:
      id - The not null nor empty DASU identifier
      Returns:
      The DASU read from the file
      Throws:
      IasCdbException - In case of error getting the DASU
    • getDasusToDeployInSupervisor

      Set<DasuToDeployDao> getDasusToDeployInSupervisor(String id) throws IasCdbException
      Return the DASUs to deploy in the Supervisor with the given identifier
      Parameters:
      id - The not null nor empty identifier of the supervisor
      Returns:
      A set of DASUs to deploy in the supervisor with the passed id
      Throws:
      IasCdbException - in case of error reading CDB or if the supervisor with the give identifier does not exist
    • getAscesForDasu

      Set<AsceDao> getAscesForDasu(String id) throws IasCdbException
      Return the ASCEs belonging to the given DASU.
      Parameters:
      id - The not null nor empty identifier of the DASU
      Returns:
      A set of ASCEs running in the DASU with the passed id
      Throws:
      IasCdbException - in case of error reading CDB or if the DASU with the give identifier does not exist
    • getIasiosForAsce

      Collection<IasioDao> getIasiosForAsce(String id) throws IasCdbException
      Return the IASIOs in input to the given ASCE.
      Parameters:
      id - The not null nor empty identifier of the ASCE
      Returns:
      A set of IASIOs in input to the ASCE
      Throws:
      IasCdbException - in case of error reading CDB or if the ASCE with the give identifier does not exist
    • getSupervisorIds

      Optional<Set<String>> getSupervisorIds() throws IasCdbException
      Get the IDs of the Supervisors. This method is useful to deploy the supervisors
      Returns:
      The the IDs of the supervisors read from the CDB
      Throws:
      IasCdbException - In case of error getting the IDs of the supervisors
    • getDasuIds

      Optional<Set<String>> getDasuIds() throws IasCdbException
      Get the IDs of the DASUs.
      Returns:
      The IDs of the DASUs read from the CDB
      Throws:
      IasCdbException - In case of error getting the IDs of the DASUs
    • getAsceIds

      Optional<Set<String>> getAsceIds() throws IasCdbException
      Get the IDs of the ASCEs.
      Returns:
      The IDs of the ASCEs read from the CDB
      Throws:
      IasCdbException - In case of error getting the IDs of the ASCEs
    • getTemplateInstancesIasiosForAsce

      Collection<TemplateInstanceIasioDao> getTemplateInstancesIasiosForAsce(String id) throws IasCdbException
      Return the templated IASIOs in input to the given ASCE. These inputs are the one generated by a different template than that of the ASCE (@see #124)
      Parameters:
      id - The not null nor empty identifier of the ASCE
      Returns:
      A set of template instance of IASIOs in input to the ASCE
      Throws:
      IasCdbException - in case of error reading CDB or if the ASCE with the give identifier does not exist
    • getClientConfig

      Optional<ClientConfigDao> getClientConfig(String id) throws IasCdbException
      Get the configuration of the client with the passed identifier. The configuration is passed as a string whose format depends on the client implementation.
      Parameters:
      id - The not null nor empty ID of the IAS client
      Returns:
      The configuration of the client
      Throws:
      IasCdbException - In case of error getting the configuration of the client
    • getPlugin

      Get the configuration of the plugin with the passed identifier. The configuration of the plugin can be read from a file or from the CDB. In both cases, the configuration is returned as #PluginConfigDao. This m,ethod returns the configuration from the CDB; reading from file is not implemented here.
      Parameters:
      id - The not null nor empty ID of the IAS plugin
      Returns:
      The configuration of the plugin
      Throws:
      IasCdbException - In case of error getting the configuration of the plugin
    • getPluginIds

      Optional<Set<String>> getPluginIds() throws IasCdbException
      Returns:
      The IDs of all the plugins in the CDB
      Throws:
      IasCdbException - In case of error getting the IDs of the plugins
    • getClientIds

      Optional<Set<String>> getClientIds() throws IasCdbException
      Returns:
      The IDs of all the plugins in the CDB
      Throws:
      IasCdbException - In case of error getting the IDs of the clients
    • init

      void init() throws IasCdbException
      Initialize the CDB
      Throws:
      IasCdbException
    • shutdown

      void shutdown() throws IasCdbException
      Close the CDB and release the associated resources
      Throws:
      IasCdbException