Class IntegrationContext

java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
org.odpi.openmetadata.frameworks.integration.context.IntegrationContext
Direct Known Subclasses:
CatalogTargetContext

public class IntegrationContext extends ConnectorContextBase
IntegrationContext is the base class for the integration context provided to the integration connector to provide access to open metadata services. Each integration service specializes this class to provide the method appropriate for the particular type of technology it is supporting. This base class supports the common methods available to all types of integration connectors.
  • Field Details

  • Constructor Details

    • IntegrationContext

      public IntegrationContext(String localServerName, String localServiceName, String externalSourceGUID, String externalSourceName, String connectorId, String connectorName, String connectorUserId, String connectorGUID, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, OpenMetadataClient openMetadataClient, OpenMetadataEventClient openMetadataEventClient, ConnectedAssetClient connectedAssetClient, OpenIntegrationClient openIntegrationClient, OpenLineageListenerManager openLineageListenerManager, GovernanceConfiguration governanceConfiguration, OpenGovernanceClient openGovernanceClient, AuditLog auditLog, int maxPageSize, DeleteMethod deleteMethod)
      Constructor handles standard values for all integration contexts.
      Parameters:
      localServerName - name of local server
      localServiceName - name of the service to call
      externalSourceGUID - metadata collection unique id
      externalSourceName - metadata collection unique name
      connectorId - unique identifier of the connector (used to configure the event listener)
      connectorName - name of connector from config
      connectorUserId - userId for the connector
      connectorGUID - unique identifier of the integration connector entity (maybe null)
      generateIntegrationReport - should the connector generate an integration reports?
      permittedSynchronization - enum
      openMetadataClient - client to access open metadata store
      openMetadataEventClient - client to access open metadata events
      connectedAssetClient - client for working with connectors
      openIntegrationClient - client for calling the metadata server
      governanceConfiguration - client for managing catalog targets
      openGovernanceClient - client for initiating governance actions
      auditLog - logging destination
      maxPageSize - max number of elements that can be returned on a query
      deleteMethod - default delete method
  • Method Details

    • getCatalogTargetContext

      Return a new context for a configured catalog target.
      Parameters:
      requestedCatalogTarget - details of the catalog target configuration
      Returns:
      new context with the correct external source
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • registerListener

      public void registerListener(OpenLineageEventListener listener)
      The listener is implemented by the integration connector. Once it is registered with the context, its processOpenLineageRunEvent() method is called each time an open lineage event is published to the integration daemon.
      Parameters:
      listener - listener to call
    • publishOpenLineageRunEvent

      public void publishOpenLineageRunEvent(String rawEvent)
      Called each time an integration connector wishes to publish an open lineage run event. The event is formatted and passed to each of the registered open lineage event listeners.
      Parameters:
      rawEvent - json payload to send for the event
    • publishOpenLineageRunEvent

      public void publishOpenLineageRunEvent(OpenLineageRunEvent event)
      Called each time an open lineage run event is published to the integration daemon. The integration connector is able to work with the formatted event using the Egeria beans or reformat the open lineage run event using the supplied open lineage backend beans or another set of beans.
      Parameters:
      event - bean for the event
    • getPermittedSynchronization

      public PermittedSynchronization getPermittedSynchronization()
      Return the permitted synchronization direction. This setting may affect which method in the context are available to the integration connector.
      Returns:
      permittedSynchronization enum
    • elementShouldBeCatalogued

      public boolean elementShouldBeCatalogued(String elementName, List<String> excludedNames, List<String> includedNames)
      Determine whether a particular element should be catalogued. The include list takes precedent over the exclude list.
      Parameters:
      elementName - name of the element
      excludedNames - list of names to exclude (null means ignore value)
      includedNames - list of names to include (null means ignore value)
      Returns:
      flag indicating whether to work with the database
    • noListenerRegistered

      public boolean noListenerRegistered()
      Return a flag indicating whether a listener has been registered or not.
      Returns:
      true means the listener has been successfully registered
    • registerListener

      Register a listener object that will be passed each of the events published by the Open Metadata Server.
      Parameters:
      listener - listener object
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • getConnectedAssetContext

      public ConnectedAssetContext getConnectedAssetContext()
      Return the connected asset context that support an integration connector working with assets and their connectors.
      Returns:
      connected asset context
    • getStewardshipAction

      public StewardshipAction getStewardshipAction()
      Return the connected asset context that support an integration connector working with assets and their connectors.
      Returns:
      connected asset context
    • getOpenGovernanceClient

      public OpenGovernanceClient getOpenGovernanceClient()
      Return the open governance client. This supports defining and initiating governance actions, and managing duplicates.
      Returns:
      client
    • getConnectorConfigClient

      public ConnectorConfigClient getConnectorConfigClient()
      Return the client for managing the metadata associated with running connectors, governance engines and governance services.
      Returns:
      connector context client
    • getIntegrationConnectorGUID

      public String getIntegrationConnectorGUID()
      Return the unique identifier of the element that represents this integration connector in open metadata.
      Returns:
      string guid
    • getMetadataSourceQualifiedName

      public String getMetadataSourceQualifiedName()
      Return the qualified name of the software capability that represents an external source of metadata. Used to control external provenance and as a parent for some asset cataloguing. If null the provenance is LOCAL_COHORT.
      Returns:
      string name
    • getMetadataSourceGUID

      public String getMetadataSourceGUID()
      Return the guid of the software capability that represents an external source of metadata. Used to control external provenance and as a parent for some asset cataloguing. If null the provenance is LOCAL_COHORT.
      Returns:
      string name
    • getMetadataSourceGUID

      public String getMetadataSourceGUID(String metadataSourceQualifiedName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Return the unique identifier of metadata collection that corresponds to the qualified name of a software capability, This qualified name is supplied through open metadata values and may be incorrect which is why any exceptions from retrieving the software capability are passed through to the caller.
      Parameters:
      metadataSourceQualifiedName - supplied qualified name for the metadata collection
      Returns:
      null or unique identifier of the associated software capability
      Throws:
      InvalidParameterException - the unique name is null or not known.
      UserNotAuthorizedException - the caller's userId is not able to access the element
      PropertyServerException - there is a problem accessing the metadata store
    • noRefreshInProgress

      public boolean noRefreshInProgress()
      Return whether there is a refresh in progress. This method is used in processEvent() to enable to connector to ignore events while it is running refresh() since many of the events are caused by the refresh process. Using this flag prevents the connector from processing the same elements multiple times.
      Returns:
      boolean flag
    • setRefreshInProgress

      public void setRefreshInProgress(boolean refreshInProgress)
      Set up whether the refresh is in progress or not.
      Parameters:
      refreshInProgress - boolean flag