Class GoogleSheetsDataFetcher

  • All Implemented Interfaces:
    DataFetcher

    public class GoogleSheetsDataFetcher
    extends Object
    implements DataFetcher
    Concrete implementation of the DataFetcher.
    • Constructor Detail

      • GoogleSheetsDataFetcher

        public GoogleSheetsDataFetcher()
    • Method Detail

      • fetchDocumentSheet

        public DataFetcher.Result fetchDocumentSheet​(CredentialFetcher credentialFetcher,
                                                     String schema,
                                                     String document,
                                                     String range)
        Description copied from interface: DataFetcher
        Fetches a Google spreadsheet.
        Specified by:
        fetchDocumentSheet in interface DataFetcher
        Parameters:
        credentialFetcher - Wraps credentials needed to access Google APIs.
        schema - The Google document ID to fetch.
        document - The spreadsheet range: 'SheetName!A1:G11'
        range - The schema name where data will be stored in the database.
        Returns:
        A result object containg the table schema and associated data.
      • fetchLastUpdateTime

        public String fetchLastUpdateTime​(String documentId,
                                          CredentialFetcher credentialFetcher)
        Fetches the last time a given document ID was modified using Drive API.
        Parameters:
        documentId - The Google document ID.
        credentialFetcher - Google API credentials
        Returns:
        A string representing the timestamp of the last document modification.