Class IntegrationContextManager

java.lang.Object
org.odpi.openmetadata.frameworks.integration.contextmanager.IntegrationContextManager
All Implemented Interfaces:
BitolDocumentManager, OpenLineageListenerManager
Direct Known Subclasses:
OIFContextManager

public abstract class IntegrationContextManager extends Object implements OpenLineageListenerManager, BitolDocumentManager
IntegrationContextManager is the base class for the context manager that is implemented by each integration service.
  • Field Details

    • partnerOMASPlatformRootURL

      protected String partnerOMASPlatformRootURL
    • partnerOMASServerName

      protected String partnerOMASServerName
    • governanceConfiguration

      protected GovernanceConfiguration governanceConfiguration
    • connectedAssetClient

      protected ConnectedAssetClient connectedAssetClient
    • openMetadataClient

      protected OpenMetadataClient openMetadataClient
    • assetHandler

      protected AssetHandler assetHandler
    • openGovernanceClient

      protected OpenGovernanceClient openGovernanceClient
    • localServerName

      protected String localServerName
    • localServerURL

      protected String localServerURL
    • localServiceName

      protected String localServiceName
    • localServerUserId

      protected String localServerUserId
    • secretsStoreProvider

      protected String secretsStoreProvider
    • secretsStoreLocation

      protected String secretsStoreLocation
    • secretsStoreCollection

      protected String secretsStoreCollection
    • maxPageSize

      protected int maxPageSize
    • auditLog

      protected AuditLog auditLog
  • Constructor Details

    • IntegrationContextManager

      protected IntegrationContextManager()
      Default constructor
  • Method Details

    • initializeContextManager

      public void initializeContextManager(String localServerName, String localServerURL, String localServiceName, String partnerOMASServerName, String partnerOMASPlatformRootURL, String userId, String secretsStoreProvider, String secretsStoreLocation, String secretsStoreCollection, int maxPageSize, AuditLog auditLog)
      Initialize server properties for the context manager.
      Parameters:
      localServerName - name of this integration daemon
      localServerURL - network address of the OMAG Server Platform this integration daemon is running on. This is not necessarily the platform the partner OMAS is running on, and a connector that works with "the local platform" needs this one rather than that one.
      localServiceName - name of calling service
      partnerOMASServerName - name of the server to connect to
      partnerOMASPlatformRootURL - the network address of the server running the OMAS REST services
      userId - caller's userId embedded in all HTTP requests
      secretsStoreProvider - secrets store connector for bearer token
      secretsStoreLocation - secrets store location for bearer token
      secretsStoreCollection - secrets store collection for bearer token
      maxPageSize - maximum number of results that can be returned on a single REST call
      auditLog - logging destination
    • createClients

      public abstract void createClients() throws InvalidParameterException
      Suggestion for subclass to create client(s) to partner OMAS.
      Throws:
      InvalidParameterException - the subclass is not able to create one of its clients
    • createEventClient

      public abstract OpenMetadataEventClient createEventClient(String connectorId) throws InvalidParameterException
      Suggestion for subclass to create client(s) to partner OMAS.
      Parameters:
      connectorId - used as the caller Id
      Throws:
      InvalidParameterException - the subclass is not able to create one of its clients
    • setUpMetadataSource

      protected String setUpMetadataSource(String metadataSourceQualifiedName, String connectorId, String connectorName, String connectorUserId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the metadata source's unique identifier (GUID) or if it is not defined, create the software server capability for this service.
      Parameters:
      metadataSourceQualifiedName - unique name of the software capability that represents this integration service
      connectorId - unique identifier of the connector (used to configure the event listener)
      connectorName - name of connector from config
      connectorUserId - userId for the connector
      Returns:
      unique identifier of the metadata source
      Throws:
      InvalidParameterException - one of the parameters passed (probably on initialize) is invalid
      UserNotAuthorizedException - the integration daemon's userId does not have access to the partner OMAS
      PropertyServerException - a problem in the remote server running the partner OMAS
    • setContext

      public IntegrationContext setContext(String connectorId, String connectorName, String connectorUserId, IntegrationConnector integrationConnector, String integrationConnectorGUID, PermittedSynchronization permittedSynchronization, boolean generateIntegrationReport, String metadataSourceQualifiedName, DeleteMethod deleteMethod) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Set up the context in the supplied connector. This is called between initialize() and start() on the connector.
      Parameters:
      connectorId - unique identifier of the connector (used to configure the event listener)
      connectorName - name of connector from config
      connectorUserId - userId for the connector
      integrationConnector - connector created from connection integration service configuration
      integrationConnectorGUID - unique identifier of the integration connector entity (only set if working with integration groups)
      permittedSynchronization - controls the direction(s) that metadata is allowed to flow
      generateIntegrationReport - should the connector generate an integration reports?
      metadataSourceQualifiedName - unique name of the software server capability that represents the metadata source.
      Returns:
      the new integration context
      Throws:
      InvalidParameterException - the connector is not of the correct type
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • 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.
      Specified by:
      registerListener in interface OpenLineageListenerManager
      Parameters:
      listener - listener to call
    • publishOpenLineageRunEvent

      public void publishOpenLineageRunEvent(String rawEvent)
      Called each time an open lineage event is published to the integration daemon as a JSON string. The kind of event (run, job or dataset) is determined from the properties present: a run event has a run, a dataset event has a dataset and a job event has a job but no run. The parsed bean is delivered to the registered listeners along with the raw JSON so that a connector can work with the Egeria beans or reformat the event using another set of beans. If the event cannot be parsed, it is delivered to the run event listeners with a null bean.
      Specified by:
      publishOpenLineageRunEvent in interface OpenLineageListenerManager
      Parameters:
      rawEvent - json payload received for the event
    • publishOpenLineageRunEvent

      public void publishOpenLineageRunEvent(OpenLineageRunEvent event)
      Called each time an open lineage run event is published to the integration demon. 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.
      Specified by:
      publishOpenLineageRunEvent in interface OpenLineageListenerManager
      Parameters:
      event - bean for the event
    • publishOpenLineageJobEvent

      public void publishOpenLineageJobEvent(OpenLineageJobEvent event)
      Called each time an open lineage job event is published to the integration demon.
      Specified by:
      publishOpenLineageJobEvent in interface OpenLineageListenerManager
      Parameters:
      event - bean for the event
    • publishOpenLineageDataSetEvent

      public void publishOpenLineageDataSetEvent(OpenLineageDataSetEvent event)
      Called each time an open lineage dataset event is published to the integration demon.
      Specified by:
      publishOpenLineageDataSetEvent in interface OpenLineageListenerManager
      Parameters:
      event - bean for the event
    • registerListener

      public void registerListener(BitolDocumentListener listener)
      The listener is implemented by the integration connector. Once it is registered with the context, its processDataContract() and processDataProduct() methods are called each time a Bitol document is published to the integration daemon.
      Specified by:
      registerListener in interface BitolDocumentManager
      Parameters:
      listener - listener to call
    • publishBitolDocument

      public void publishBitolDocument(String rawDocument)
      Publish a Bitol document of either kind. The document is parsed and routed to the listeners according to its "kind" property. If the document can not be parsed into Egeria's beans but its kind can be determined, the raw document is still passed to the listeners (with a null bean) so that it can be stored or forwarded.
      Specified by:
      publishBitolDocument in interface BitolDocumentManager
      Parameters:
      rawDocument - document in YAML or JSON format
    • publishDataContract

      public void publishDataContract(String rawDocument)
      Publish an Open Data Contract Standard (ODCS) data contract.
      Specified by:
      publishDataContract in interface BitolDocumentManager
      Parameters:
      rawDocument - document in YAML or JSON format
    • publishDataContract

      public void publishDataContract(DataContract dataContract)
      Publish an Open Data Contract Standard (ODCS) data contract.
      Specified by:
      publishDataContract in interface BitolDocumentManager
      Parameters:
      dataContract - bean for the document
    • publishDataProduct

      public void publishDataProduct(String rawDocument)
      Publish an Open Data Product Standard (ODPS) data product.
      Specified by:
      publishDataProduct in interface BitolDocumentManager
      Parameters:
      rawDocument - document in YAML or JSON format
    • publishDataProduct

      public void publishDataProduct(DataProduct dataProduct)
      Publish an Open Data Product Standard (ODPS) data product.
      Specified by:
      publishDataProduct in interface BitolDocumentManager
      Parameters:
      dataProduct - bean for the document