/
KafkaMonitorIntegrationProvider.java
107 lines (84 loc) · 4.71 KB
/
KafkaMonitorIntegrationProvider.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.adapters.connectors.integration.kafka;
import org.odpi.openmetadata.frameworks.auditlog.AuditLogReportingComponent;
import org.odpi.openmetadata.frameworks.auditlog.ComponentDevelopmentStatus;
import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType;
import org.odpi.openmetadata.frameworks.openmetadata.refdata.DeployedImplementationType;
import org.odpi.openmetadata.frameworks.integration.controls.CatalogTargetType;
import org.odpi.openmetadata.frameworks.integration.connectors.IntegrationConnectorProvider;
import java.util.ArrayList;
import java.util.List;
/**
* KafkaMonitorIntegrationProvider is the connector provider for the kafka integration connector that extracts topic names from the broker.
*/
public class KafkaMonitorIntegrationProvider extends IntegrationConnectorProvider
{
/*
* Unique identifier of the connector for the audit log.
*/
private static final int connectorComponentId = 652;
/*
* Unique identifier for the connector type.
*/
private static final String connectorTypeGUID = "431ba4e6-5479-4de5-bf9a-7f822bda7fc6";
/*
* Descriptive information about the connector for the connector type and audit log.
*/
private static final String connectorQualifiedName = "Egeria:IntegrationConnector:Topics:KafkaMonitor";
private static final String connectorDisplayName = "Kafka Monitor Integration Connector";
private static final String connectorDescription = "Connector maintains a list of KafkaTopic assets associated with an Apache Kafka event broker.";
private static final String connectorWikiPage = "https://egeria-project.org/connectors/integration/kafka-monitor-integration-connector/";
/*
* Class of the connector.
*/
private static final String connectorClassName = "org.odpi.openmetadata.adapters.connectors.integration.kafka.KafkaMonitorIntegrationConnector";
static final String TEMPLATE_QUALIFIED_NAME_CONFIGURATION_PROPERTY = "templateQualifiedName";
/**
* The name of the catalog target that contains the server to monitor.
*/
static public final String CATALOG_TARGET_NAME = "kafkaServerToMonitor";
/**
* Constructor used to initialize the ConnectorProvider with the Java class name of the specific
* store implementation.
*/
public KafkaMonitorIntegrationProvider()
{
super();
/*
* Set up the class name of the connector that this provider creates.
*/
super.setConnectorClassName(connectorClassName);
/*
* Set up the connector type that should be included in a connection used to configure this connector.
*/
ConnectorType connectorType = new ConnectorType();
connectorType.setType(ConnectorType.getConnectorTypeType());
connectorType.setGUID(connectorTypeGUID);
connectorType.setQualifiedName(connectorQualifiedName);
connectorType.setDisplayName(connectorDisplayName);
connectorType.setDescription(connectorDescription);
connectorType.setConnectorProviderClassName(this.getClass().getName());
List<String> recognizedConfigurationProperties = new ArrayList<>();
recognizedConfigurationProperties.add(TEMPLATE_QUALIFIED_NAME_CONFIGURATION_PROPERTY);
connectorType.setRecognizedConfigurationProperties(recognizedConfigurationProperties);
connectorType.setSupportedAssetTypeName(supportedAssetTypeName);
super.connectorTypeBean = connectorType;
/*
* Set up the component description used in the connector's audit log messages.
*/
AuditLogReportingComponent componentDescription = new AuditLogReportingComponent();
componentDescription.setComponentId(connectorComponentId);
componentDescription.setComponentDevelopmentStatus(ComponentDevelopmentStatus.STABLE);
componentDescription.setComponentName(connectorDisplayName);
componentDescription.setComponentDescription(connectorDescription);
componentDescription.setComponentWikiURL(connectorWikiPage);
super.setConnectorComponentDescription(componentDescription);
super.catalogTargets = new ArrayList<>();
CatalogTargetType catalogTargetType = new CatalogTargetType();
catalogTargetType.setName(CATALOG_TARGET_NAME);
catalogTargetType.setTypeName(DeployedImplementationType.APACHE_KAFKA_SERVER.getAssociatedTypeName());
catalogTargetType.setDeployedImplementationType(DeployedImplementationType.APACHE_KAFKA_SERVER.getDeployedImplementationType());
super.catalogTargets.add(catalogTargetType);
}
}