Interface SzConfig


public interface SzConfig
Defines the Java interface to the Senzing configuration functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    addDataSource(long configHandle, String dataSourceCode)
    Adds a new data source that is identified by the specified data source code to the in-memory configuration associated with the specified configuraiton handle.
    void
    closeConfig(long configHandle)
    Closes the in-memory configuration associated with the specified config handle and cleans up system resources.
    long
    Creates a new in-memory configuration using the default configuraiton template and returns the configuration handle for working with it.
    void
    deleteDataSource(long configHandle, String dataSourceCode)
    Deletes the data source identified by the specified data source code from the in-memory configuration associated with the specified config handle.
    exportConfig(long configHandle)
    Obtains the configuration definition formatted as JSON for the in-memory configuration associated with the specified configuration handle.
    getDataSources(long configHandle)
    Extracts the data sources from the in-memory configuration associated with the specified config handle returns the JSON text describing the data sources from the configuration.
    long
    importConfig(String configDefinition)
    Creates a new in-memory configuration using the specified configuration definition and returns the configuration handle for working with it.
  • Method Details

    • createConfig

      long createConfig() throws SzException
      Creates a new in-memory configuration using the default configuraiton template and returns the configuration handle for working with it.
      Returns:
      The configuraton handle for working with the configuration that was created.
      Throws:
      SzException - If a failure occurs.
    • importConfig

      long importConfig(String configDefinition) throws SzException
      Creates a new in-memory configuration using the specified configuration definition and returns the configuration handle for working with it. Depending upon implementation of this interface, the specified definition may allow other forms, but it is typically a JSON-formatted Senzing configuration (an example template JSON configuration ships with the Senzing product).
      Parameters:
      configDefinition - The definition for the Senzing configuration.
      Returns:
      The configuraton handle for working with the configuration that was created and populated with the specified definition.
      Throws:
      SzException - If a failure occurs.
    • exportConfig

      String exportConfig(long configHandle) throws SzException
      Obtains the configuration definition formatted as JSON for the in-memory configuration associated with the specified configuration handle.
      Parameters:
      configHandle - The configuration handle associated with the in-memory configuration to be formatted as JSON.
      Returns:
      The configuration defininition formatted as JSON.
      Throws:
      SzException - If a failure occurs.
    • closeConfig

      void closeConfig(long configHandle) throws SzException
      Closes the in-memory configuration associated with the specified config handle and cleans up system resources. After calling this method, the configuration handle can no longer be used and becomes invalid.
      Parameters:
      configHandle - The config handle identifying the in-memory configuration to close.
      Throws:
      SzException - If a failure occurs.
    • getDataSources

      String getDataSources(long configHandle) throws SzException
      Extracts the data sources from the in-memory configuration associated with the specified config handle returns the JSON text describing the data sources from the configuration.

      The format of the JSON response is as follows:

       {
         "DATA_SOURCES": [
           {
             "DSRC_ID": 1,
             "DSRC_CODE": "TEST"
           },
           {
             "DSRC_ID": 2,
             "DSRC_CODE": "SEARCH"
           }
         ]
       }
       
      Parameters:
      configHandle - The config handle associated witht he in-memory configuration from which to obtain the data sources.
      Returns:
      The JSON String describing the data sources found in the configuration.
      Throws:
      SzException - If a failure occurs.
    • addDataSource

      String addDataSource(long configHandle, String dataSourceCode) throws SzException
      Adds a new data source that is identified by the specified data source code to the in-memory configuration associated with the specified configuraiton handle.
      Parameters:
      configHandle - The config handle identifying the in-memory configuration to close.
      dataSourceCode - The data source code for the new data source.
      Returns:
      The JSON String describing the data source was added to the configuration.
      Throws:
      SzException - If a failure occurs.
    • deleteDataSource

      void deleteDataSource(long configHandle, String dataSourceCode) throws SzException
      Deletes the data source identified by the specified data source code from the in-memory configuration associated with the specified config handle.
      Parameters:
      configHandle - The config handle identifying the in-memory configuration to close.
      dataSourceCode - The data source code that identifies the data source to delete from the configuration.
      Throws:
      SzException - If a failure occurs.