Class IntegrationContext
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
org.odpi.openmetadata.frameworks.integration.context.IntegrationContext
- Direct Known Subclasses:
CatalogTargetContext
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final ConnectedAssetClient
protected final GovernanceConfiguration
protected final OpenGovernanceClient
protected final OpenIntegrationClient
protected final OpenMetadataEventClient
protected final PermittedSynchronization
protected final StewardshipAction
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
auditLog, connectorActivityReportWriter, connectorGUID, connectorId, connectorName, connectorUserId, defaultDeleteMethod, externalSourceGUID, externalSourceName, fileClassifier, generateIntegrationReport, governanceDefinitionClient, localServerName, localServiceName, maxPageSize, openMetadataClient, openMetadataStore, propertyHelper
-
Constructor Summary
ConstructorsConstructorDescriptionIntegrationContext
(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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
elementShouldBeCatalogued
(String elementName, List<String> excludedNames, List<String> includedNames) Determine whether a particular element should be catalogued.getCatalogTargetContext
(CatalogTarget requestedCatalogTarget) Return a new context for a configured catalog target.Return the connected asset context that support an integration connector working with assets and their connectors.Return the client for managing the metadata associated with running connectors, governance engines and governance services.Return the unique identifier of the element that represents this integration connector in open metadata.Return the guid of the software capability that represents an external source of metadata.getMetadataSourceGUID
(String metadataSourceQualifiedName) 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.Return the qualified name of the software capability that represents an external source of metadata.Return the open governance client.Return the permitted synchronization direction.Return the connected asset context that support an integration connector working with assets and their connectors.boolean
Return a flag indicating whether a listener has been registered or not.boolean
Return whether there is a refresh in progress.void
publishOpenLineageRunEvent
(String rawEvent) Called each time an integration connector wishes to publish an open lineage run event.void
Called each time an open lineage run event is published to the integration daemon.void
registerListener
(OpenLineageEventListener listener) The listener is implemented by the integration connector.void
registerListener
(OpenMetadataEventListener listener) Register a listener object that will be passed each of the events published by the Open Metadata Server.void
setRefreshInProgress
(boolean refreshInProgress) Set up whether the refresh is in progress or not.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextBase
createIncidentReport, disconnect, getActorProfileClient, getActorRoleClient, getAnchorGUID, getAnchorGUID, getAssetClient, getAssetClient, getConnectionClient, getConnectorId, getConnectorName, getConnectorTypeClient, getEndpointClient, getFileClassifier, getGlossaryClient, getGlossaryTermClient, getGovernanceDefinitionClient, getGovernanceDefinitionClient, getLocalServerName, getLocalServiceName, getMaxPageSize, getMultiLanguageClient, getMyUserId, getOpenMetadataStore, getSchemaAttributeClient, getSchemaAttributeClient, getSchemaTypeClient, getSchemaTypeClient, getSoftwareCapabilityClient, getSoftwareCapabilityClient, getValidMetadataValuesClient, getValidValueDefinitionClient, isTypeOf, isTypeOf, openToDo, openToDo, publishReport, registerContextEvent, registerDirectoryListener, registerDirectoryTreeListener, registerFileListener, reportElementCreation, reportElementDelete, reportElementUpdate, setActiveReportPublishing, startRecording, unregisterDirectoryListener, unregisterDirectoryTreeListener, unregisterFileListener, validateIsActive
-
Field Details
-
openMetadataEventClient
-
openIntegrationClient
-
openGovernanceClient
-
connectedAssetClient
-
governanceConfiguration
-
stewardshipAction
-
permittedSynchronization
-
-
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 serverlocalServiceName
- name of the service to callexternalSourceGUID
- metadata collection unique idexternalSourceName
- metadata collection unique nameconnectorId
- unique identifier of the connector (used to configure the event listener)connectorName
- name of connector from configconnectorUserId
- userId for the connectorconnectorGUID
- unique identifier of the integration connector entity (maybe null)generateIntegrationReport
- should the connector generate an integration reports?permittedSynchronization
- enumopenMetadataClient
- client to access open metadata storeopenMetadataEventClient
- client to access open metadata eventsconnectedAssetClient
- client for working with connectorsopenIntegrationClient
- client for calling the metadata servergovernanceConfiguration
- client for managing catalog targetsopenGovernanceClient
- client for initiating governance actionsauditLog
- logging destinationmaxPageSize
- max number of elements that can be returned on a querydeleteMethod
- default delete method
-
-
Method Details
-
getCatalogTargetContext
public CatalogTargetContext getCatalogTargetContext(CatalogTarget requestedCatalogTarget) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException 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
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
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
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
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 elementexcludedNames
- 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
public void registerListener(OpenMetadataEventListener listener) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException 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
Return the connected asset context that support an integration connector working with assets and their connectors.- Returns:
- connected asset context
-
getStewardshipAction
Return the connected asset context that support an integration connector working with assets and their connectors.- Returns:
- connected asset context
-
getOpenGovernanceClient
Return the open governance client. This supports defining and initiating governance actions, and managing duplicates.- Returns:
- client
-
getConnectorConfigClient
Return the client for managing the metadata associated with running connectors, governance engines and governance services.- Returns:
- connector context client
-
getIntegrationConnectorGUID
Return the unique identifier of the element that represents this integration connector in open metadata.- Returns:
- string guid
-
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
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 elementPropertyServerException
- 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
-