Class ReferenceDataSetConnectorBase
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.referencedata.tabulardatasets.ReferenceDataSetConnectorBase
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,ReadableTabularDataSource,VirtualConnectorExtension
- Direct Known Subclasses:
ValidValueDataSetConnector,ValidValueSetListConnector
public abstract class ReferenceDataSetConnectorBase
extends ConnectorBase
implements AuditLoggingComponent, ReadableTabularDataSource
ValidValueDataSetConnector 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 List<TabularColumnDescription>protected ConnectorContextBaseprotected final StringFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
ConstructorsConstructorDescriptionReferenceDataSetConnectorBase(String connectorName) 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.intgetColumnNumber(String columnName) Locate the named column.Return the component description that is used by this connector in the audit log.protected TabularColumnDescriptiongetTabularColumnDescription(OpenMetadataProperty openMetadataProperty, 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, 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, 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, getTableDescription, getTableName, readRecord
-
Field Details
-
auditLog
-
connectorName
-
connectorContext
-
columnDescriptions
-
-
Constructor Details
-
ReferenceDataSetConnectorBase
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 that is 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- there is a problem within the connector.UserNotAuthorizedException- the connector was disconnected before/during start
-
refreshCache
Refresh any cached values,- Throws:
ConnectorCheckedException- unable to refresh
-
getTabularColumnDescription
protected TabularColumnDescription getTabularColumnDescription(OpenMetadataProperty openMetadataProperty, boolean isNullable, boolean isIdentifier) Convert an open metadata property enum into a tabular column description.- Parameters:
openMetadataProperty- property enumisNullable- is the field nullableisIdentifier- is the filed all or part of the unique identifier for a row/record- Returns:
- tabular column description
-
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- there is a problem accessing the data
-
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- there is a problem accessing the data
-
disconnect
public void disconnect()Close the connector- Overrides:
disconnectin classConnectorBase
-