Class IntegrationContext

Direct Known Subclasses:
AnalyticsIntegratorContext, APIIntegratorContext, CatalogIntegratorContext, DatabaseIntegratorContext, DisplayIntegratorContext, FilesIntegratorContext, InfrastructureIntegratorContext, LineageIntegratorContext, OrganizationIntegratorContext, SearchIntegratorContext, SecurityIntegratorContext, TopicIntegratorContext

public class IntegrationContext extends Object
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

    • openIntegrationClient

      protected final OpenIntegrationClient openIntegrationClient
    • openMetadataStoreClient

      protected final OpenMetadataClient openMetadataStoreClient
    • userId

      protected final String userId
    • externalSourceGUID

      protected final String externalSourceGUID
    • externalSourceName

      protected final String externalSourceName
    • externalSourceIsHome

      protected boolean externalSourceIsHome
    • connectorName

      protected final String connectorName
    • integrationConnectorGUID

      protected final String integrationConnectorGUID
    • permittedSynchronization

      protected final PermittedSynchronization permittedSynchronization
    • integrationReportWriter

      protected final IntegrationReportWriter integrationReportWriter
    • maxPageSize

      protected final int maxPageSize
  • Constructor Details

    • IntegrationContext

      public IntegrationContext(String connectorId, String connectorName, String connectorUserId, String serverName, OpenIntegrationClient openIntegrationClient, OpenMetadataClient openMetadataStoreClient, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, String externalSourceGUID, String externalSourceName, String integrationConnectorGUID, int maxPageSize)
      Constructor handles standard values for all integration contexts.
      connectorId - unique identifier of the connector (used to configure the event listener)
      connectorName - name of connector from config
      connectorUserId - userId for the connector
      serverName - name of the integration daemon
      openIntegrationClient - client for calling the metadata server
      openMetadataStoreClient - client for calling the metadata server
      generateIntegrationReport - should the connector generate an integration reports?
      permittedSynchronization - enum
      externalSourceGUID - unique identifier of the software server capability for the source of metadata
      externalSourceName - unique name of the software server capability for the source of metadata
      integrationConnectorGUID - unique identifier of the integration connector entity (maybe null)
      maxPageSize - max number of elements that can be returned on a query
  • Method Details

    • getCatalogTargets

      public List<CatalogTarget> getCatalogTargets(int startingFrom, int maximumResults) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the identifiers of the metadata elements identified as catalog targets with an integration connector. Each catalog target may be configured with an optional symbolic name to guide the integration connector on how to use the catalog targets.
      startingFrom - initial position in the stored list.
      maximumResults - maximum number of definitions to return on this call.
      list of named element headers
      InvalidParameterException - one of the parameters is null or invalid,
      UserNotAuthorizedException - user not authorized to issue this request.
      PropertyServerException - problem retrieving the integration connector definition.
    • getMetadataSourceQualifiedName

      public String getMetadataSourceQualifiedName()
      Return the qualified name of the software capability that represents an external source of metadata. Used to control external provenance. If null the provenance is LOCAL_COHORT.
      string name
    • getPermittedSynchronization

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

      public IntegrationGovernanceContext getIntegrationGovernanceContext()
      Return the integration governance context that provides access to various Governance Action Framework (GAF) function.
      IntegrationGovernanceContext context object
    • setActiveReportPublishing

      public void setActiveReportPublishing(boolean flag)
      Set whether an integration report should be assembled and published. This allows the integration connector to turn off/on integration report writing. It only has an effect if the connector is configured to allow report writing
      flag - required behaviour
    • startRecording

      public void startRecording()
      Clear the report properties ready for a new report. This is not normally needed by the integration connector since it is called by the connector handler just before refresh. It is also called by publish report.
    • reportAnchorGUID

      protected void reportAnchorGUID(String elementGUID, String anchorGUID)
      Save the relationship between an element and its anchor. This is called by the methods of the context that create, update, archive or delete elements.
      elementGUID - unique identifier of the element
      anchorGUID - unique identifier of the associated anchor
    • reportParentGUID

      protected void reportParentGUID(String elementGUID, String parentGUID)
      Attempt to use the parent's GUID to discover the relationship between an element and its anchor. This is used to identify which report that the element should be reported under.
      elementGUID - unique identifier of the element
      parentGUID - unique identifier of the associated parent
    • reportElementCreation

      protected void reportElementCreation(String elementGUID)
      Save information about a newly created element.
      elementGUID - unique identifier of the element
    • reportElementUpdate

      protected void reportElementUpdate(String elementGUID)
      Save information about a newly updated element.
      elementGUID - unique identifier of the element
    • reportElementDelete

      protected void reportElementDelete(String elementGUID)
      Save information about a newly archived or deleted element.
      elementGUID - unique identifier of the element
    • publishReport

      Assemble the data collected and write out a report (if configured).
      InvalidParameterException - an invalid property has been passed
      UserNotAuthorizedException - the user is not authorized
      PropertyServerException - there is a problem communicating with the metadata server (or it has a logic error).
    • isRefreshInProgress

      public boolean isRefreshInProgress()
      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.
      boolean flag
    • getAnchorGUID

      public String getAnchorGUID(ElementHeader elementHeader)
      Retrieve the anchorGUID from the Anchors classification.
      elementHeader - element header where the classifications reside
      anchorGUID or null
    • getMaxPageSize

      public int getMaxPageSize()
      Returns the server configuration for the maximum number of elements that can be returned on a request. It is used to control paging.
    • isTypeOf

      public boolean isTypeOf(ElementHeader elementHeader, String typeName)
      Understand the type of element. It checks the type and super types.
      elementHeader - element to validate
      typeName - type to test
      boolean flag
    • isTypeOf

      public boolean isTypeOf(ElementType elementType, String typeName)
      Understand the type of element. It checks the type and super types.
      elementType - element to validate
      typeName - type to test
      boolean flag