Class PostgresTabularDataSetConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.postgres.tabulardatasource.PostgresTabularDataSetConnector
- All Implemented Interfaces:
SecureConnectorExtension,WritableTabularDataSource,VirtualConnectorExtension
- Direct Known Subclasses:
PostgresTabularDataSetCollectionConnector
public class PostgresTabularDataSetConnector
extends ConnectorBase
implements WritableTabularDataSource
PostgresTabularDataSourceConnector 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
FieldsModifier and TypeFieldDescriptionprotected final PropertyHelperprotected Stringprotected StringFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRecord(List<String> dataValues) Write the requested data record to the end of the data source.voiddeleteRecord(long rowNumber) Remove the requested data record.voidClose the filelongReturn the number of records in the file.voidsetColumnDescriptions(List<TabularColumnDescription> columnDescriptions) Set up the columns associated with this tabular data source.voidstart()Indicates that the connector is completely configured and can begin processing.voidwriteRecord(long requestedRowNumber, List<String> dataValues) Write the requested data record.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestamp
-
Field Details
-
tableName
-
tableDescription
-
propertyHelper
-
-
Constructor Details
-
PostgresTabularDataSetConnector
public PostgresTabularDataSetConnector()
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classConnectorBase- Throws:
ConnectorCheckedException- there is a problem within the connector.UserNotAuthorizedException- the connector was disconnected before/during start
-
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:
getRecordCountin interfaceWritableTabularDataSource- Returns:
- count
- Throws:
ConnectorCheckedException- problem accessing the data
-
setColumnDescriptions
public void setColumnDescriptions(List<TabularColumnDescription> columnDescriptions) throws ConnectorCheckedException Set up the columns associated with this tabular data source. These are stored in the first record of the file. The rest of the file is cleared.- Specified by:
setColumnDescriptionsin interfaceWritableTabularDataSource- Parameters:
columnDescriptions- a list of column descriptions- Throws:
ConnectorCheckedException- there is a problem accessing the data
-
writeRecord
public void writeRecord(long requestedRowNumber, List<String> dataValues) throws ConnectorCheckedException Write the requested data record. The first data record is record 0. This process reads the entire file, inserts the record in the right place and writes it out again.- Specified by:
writeRecordin interfaceWritableTabularDataSource- Parameters:
requestedRowNumber- longdataValues- Map of column descriptions to strings, each string is the value for the column.- Throws:
ConnectorCheckedException- there is a problem accessing the data.
-
appendRecord
Write the requested data record to the end of the data source.- Specified by:
appendRecordin interfaceWritableTabularDataSource- Parameters:
dataValues- Map of column descriptions to strings, each string is the value for the column.- Throws:
ConnectorCheckedException- there is a problem accessing the data.
-
deleteRecord
Remove the requested data record. The first data record is record 0.- Specified by:
deleteRecordin interfaceWritableTabularDataSource- Parameters:
rowNumber- long- Throws:
ConnectorCheckedException- there is a problem accessing the data.
-
disconnect
public void disconnect()Close the file- Overrides:
disconnectin classConnectorBase
-