Package com.yahoo.gsheetjdbc.data
Class GoogleSheetsDataFetcher
- java.lang.Object
-
- com.yahoo.gsheetjdbc.data.GoogleSheetsDataFetcher
-
- All Implemented Interfaces:
DataFetcher
public class GoogleSheetsDataFetcher extends Object implements DataFetcher
Concrete implementation of the DataFetcher.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.yahoo.gsheetjdbc.data.DataFetcher
DataFetcher.Result
-
-
Constructor Summary
Constructors Constructor Description GoogleSheetsDataFetcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataFetcher.ResultfetchDocumentSheet(CredentialFetcher credentialFetcher, String schema, String document, String range)Fetches a Google spreadsheet.StringfetchLastUpdateTime(String documentId, CredentialFetcher credentialFetcher)Fetches the last time a given document ID was modified using Drive API.
-
-
-
Method Detail
-
fetchDocumentSheet
public DataFetcher.Result fetchDocumentSheet(CredentialFetcher credentialFetcher, String schema, String document, String range)
Description copied from interface:DataFetcherFetches a Google spreadsheet.- Specified by:
fetchDocumentSheetin interfaceDataFetcher- 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.
-
-