Interface DataSrc


public interface DataSrc
The interface that abstracts a data source responsible for managing connections to external data services, such as databases, file systems, or messaging services.

It receives configuration for connecting to an external data service and then creates and supplies a DataConn instance, representing a single session connection.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the data source, releasing all resources and shutting down connections managed by this source.
    Creates and returns a new DataConn instance, representing a single session connection to the external data service.
    void
    Sets up the data source, performing any necessary initialization or configuration to establish connectivity to the external data service.
  • Method Details

    • setup

      void setup(AsyncGroup ag) throws com.github.sttk.errs.Exc
      Sets up the data source, performing any necessary initialization or configuration to establish connectivity to the external data service. This method is typically called once at the application startup.
      Parameters:
      ag - An AsyncGroup that can be used for asynchronous setup operations, especially if initialization is time-consuming.
      Throws:
      com.github.sttk.errs.Exc - if an error occurs during the setup process.
    • close

      void close()
      Closes the data source, releasing all resources and shutting down connections managed by this source. This method should be called when the application is shutting down to ensure proper resource cleanup.
    • createDataConn

      DataConn createDataConn() throws com.github.sttk.errs.Exc
      Creates and returns a new DataConn instance, representing a single session connection to the external data service. Each call to this method should yield a new, independent connection.
      Returns:
      A new DataConn instance for a session.
      Throws:
      com.github.sttk.errs.Exc - if an error occurs while creating the data connection.