Class IntegrationContext

java.lang.Object
org.odpi.openmetadata.frameworks.integration.context.IntegrationContext

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.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntegrationContext(String connectorId, String connectorName, String connectorUserId, String serverName, OpenIntegrationClient openIntegrationClient, org.odpi.openmetadata.frameworks.governanceaction.client.GovernanceConfiguration governanceConfiguration, org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient openMetadataStoreClient, org.odpi.openmetadata.frameworks.governanceaction.client.ActionControlInterface actionControlInterface, boolean generateIntegrationReport, org.odpi.openmetadata.frameworks.openmetadata.enums.PermittedSynchronization permittedSynchronization, String externalSourceGUID, String externalSourceName, String integrationConnectorGUID, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog, int maxPageSize)
    Constructor handles standard values for all integration contexts.
  • Method Summary

    Modifier and Type
    Method
    Description
    addCatalogTarget(String integrationConnectorGUID, String metadataElementGUID, org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTargetProperties properties)
    Add a catalog target to another integration connector.
    addCatalogTarget(String metadataElementGUID, org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTargetProperties properties)
    Add a catalog target to this integration connector.
    void
    Disconnect the file listener.
    boolean
    elementShouldBeCatalogued(String elementName, List<String> excludedNames, List<String> includedNames)
    Determine whether a particular element should be catalogued.
    getAnchorGUID(org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataElement openMetadataElement)
    Retrieve the anchorGUID from the Anchors classification.
    getAnchorGUID(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader elementHeader)
    Retrieve the anchorGUID from the Anchors classification.
    org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTarget
    getCatalogTarget(String relationshipGUID)
    Retrieve a specific catalog target associated with an integration connector.
    List<org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTarget>
    getCatalogTargets(int startingFrom, int maximumResults)
    Retrieve the identifiers of the metadata elements identified as catalog targets with an integration connector.
    List<org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTarget>
    getCatalogTargets(String integrationConnectorGUID, int startingFrom, int maximumResults)
    Retrieve the identifiers of the metadata elements identified as catalog targets with another integration connector.
    Return the connected asset context that support an integration connector working with assets and their connectors.
    boolean
    Return the flag indicating whether the external source name is to be used as the new element's metadata collection, or they belong to the local cohort.
    org.odpi.openmetadata.frameworks.governanceaction.fileclassifier.FileClassifier
    Return the file classifier that uses reference data to describe a file.
    Return the integration governance context that provides access to various Governance Action Framework (GAF) function.
    int
    Returns the server configuration for the maximum number of elements that can be returned on a request.
    Return the guid of the software capability that represents an external source of metadata.
    Return the qualified name of the software capability that represents an external source of metadata.
    Return the userId for this connector.
    org.odpi.openmetadata.frameworks.openmetadata.enums.PermittedSynchronization
    Return the permitted synchronization direction.
    boolean
    Return whether there is a refresh in progress.
    boolean
    isTypeOf(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader elementHeader, String typeName)
    Understand the type of element.
    boolean
    isTypeOf(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementType elementType, String typeName)
    Understand the type of element.
    void
    registerDirectoryListener(FileDirectoryListenerInterface listener, File directoryToMonitor, FileFilter fileFilter)
    Register a listener object that will be called each time a file is created, changed or deleted in a specific root directory.
    void
    Register a listener object that will be called each time a file is created, changed or deleted in a specific root directory and any of its subdirectories.
    void
    Register a listener object that will be called each time a specific file is created, changed or deleted.
    void
    removeCatalogTarget(String relationshipGUID)
    Unregister a catalog target from the integration connector.
    void
    Set whether an integration report should be assembled and published.
    void
    setExternalSourceIsHome(boolean newValue)
    Set the flag indicating whether the external source name is to be used as the new element's metadata collection, or they belong to the local cohort.
    void
    setMetadataSourceQualifiedName(String metadataSourceQualifiedName)
    Change the metadata collection that is in use when working with open metadata.
    void
    setMetadataSourceQualifiedName(String metadataSourceGUID, String metadataSourceQualifiedName)
    Change the metadata collection that is in use when working with open metadata.
    void
    Unregister a listener object for the directory.
    void
    Unregister a listener object for the directory.
    void
    Unregister a listener object that will be called each time a specific file is created, changed or deleted.
    void
    updateCatalogTarget(String relationshipGUID, org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTargetProperties properties)
    Update a catalog target relationship for an integration connector.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IntegrationContext

      public IntegrationContext(String connectorId, String connectorName, String connectorUserId, String serverName, OpenIntegrationClient openIntegrationClient, org.odpi.openmetadata.frameworks.governanceaction.client.GovernanceConfiguration governanceConfiguration, org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient openMetadataStoreClient, org.odpi.openmetadata.frameworks.governanceaction.client.ActionControlInterface actionControlInterface, boolean generateIntegrationReport, org.odpi.openmetadata.frameworks.openmetadata.enums.PermittedSynchronization permittedSynchronization, String externalSourceGUID, String externalSourceName, String integrationConnectorGUID, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog, int maxPageSize)
      Constructor handles standard values for all integration contexts.
      Parameters:
      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
      governanceConfiguration - client for managing catalog targets
      openMetadataStoreClient - client for calling the metadata server
      actionControlInterface - client for initiating governance actions
      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)
      auditLog - logging destination
      maxPageSize - max number of elements that can be returned on a query
  • Method Details

    • getMyUserId

      public String getMyUserId()
      Return the userId for this connector. It is used to determine if changes where made by this connector. It should not be needed to issue calls to open metadata.
      Returns:
      string
    • getFileClassifier

      public org.odpi.openmetadata.frameworks.governanceaction.fileclassifier.FileClassifier getFileClassifier()
      Return the file classifier that uses reference data to describe a file.
      Returns:
      file classifier utility
    • 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
    • addCatalogTarget

      public String addCatalogTarget(String metadataElementGUID, org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTargetProperties properties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Add a catalog target to this integration connector.
      Parameters:
      metadataElementGUID - unique identifier of the metadata element that is a catalog target.
      properties - properties for the relationship.
      Returns:
      catalog target GUID
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem storing the catalog target definition.
    • addCatalogTarget

      public String addCatalogTarget(String integrationConnectorGUID, String metadataElementGUID, org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTargetProperties properties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Add a catalog target to another integration connector.
      Parameters:
      integrationConnectorGUID - unique identifier of the integration service.
      metadataElementGUID - unique identifier of the metadata element that is a catalog target.
      properties - properties for the relationship.
      Returns:
      catalog target GUID
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem storing the catalog target definition.
    • updateCatalogTarget

      public void updateCatalogTarget(String relationshipGUID, org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTargetProperties properties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Update a catalog target relationship for an integration connector.
      Parameters:
      relationshipGUID - unique identifier of the relationship.
      properties - properties for the relationship.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem storing the catalog target definition.
    • getCatalogTarget

      public org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTarget getCatalogTarget(String relationshipGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve a specific catalog target associated with an integration connector.
      Parameters:
      relationshipGUID - unique identifier of the relationship.
      Returns:
      details of the integration connector and the elements it is to catalog
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem retrieving the integration connector definition.
    • getCatalogTargets

      public List<org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTarget> getCatalogTargets(String integrationConnectorGUID, int startingFrom, int maximumResults) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve the identifiers of the metadata elements identified as catalog targets with another integration connector.
      Parameters:
      integrationConnectorGUID - unique identifier of the integration connector.
      startingFrom - initial position in the stored list.
      maximumResults - maximum number of definitions to return on this call.
      Returns:
      list of named elements
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid,
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem retrieving the integration connector definition.
    • getCatalogTargets

      public List<org.odpi.openmetadata.frameworks.governanceaction.properties.CatalogTarget> getCatalogTargets(int startingFrom, int maximumResults) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.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.
      Parameters:
      startingFrom - initial position in the stored list.
      maximumResults - maximum number of definitions to return on this call.
      Returns:
      list of named element headers
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid,
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem retrieving the integration connector definition.
    • removeCatalogTarget

      public void removeCatalogTarget(String relationshipGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Unregister a catalog target from the integration connector.
      Parameters:
      relationshipGUID - unique identifier of the integration connector.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing/updating 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 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
    • setMetadataSourceQualifiedName

      public void setMetadataSourceQualifiedName(String metadataSourceQualifiedName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Change the metadata collection that is in use when working with open metadata. It should be the qualified name of a software capability, The 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
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the unique name is null or not known.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the caller's userId is not able to access the element
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem accessing the metadata store
    • setMetadataSourceQualifiedName

      public void setMetadataSourceQualifiedName(String metadataSourceGUID, String metadataSourceQualifiedName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Change the metadata collection that is in use when working with open metadata. It should be the qualified name of a software capability, The 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:
      metadataSourceGUID - unique identifier of the metadata source (if known)
      metadataSourceQualifiedName - supplied qualified name for the metadata collection
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the unique name is null or not known.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the caller's userId is not able to access the element
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem accessing the metadata store
    • getExternalSourceIsHome

      public boolean getExternalSourceIsHome()
      Return the flag indicating whether the external source name is to be used as the new element's metadata collection, or they belong to the local cohort.
      Returns:
      flag
    • setExternalSourceIsHome

      public void setExternalSourceIsHome(boolean newValue)
      Set the flag indicating whether the external source name is to be used as the new element's metadata collection, or they belong to the local cohort.
      Parameters:
      newValue - flag
    • getPermittedSynchronization

      public org.odpi.openmetadata.frameworks.openmetadata.enums.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
    • getIntegrationGovernanceContext

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

      public ConnectedAssetContext getConnectedAssetContext()
      Return the connected asset context that support an integration connector working with assets and their connectors.
      Returns:
      connected asset context
    • 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
      Parameters:
      flag - required behaviour
    • 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.
      Returns:
      boolean flag
    • getAnchorGUID

      public String getAnchorGUID(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader elementHeader)
      Retrieve the anchorGUID from the Anchors classification.
      Parameters:
      elementHeader - element header where the classifications reside
      Returns:
      anchorGUID or null
    • getAnchorGUID

      public String getAnchorGUID(org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataElement openMetadataElement)
      Retrieve the anchorGUID from the Anchors classification.
      Parameters:
      openMetadataElement - element header where the classifications reside
      Returns:
      anchorGUID or null
    • registerFileListener

      public void registerFileListener(FileListenerInterface listener, File fileToMonitor) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Register a listener object that will be called each time a specific file is created, changed or deleted.
      Parameters:
      listener - listener object
      fileToMonitor - name of the file to monitor
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
    • unregisterFileListener

      public void unregisterFileListener(FileListenerInterface listener, File fileToMonitor) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Unregister a listener object that will be called each time a specific file is created, changed or deleted.
      Parameters:
      listener - listener object
      fileToMonitor - name of the file to unregister
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
    • registerDirectoryListener

      public void registerDirectoryListener(FileDirectoryListenerInterface listener, File directoryToMonitor, FileFilter fileFilter) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Register a listener object that will be called each time a file is created, changed or deleted in a specific root directory. The file filter lets you request that only certain types of files are returned.
      Parameters:
      listener - listener object
      directoryToMonitor - details of the file directory to monitor
      fileFilter - a file filter implementation that restricts the files/directories that will be returned to the listener
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
    • unregisterDirectoryListener

      public void unregisterDirectoryListener(FileDirectoryListenerInterface listener, File directoryToMonitor) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Unregister a listener object for the directory.
      Parameters:
      listener - listener object
      directoryToMonitor - details of the file directory unregister
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
    • registerDirectoryTreeListener

      public void registerDirectoryTreeListener(FileDirectoryListenerInterface listener, File directoryToMonitor, FileFilter fileFilter) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Register a listener object that will be called each time a file is created, changed or deleted in a specific root directory and any of its subdirectories. The file filter lets you request that only certain types of files and/or directories are returned.
      Parameters:
      listener - listener object
      directoryToMonitor - details of the root file directory to monitor from
      fileFilter - a file filter implementation that restricts the files/directories that will be returned to the listener
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
    • unregisterDirectoryTreeListener

      public void unregisterDirectoryTreeListener(FileDirectoryListenerInterface listener, File directoryToMonitor) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Unregister a listener object for the directory.
      Parameters:
      listener - listener object
      directoryToMonitor - details of the root file directory to unregister
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
    • 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.
      Returns:
      integer
    • isTypeOf

      public boolean isTypeOf(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader elementHeader, String typeName)
      Understand the type of element. It checks the type and super types.
      Parameters:
      elementHeader - element to validate
      typeName - type to test
      Returns:
      boolean flag
    • isTypeOf

      public boolean isTypeOf(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementType elementType, String typeName)
      Understand the type of element. It checks the type and super types.
      Parameters:
      elementType - element to validate
      typeName - type to test
      Returns:
      boolean flag
    • disconnect

      public void disconnect() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Disconnect the file listener.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException - exception disconnecting