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
,ReadableTabularDataSource
,SecureConnectorExtension
,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 AuditLog
protected List<TabularColumnDescription>
protected ConnectorContextBase
protected final String
Fields 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 TypeMethodDescriptionvoid
Close the connectorReturn the list of column descriptions associated with this data source.int
getColumnNumber
(String columnName) Locate the named column.Return the component description that is used by this connector in the audit log.protected TabularColumnDescription
getTabularColumnDescription
(OpenMetadataProperty openMetadataProperty, boolean isNullable, boolean isIdentifier) Convert an open metadata property enum into a tabular column description.abstract void
Refresh any cached values,void
setAuditLog
(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.void
setColumnDescriptions
(List<TabularColumnDescription> columnDescriptions) Set up the columns associated with this tabular data source.void
setLocalEnvironment
(String clientUserId, String localServerName, String localServiceName) Set up caller's environment details.void
start()
Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, 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, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestamp
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.odpi.openmetadata.frameworks.connectors.ReadableTabularDataSource
getRecordCount, 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:
setAuditLog
in interfaceAuditLoggingComponent
- Parameters:
auditLog
- audit log object
-
getConnectorComponentDescription
Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescription
in 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:
start
in 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:
getColumnDescriptions
in 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:
getColumnNumber
in 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:
disconnect
in classConnectorBase
-