Class DataSource<T>

    • Constructor Detail

      • DataSource

        public DataSource()
    • Method Detail

      • init

        public abstract void init​(Context context,
                                  Properties initProps)
        Initializes the DataSource with the Context and initialization properties.

        This is invoked by the DataImporter after creating an instance of this class.

      • getData

        public abstract T getData​(String query)
        Get records for the given query.The return type depends on the implementation .
        Parameters:
        query - The query string. It can be a SQL for JdbcDataSource or a URL for HttpDataSource or a file location for FileDataSource or a custom format for your own custom DataSource.
        Returns:
        Depends on the implementation. For instance JdbcDataSource returns an Iterator<Map <String,Object>>
      • close

        public abstract void close()
        Cleans up resources of this DataSource after use.