Class DiscoveryService

java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.discovery.DiscoveryService
All Implemented Interfaces:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension, OpenDiscoveryService
Direct Known Subclasses:
DiscoveryPipeline

public abstract class DiscoveryService extends org.odpi.openmetadata.frameworks.connectors.ConnectorBase implements OpenDiscoveryService, org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension
DiscoveryService describes a specific type of connector that is responsible for analyzing the content of a specific asset. Information about the asset to analyze is passed in the discovery context. The returned discovery context also contains the results. Some discovery services manage the invocation of other discovery services. These discovery services are called discovery pipelines.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    org.odpi.openmetadata.frameworks.connectors.ConnectorBase.ProtectedConnection
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.odpi.openmetadata.frameworks.auditlog.AuditLog
     
     
    protected String
     
    protected List<org.odpi.openmetadata.frameworks.connectors.Connector>
     

    Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, securedProperties
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Free up any resources held since the connector is no longer needed.
    org.odpi.openmetadata.frameworks.auditlog.ComponentDescription
    Return the component description that is used by this connector in the audit log.
    Return the discovery context for this discovery service.
    Retrieve and validate the list of embedded connectors and cast them to discovery service connector.
    protected void
    Provide a common exception for unexpected errors.
    void
    initializeEmbeddedConnectors(List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors)
    Set up the list of discovery services connectors that will be invoked as part of this discovery pipeline.
    void
    setAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog)
    Receive an audit log object that can be used to record audit log messages.
    void
    Set up details of the asset to analyze and the results of any previous analysis.
    void
    setDiscoveryServiceName(String discoveryServiceName)
    Set up the discovery service name.
    void
    Indicates that the discovery service is completely configured and can begin processing.

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

    equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initialize, initializeConnectedAssetProperties, isActive, toString

    Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector

    clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • discoveryServiceName

      protected String discoveryServiceName
    • discoveryContext

      protected DiscoveryContext discoveryContext
    • auditLog

      protected org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog
    • embeddedConnectors

      protected List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors
  • Constructor Details

    • DiscoveryService

      public DiscoveryService()
  • Method Details

    • setAuditLog

      public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.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 org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • initializeEmbeddedConnectors

      public void initializeEmbeddedConnectors(List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors)
      Set up the list of discovery services connectors that will be invoked as part of this discovery pipeline. The connectors are initialized waiting to start. After start() is called on the discovery pipeline, it will choreograph the invocation of its embedded discovery services by calling start() to each of them when they are to run. Similarly for disconnect().
      Specified by:
      initializeEmbeddedConnectors in interface org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension
      Parameters:
      embeddedConnectors - list of embedded connectors that are hopefully discovery services
    • setDiscoveryContext

      public void setDiscoveryContext(DiscoveryContext discoveryContext)
      Set up details of the asset to analyze and the results of any previous analysis.
      Parameters:
      discoveryContext - information about the asset to analyze and the results of analysis of other discovery service request. Partial results from other discovery services run as part of the same discovery service request may also be stored in the newAnnotations list.
    • setDiscoveryServiceName

      public void setDiscoveryServiceName(String discoveryServiceName)
      Set up the discovery service name. This is used in error messages.
      Parameters:
      discoveryServiceName - name of the discovery service
    • getDiscoveryContext

      public DiscoveryContext getDiscoveryContext()
      Return the discovery context for this discovery service. This is typically called after the disconnect() method is called. If called before disconnect(), it may only contain partial results.
      Returns:
      discovery context containing the results discovered (so far) by the discovery service.
    • getEmbeddedDiscoveryServices

      protected List<DiscoveryService> getEmbeddedDiscoveryServices() throws DiscoveryServiceException
      Retrieve and validate the list of embedded connectors and cast them to discovery service connector. This is used by DiscoveryPipelines and DiscoveryScanningServices.
      Returns:
      list of discovery service connectors
      Throws:
      DiscoveryServiceException - one of the embedded connectors is not a discovery service
    • start

      public void start() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Indicates that the discovery service is completely configured and can begin processing. This is where the function of the discovery service is implemented. This is a standard method from the Open Connector Framework (OCF) so be sure to call super.start() in your version.
      Overrides:
      start in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - there is a problem within the discovery service.
    • handleUnexpectedException

      protected void handleUnexpectedException(String methodName, Throwable error) throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Provide a common exception for unexpected errors.
      Parameters:
      methodName - calling method
      error - caught exception
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - wrapped exception
    • disconnect

      public void disconnect() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Free up any resources held since the connector is no longer needed.
      Overrides:
      disconnect in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - there is a problem within the connector.