Interface ConfigurationRepository

  • All Known Implementing Classes:
    DefaultConfigurationRepository

    public interface ConfigurationRepository
    A repository for basic storage of the configuration.
    • Field Detail

      • CONNECTOR_CONFIGURATION_KEY

        static final String CONNECTOR_CONFIGURATION_KEY
        Key of connector configuration record.
        See Also:
        Constant Field Values
      • CONNECTION_CONFIGURATION_KEY

        static final String CONNECTION_CONFIGURATION_KEY
        Key of connection configuration record.
        See Also:
        Constant Field Values
    • Method Detail

      • update

        <T> void update​(String key,
                        T value)
        Updates the configuration properties in the record stored under the provided key. If the configuration is not present, a new record will be created.
        Type Parameters:
        T - type of the provided value
        Parameters:
        key - key of the configuration record
        value - new configuration properties
      • fetch

        <T> Optional<T> fetch​(String key,
                              Class<T> clazz)
        Retrieves configuration properties from the record stored under the provided key, and maps them to the provided class.
        Type Parameters:
        T - type of the provided class
        Parameters:
        key - key of the configuration record
        clazz - a class to which the retrieved properties will be mapped
        Returns:
        an object of a given class, created by mapping the retrieved configuration properties
      • fetchAll

        ConfigurationMap fetchAll()
        Retrieves all configuration records and maps them to an ConfigurationMap instance.
        Returns:
        a configuration map containing all retrieved configuration records
      • delete

        void delete​(String key)
        Deletes the configuration record stored under the provided key. If the record does not exist, then no action is taken.
        Parameters:
        key - key of the configuration record
      • getInstance

        static ConfigurationRepository getInstance​(Session session)
        Returns a new instance of the default repository implementation.

        Default implementation of the repository uses a default implementation of KeyValueTable, created for the STATE.APP_CONFIG table.

        Parameters:
        session - Snowpark session object
        Returns:
        a new service instance