Class OpenMetadataDataSetConnectorBase
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.jacquard.tabulardatasets.OpenMetadataDataSetConnectorBase
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,ReadableTabularDataSource,VirtualConnectorExtension
- Direct Known Subclasses:
OpenMetadataRootDataSetConnectorBase,OpenMetadataTypesDataSetConnector,ValidMetadataValueSetListConnector
public abstract class OpenMetadataDataSetConnectorBase
extends ConnectorBase
implements AuditLoggingComponent, ReadableTabularDataSource
ReferenceDataSetConnectorBase enables interaction with a valid value set as if it is a tabular data set.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuditLogprotected ConnectorContextBaseprotected final Stringprotected ProductDefinitionprotected final PropertyHelperFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
ConstructorsConstructorDescriptionOpenMetadataDataSetConnectorBase(String connectorName) Constructor used to set up the name of this connector (supplied by the subclasses).OpenMetadataDataSetConnectorBase(String connectorName, ProductDefinition productDefinition) Constructor used to set up the name of this connector (supplied by the subclasses). -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the connectorReturn the list of column descriptions associated with this data source.protected List<TabularColumnDescription>getColumnDescriptions(ProductDefinition productDefinition) Return the list of column descriptions associated with this data source.intgetColumnNumber(String columnName) Locate the named column.Return the component description used by this connector in the audit log.protected booleangetElementHeaderRecordValue(ElementHeader elementHeader, String columnName, List<String> recordValues) Extracts the record values from the element header based on the specified column name.protected booleangetElementRecordValue(OpenMetadataRootProperties openMetadataRootProperties, String columnName, List<String> recordValues) Extracts the record values from the element properties based on the specified column name.getRecordValues(OpenMetadataRootElement rootElement) Convert the root element to a list of column values based on the data spec.Return the description for this data source.Return the table name for this data source.protected TabularColumnDescriptiongetTabularColumnDescription(ProductDataFieldDefinition productDataFieldDefinition, boolean isNullable, boolean isIdentifier) Convert an open metadata property enum into a tabular column description.abstract voidRefresh any cached values.voidsetAuditLog(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.voidsetColumnDescriptions(List<TabularColumnDescription> columnDescriptions) Set up the columns associated with this tabular data source.voidsetLocalEnvironment(String clientUserId, String localServerName, String localServiceName) Set up caller's environment details.voidstart()Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCamelToCanonicalCase, fromCanonicalToCamelCase, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getSecretsCollectionName, getSecretsLocation, getSecretsProvider, 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, setStatisticTimestampMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.odpi.openmetadata.frameworks.connectors.tabulardatasets.ReadableTabularDataSource
getRecordCount, readRecord
-
Field Details
-
auditLog
-
connectorName
-
connectorContext
-
propertyHelper
-
productDefinition
-
-
Constructor Details
-
OpenMetadataDataSetConnectorBase
Constructor used to set up the name of this connector (supplied by the subclasses).- Parameters:
connectorName- name of the connector
-
OpenMetadataDataSetConnectorBase
Constructor used to set up the name of this connector (supplied by the subclasses).- Parameters:
connectorName- name of the connector
-
-
Method Details
-
setAuditLog
Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.- Specified by:
setAuditLogin interfaceAuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorComponentDescription
Return the component description used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceAuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
setLocalEnvironment
public void setLocalEnvironment(String clientUserId, String localServerName, String localServiceName) Set up caller's environment details. Needs to be done before start is called.- Parameters:
clientUserId- caller's userIdlocalServerName- caller's serverlocalServiceName- caller's service
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classConnectorBase- Throws:
ConnectorCheckedException- the connector detected a problem.UserNotAuthorizedException- the connector was disconnected before/during start
-
refreshCache
Refresh any cached values.- Throws:
ConnectorCheckedException- unable to refresh
-
getTabularColumnDescription
protected TabularColumnDescription getTabularColumnDescription(ProductDataFieldDefinition productDataFieldDefinition, boolean isNullable, boolean isIdentifier) Convert an open metadata property enum into a tabular column description.- Parameters:
productDataFieldDefinition- property enumisNullable- is the field nullable?isIdentifier- is the filed all or part of the unique identifier for a row/record- Returns:
- tabular column description
-
getColumnDescriptions
protected List<TabularColumnDescription> getColumnDescriptions(ProductDefinition productDefinition) throws ConnectorCheckedException Return the list of column descriptions associated with this data source. The information should be sufficient to define the schema in a target data store.- Returns:
- a list of column descriptions or null if not available.
- Throws:
ConnectorCheckedException- data access problem
-
getTableName
Return the table name for this data source. This is in canonical name format where each word in the name should be capitalized, with spaces between the words. This format allows easy translation between different naming conventions.- Specified by:
getTableNamein interfaceReadableTabularDataSource- Returns:
- string
- Throws:
ConnectorCheckedException- no product definition
-
getTableDescription
Return the description for this data source.- Specified by:
getTableDescriptionin interfaceReadableTabularDataSource- Returns:
- string
- Throws:
ConnectorCheckedException- no product definition
-
getColumnDescriptions
Return the list of column descriptions associated with this data source. The information should be sufficient to define the schema in a target data store.- Specified by:
getColumnDescriptionsin interfaceReadableTabularDataSource- Returns:
- a list of column descriptions or null if not available.
- Throws:
ConnectorCheckedException- no product definition
-
getColumnNumber
Locate the named column. A negative number means the column is not present.- Specified by:
getColumnNumberin interfaceReadableTabularDataSource- Parameters:
columnName- name of the column to return- Returns:
- column
- Throws:
ConnectorCheckedException- problem extracting the column descriptions
-
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.- Parameters:
columnDescriptions- a list of column descriptions- Throws:
ConnectorCheckedException- data access problem
-
getElementHeaderRecordValue
protected boolean getElementHeaderRecordValue(ElementHeader elementHeader, String columnName, List<String> recordValues) Extracts the record values from the element header based on the specified column name.- Parameters:
elementHeader- element header containing the record valuescolumnName- name of the column to extract the value forrecordValues- list to store the extracted record values- Returns:
- true if the value was successfully extracted, false otherwise
-
getElementRecordValue
protected boolean getElementRecordValue(OpenMetadataRootProperties openMetadataRootProperties, String columnName, List<String> recordValues) Extracts the record values from the element properties based on the specified column name.- Parameters:
openMetadataRootProperties- properties objectcolumnName- name of column to extractrecordValues- array of values to append to- Returns:
- true if the value was successfully extracted, false otherwise
-
getRecordValues
protected List<String> getRecordValues(OpenMetadataRootElement rootElement) throws ConnectorCheckedException Convert the root element to a list of column values based on the data spec.- Parameters:
rootElement- valid value that is a member of the valid value set.- Returns:
- list of column value
- Throws:
ConnectorCheckedException- an unexpected exception has occurred
-
disconnect
public void disconnect()Close the connector- Overrides:
disconnectin classConnectorBase
-