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 Summary
FieldsModifier and TypeFieldDescriptionprotected AssetHandlerprotected AuditLogprotected ConnectedAssetClientprotected GovernanceConfigurationprotected Stringprotected Stringprotected Stringprotected Stringprotected intprotected OpenGovernanceClientprotected OpenMetadataClientprotected Stringprotected Stringprotected Stringprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidSuggestion for subclass to create client(s) to partner OMAS.abstract OpenMetadataEventClientcreateEventClient(String connectorId) Suggestion for subclass to create client(s) to partner OMAS.voidinitializeContextManager(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.voidpublishBitolDocument(String rawDocument) Publish a Bitol document of either kind.voidpublishDataContract(String rawDocument) Publish an Open Data Contract Standard (ODCS) data contract.voidpublishDataContract(DataContract dataContract) Publish an Open Data Contract Standard (ODCS) data contract.voidpublishDataProduct(String rawDocument) Publish an Open Data Product Standard (ODPS) data product.voidpublishDataProduct(DataProduct dataProduct) Publish an Open Data Product Standard (ODPS) data product.voidCalled each time an open lineage dataset event is published to the integration demon.voidCalled each time an open lineage job event is published to the integration demon.voidpublishOpenLineageRunEvent(String rawEvent) Called each time an open lineage event is published to the integration daemon as a JSON string.voidCalled each time an open lineage run event is published to the integration demon.voidregisterListener(BitolDocumentListener listener) The listener is implemented by the integration connector.voidregisterListener(OpenLineageEventListener listener) The listener is implemented by the integration connector.setContext(String connectorId, String connectorName, String connectorUserId, IntegrationConnector integrationConnector, String integrationConnectorGUID, PermittedSynchronization permittedSynchronization, boolean generateIntegrationReport, String metadataSourceQualifiedName, DeleteMethod deleteMethod) Set up the context in the supplied connector.protected StringsetUpMetadataSource(String metadataSourceQualifiedName, String connectorId, String connectorName, String connectorUserId) Retrieve the metadata source's unique identifier (GUID) or if it is not defined, create the software server capability for this service.
-
Field Details
-
partnerOMASPlatformRootURL
-
partnerOMASServerName
-
governanceConfiguration
-
connectedAssetClient
-
openMetadataClient
-
assetHandler
-
openGovernanceClient
-
localServerName
-
localServerURL
-
localServiceName
-
localServerUserId
-
secretsStoreProvider
-
secretsStoreLocation
-
secretsStoreCollection
-
maxPageSize
protected int maxPageSize -
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 daemonlocalServerURL- 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 servicepartnerOMASServerName- name of the server to connect topartnerOMASPlatformRootURL- the network address of the server running the OMAS REST servicesuserId- caller's userId embedded in all HTTP requestssecretsStoreProvider- secrets store connector for bearer tokensecretsStoreLocation- secrets store location for bearer tokensecretsStoreCollection- secrets store collection for bearer tokenmaxPageSize- maximum number of results that can be returned on a single REST callauditLog- logging destination
-
createClients
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 serviceconnectorId- unique identifier of the connector (used to configure the event listener)connectorName- name of connector from configconnectorUserId- userId for the connector- Returns:
- unique identifier of the metadata source
- Throws:
InvalidParameterException- one of the parameters passed (probably on initialize) is invalidUserNotAuthorizedException- the integration daemon's userId does not have access to the partner OMASPropertyServerException- 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 configconnectorUserId- userId for the connectorintegrationConnector- connector created from connection integration service configurationintegrationConnectorGUID- unique identifier of the integration connector entity (only set if working with integration groups)permittedSynchronization- controls the direction(s) that metadata is allowed to flowgenerateIntegrationReport- 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 typeUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- problem accessing the property server
-
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.- Specified by:
registerListenerin interfaceOpenLineageListenerManager- Parameters:
listener- listener to call
-
publishOpenLineageRunEvent
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:
publishOpenLineageRunEventin interfaceOpenLineageListenerManager- Parameters:
rawEvent- json payload received for the event
-
publishOpenLineageRunEvent
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:
publishOpenLineageRunEventin interfaceOpenLineageListenerManager- Parameters:
event- bean for the event
-
publishOpenLineageJobEvent
Called each time an open lineage job event is published to the integration demon.- Specified by:
publishOpenLineageJobEventin interfaceOpenLineageListenerManager- Parameters:
event- bean for the event
-
publishOpenLineageDataSetEvent
Called each time an open lineage dataset event is published to the integration demon.- Specified by:
publishOpenLineageDataSetEventin interfaceOpenLineageListenerManager- Parameters:
event- bean for the event
-
registerListener
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:
registerListenerin interfaceBitolDocumentManager- Parameters:
listener- listener to call
-
publishBitolDocument
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:
publishBitolDocumentin interfaceBitolDocumentManager- Parameters:
rawDocument- document in YAML or JSON format
-
publishDataContract
Publish an Open Data Contract Standard (ODCS) data contract.- Specified by:
publishDataContractin interfaceBitolDocumentManager- Parameters:
rawDocument- document in YAML or JSON format
-
publishDataContract
Publish an Open Data Contract Standard (ODCS) data contract.- Specified by:
publishDataContractin interfaceBitolDocumentManager- Parameters:
dataContract- bean for the document
-
publishDataProduct
Publish an Open Data Product Standard (ODPS) data product.- Specified by:
publishDataProductin interfaceBitolDocumentManager- Parameters:
rawDocument- document in YAML or JSON format
-
publishDataProduct
Publish an Open Data Product Standard (ODPS) data product.- Specified by:
publishDataProductin interfaceBitolDocumentManager- Parameters:
dataProduct- bean for the document
-