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.
  • Field Details

  • Constructor Details

    • ReferenceDataSetConnectorBase

      public ReferenceDataSetConnectorBase(String connectorName)
      Constructor used to set up the name of this connector (supplied by the subclasses).
      Parameters:
      connectorName - name of the connector
  • Method Details

    • setAuditLog

      public void setAuditLog(AuditLog auditLog)
      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 interface AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface AuditLoggingComponent
      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 userId
      localServerName - caller's server
      localServiceName - caller's service
    • start

      Indicates that the connector is completely configured and can begin processing.
      Overrides:
      start in class ConnectorBase
      Throws:
      ConnectorCheckedException - there is a problem within the connector.
      UserNotAuthorizedException - the connector was disconnected before/during start
    • refreshCache

      public abstract void refreshCache() throws ConnectorCheckedException
      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 enum
      isNullable - is the field nullable
      isIdentifier - is the filed all or part of the unique identifier for a row/record
      Returns:
      tabular column description
    • getColumnDescriptions

      public List<TabularColumnDescription> getColumnDescriptions() 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.
      Specified by:
      getColumnDescriptions in interface ReadableTabularDataSource
      Returns:
      a list of column descriptions or null if not available.
      Throws:
      ConnectorCheckedException - there is a problem accessing the data
    • getColumnNumber

      public int getColumnNumber(String columnName) throws ConnectorCheckedException
      Locate the named column. A negative number means the column is not present.
      Specified by:
      getColumnNumber in interface ReadableTabularDataSource
      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 class ConnectorBase