java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
org.odpi.openmetadata.adapters.connectors.datastore.csvfile.CSVFileStoreConnector
All Implemented Interfaces:
org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore, CSVFileStore, org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension, org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension

public class CSVFileStoreConnector extends org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector implements CSVFileStore
CSVFileStoreConnector works with structured files to retrieve simple tables of data.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the file
    Return the list of column names associated with this structured file.
    long
    Return the number of records in the file.
    void
    initialize(String connectorInstanceId, org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties connectionProperties)
    Initialize the connector.
    readRecord(long dataRecordNumber)
    Return the requested data record.

    Methods inherited from class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector

    getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initializeConnectedAssetProperties, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, start, toString

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector

    clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore

    getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate
  • Constructor Details

    • CSVFileStoreConnector

      public CSVFileStoreConnector()
  • Method Details

    • initialize

      public void initialize(String connectorInstanceId, org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties connectionProperties)
      Initialize the connector.
      Overrides:
      initialize in class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
      Parameters:
      connectorInstanceId - - unique id for the connector instance - useful for messages etc
      connectionProperties - - POJO for the configuration used to create the connector.
    • getRecordCount

      public long getRecordCount() throws org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException, org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException
      Return the number of records in the file. This is achieved by scanning the file and counting the records - not recommended for very large files.
      Specified by:
      getRecordCount in interface CSVFileStore
      Returns:
      count
      Throws:
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException - problem accessing the file
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException - unable to find, open or scan the file.
    • getColumnNames

      public List<String> getColumnNames() throws org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException, org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException
      Return the list of column names associated with this structured file. This may be embedded in the first line of the file or encoded in the connection object used to create a connector instance.
      Specified by:
      getColumnNames in interface CSVFileStore
      Returns:
      a list of column names
      Throws:
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException - problem accessing the file
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException - unable to retrieve the column names
    • readRecord

      public List<String> readRecord(long dataRecordNumber) throws org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException, org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException
      Return the requested data record. The first record is record 0. If the first line of the file is the column names then record 0 is the line following the column names.
      Specified by:
      readRecord in interface CSVFileStore
      Parameters:
      dataRecordNumber - long
      Returns:
      List of strings, each string is the value from the column.
      Throws:
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException - problem accessing the file
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException - unable to find, open or read the file, or the file does not include the requested record.
    • disconnect

      public void disconnect()
      Close the file
      Overrides:
      disconnect in class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector