Class CSVFileStoreConnector
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:
BasicFileStore
,CSVFileStore
,SecureConnectorExtension
CSVFileStoreConnector works with structured files to retrieve simple tables of data.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
fileStoreName
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, secretsStoreConnectorMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the fileReturn the list of column names associated with this structured file.Return the name of the file to read.Return the last update data for the file.long
Return the number of records in the file.void
initialize
(String connectorInstanceId, ConnectionProperties connectionProperties) Initialize the connector.readRecord
(int dataRecordNumber) Return the requested data record.Methods inherited from class org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStoreConnector
getFile, getFile
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnectConnectors, equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initializeConnectedAssetProperties, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
getFile
-
Constructor Details
-
CSVFileStoreConnector
public CSVFileStoreConnector()
-
-
Method Details
-
initialize
Initialize the connector.- Overrides:
initialize
in classBasicFileStoreConnector
- Parameters:
connectorInstanceId
- - unique id for the connector instance - useful for messages etcconnectionProperties
- - POJO for the configuration used to create the connector.
-
getFileName
Return the name of the file to read.- Specified by:
getFileName
in interfaceCSVFileStore
- Returns:
- file name
- Throws:
FileException
- problem accessing the file
-
getLastUpdateDate
Return the last update data for the file.- Specified by:
getLastUpdateDate
in interfaceCSVFileStore
- Returns:
- Date object
- Throws:
FileException
- problem accessing the file
-
getRecordCount
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 interfaceCSVFileStore
- Returns:
- count
- Throws:
FileException
- problem accessing the fileFileReadException
- unable to find, open or scan the file.
-
getColumnNames
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 interfaceCSVFileStore
- Returns:
- a list of column names
- Throws:
FileException
- problem accessing the fileFileReadException
- unable to retrieve the column names
-
readRecord
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 interfaceCSVFileStore
- Parameters:
dataRecordNumber
- long- Returns:
- List of strings, each string is the value from the column.
- Throws:
FileException
- problem accessing the fileFileReadException
- 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 classBasicFileStoreConnector
-