From d669a357d66165a46a6d4b88abe86ce8f34b4307 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Sun, 13 Nov 2022 14:54:39 +0000 Subject: [PATCH 1/4] Populate referenceColumnGUID/qName from correct end of relationship (#7052) Signed-off-by: Mandy Chessell --- .../converters/DatabaseColumnConverter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseColumnConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseColumnConverter.java index 646ccc466ea..e4a0fd95f01 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseColumnConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseColumnConverter.java @@ -126,6 +126,9 @@ public B getNewSchemaAttributeBean(Class beanClass, { if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataAPIMapper.FOREIGN_KEY_RELATIONSHIP_TYPE_NAME)) { + /* + * Foreign key properties are only set up in the column that contains the foreign key which is at end 2 of the relationship. + */ if (schemaAttributeEntity.getGUID().equals(relationship.getEntityTwoProxy().getGUID())) { DatabaseForeignKeyProperties databaseForeignKeyProperties = new DatabaseForeignKeyProperties(); @@ -144,8 +147,12 @@ public B getNewSchemaAttributeBean(Class beanClass, databaseForeignKeyProperties.setExtendedProperties(this.getRemainingExtendedProperties(relationshipProperties)); bean.setForeignKeyProperties(databaseForeignKeyProperties); - bean.setReferencedColumnGUID(relationship.getEntityTwoProxy().getGUID()); - bean.setReferencedColumnQualifiedName(this.getQualifiedName(relationship.getEntityTwoProxy().getUniqueProperties())); + + /* + * These values reference the column that is the primary key. + */ + bean.setReferencedColumnGUID(relationship.getEntityOneProxy().getGUID()); + bean.setReferencedColumnQualifiedName(this.getQualifiedName(relationship.getEntityOneProxy().getUniqueProperties())); } } } From d43b9e035946e6be50add96189d8c423b2427382 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Sun, 13 Nov 2022 23:51:03 +0000 Subject: [PATCH 2/4] Improve consistency of treatment of qualifiedName Signed-off-by: Mandy Chessell --- .../client/FilesAndFoldersClient.java | 4 +-- .../datamanager/server/FilesRESTServices.java | 3 ++ .../DataFilesMonitorIntegrationConnector.java | 2 +- .../FilesAndFoldersHandler.java | 29 ++++++++++++++----- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java index c190bf7670b..6400335585a 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java @@ -382,7 +382,7 @@ public List addDataFileToCatalogFromTemplate(String userId, { final String methodName = "addDataFileToCatalogFromTemplate"; final String propertiesParameterName = "templateProperties"; - final String qualifiedNameParameterName = "templateProperties.qualifiedName"; + final String pathNameParameterName = "pathName"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); @@ -390,7 +390,7 @@ public List addDataFileToCatalogFromTemplate(String userId, String pathName = this.getPathName(templateProperties.getPathName(), templateProperties.getQualifiedName()); - invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + invalidParameterHandler.validateName(pathName, pathNameParameterName, methodName); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files/from-template/{2}"; diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java index c6420d7e2a0..11731943a40 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java @@ -374,6 +374,7 @@ public GUIDListResponse addDataFileToCatalogFromTemplate(String ser requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), templateGUID, + requestBody.getQualifiedName(), pathName, requestBody.getDisplayName(), requestBody.getVersionIdentifier(), @@ -642,6 +643,7 @@ public GUIDListResponse addDataFolderAssetToCatalog(String server requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), requestBody.getQualifiedName(), + requestBody.getPathName(), requestBody.getName(), requestBody.getVersionIdentifier(), requestBody.getDescription(), @@ -723,6 +725,7 @@ public GUIDListResponse addDataFolderToCatalogFromTemplate(String s requestBody.getExternalSourceName(), templateGUID, requestBody.getQualifiedName(), + requestBody.getPathName(), requestBody.getDisplayName(), requestBody.getVersionIdentifier(), requestBody.getDescription(), diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java index 15afc7696f3..30453805a3b 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java @@ -47,7 +47,7 @@ FileAlterationListenerAdaptor getListener() */ class FileCataloguingListener extends FileAlterationListenerAdaptor { - private DataFilesMonitorIntegrationConnector connector; + private final DataFilesMonitorIntegrationConnector connector; FileCataloguingListener(DataFilesMonitorIntegrationConnector connector) { diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java index f28c86dba7a..47b3d166757 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java @@ -426,7 +426,7 @@ private String createFolder(String userId, externalSourceGUID, externalSourceName, folderAssetGUIDParameterName, - this.createQualifiedName(folderAssetTypeName, pathName, versionIdentifier), + this.createQualifiedName(folderAssetTypeName, null, pathName, versionIdentifier), name, versionIdentifier, description, @@ -520,7 +520,7 @@ private String createFileAsset(String userId, externalSourceGUID, externalSourceName, fileAssetGUIDParameterName, - this.createQualifiedName(fileAssetTypeName, pathName, versionIdentifier), + this.createQualifiedName(fileAssetTypeName, null, pathName, versionIdentifier), displayName, versionIdentifier, description, @@ -547,14 +547,21 @@ private String createFileAsset(String userId, * Construct the qualified name for a file resource. * * @param typeName type of element + * @param qualifiedName supplied qualified name * @param pathName pathname in file system * @param versionIdentifier version identifier * @return qualified name */ private String createQualifiedName(String typeName, + String qualifiedName, String pathName, String versionIdentifier) { + if (qualifiedName != null) + { + return qualifiedName; + } + if (versionIdentifier == null) { return typeName + ":" + pathName; @@ -1647,6 +1654,7 @@ private Map getExtendedProperties(String pathName, * @param userId calling user * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source + * @param qualifiedName optional qualified name * @param pathName pathname of the file * @param name name for the folder in the catalog * @param versionIdentifier version identifier for the folder in the catalog @@ -1677,6 +1685,7 @@ private Map getExtendedProperties(String pathName, public List addDataFolderAssetToCatalog(String userId, String externalSourceGUID, String externalSourceName, + String qualifiedName, String pathName, String name, String versionIdentifier, @@ -1728,7 +1737,7 @@ public List addDataFolderAssetToCatalog(String userId, externalSourceGUID, externalSourceName, folderAssetParameterName, - pathName, + createQualifiedName(folderAssetTypeName, qualifiedName, pathName, versionIdentifier), name, versionIdentifier, description, @@ -1957,7 +1966,7 @@ else if (defaultAvroFileType.equals(fileType)) externalSourceGUID, externalSourceName, fileAssetParameterName, - fullPath, + createQualifiedName(fileAssetTypeName, qualifiedName, pathName, versionIdentifier), name, versionIdentifier, description, @@ -2004,6 +2013,7 @@ else if (defaultAvroFileType.equals(fileType)) * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param templateGUID unique identifier of the asset description to copy + * @param qualifiedName optional unique name * @param fullPath unique path and file name for file * @param name short display name for file (defaults to the file name without the path) * @param versionIdentifier version identifier of the file @@ -2022,6 +2032,7 @@ public List addFileToCatalogFromTemplate(String userId, String externalSourceGUID, String externalSourceName, String templateGUID, + String qualifiedName, String fullPath, String name, String versionIdentifier, @@ -2048,7 +2059,7 @@ public List addFileToCatalogFromTemplate(String userId, templateGUIDParameterName, OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, - createQualifiedName(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, fullPath, versionIdentifier), + createQualifiedName(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, qualifiedName, fullPath, versionIdentifier), pathNameParameterName, name, versionIdentifier, @@ -2086,6 +2097,7 @@ public List addFileToCatalogFromTemplate(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param templateGUID unique identifier of the asset description to copy + * @param qualifiedName optional qualified name * @param pathName unique path and file name for file * @param name short name for file (defaults to the file name without the path) * @param versionIdentifier version identifier for the file @@ -2104,6 +2116,7 @@ public List addFolderToCatalogFromTemplate(String userId, String externalSourceGUID, String externalSourceName, String templateGUID, + String qualifiedName, String pathName, String name, String versionIdentifier, @@ -2130,7 +2143,7 @@ public List addFolderToCatalogFromTemplate(String userId, templateGUIDParameterName, OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, - this.createQualifiedName(OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, pathName, versionIdentifier), + this.createQualifiedName(OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, qualifiedName, pathName, versionIdentifier), pathNameParameterName, name, versionIdentifier, @@ -2525,7 +2538,7 @@ public void updateFileInCatalog(String userId, } if (! isMergeUpdate) { - qualifiedName = this.createQualifiedName(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, fullPath, versionIdentifier); + qualifiedName = this.createQualifiedName(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, null, fullPath, versionIdentifier); } Map assetExtendedProperties = this.getExtendedProperties(fullPath, @@ -2638,7 +2651,7 @@ public void updateFolderInCatalog(String userId, if (! isMergeUpdate) { - qualifiedName = this.createQualifiedName(OpenMetadataAPIMapper.DATA_FOLDER_TYPE_NAME, fullPath, versionIdentifier); + qualifiedName = this.createQualifiedName(OpenMetadataAPIMapper.DATA_FOLDER_TYPE_NAME, qualifiedName, fullPath, versionIdentifier); } Map assetExtendedProperties = this.getExtendedProperties(fullPath, From 9de2cc62f046e37ab1ac2d41571b6fc02c5f8066 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Sun, 13 Nov 2022 23:55:01 +0000 Subject: [PATCH 3/4] Add connector type query (#7103) Signed-off-by: Mandy Chessell --- .../CommonServicesDescription.java | 14 ++- .../OMAGConformanceSuiteConfigServices.java | 10 +- ...overnanceServerServiceInstanceHandler.java | 6 +- .../OMAGServerPlatformInstanceMap.java | 6 +- .../spring/IntegrationDaemonResource.java | 2 +- .../client/PlatformServicesClient.java | 42 ++++++- .../client/PlatformServicesRESTClient.java | 27 +++++ .../platform-services-server/build.gradle | 1 + .../platform-services-server/pom.xml | 10 ++ .../OMAGServerPlatformActiveServices.java | 113 +++++++++++++----- .../OMAGServerPlatformActiveResource.java | 36 +++++- 11 files changed, 220 insertions(+), 47 deletions(-) diff --git a/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/configuration/registration/CommonServicesDescription.java b/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/configuration/registration/CommonServicesDescription.java index 48d24d1ee6a..e31a589a2b5 100644 --- a/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/configuration/registration/CommonServicesDescription.java +++ b/open-metadata-implementation/admin-services/admin-services-api/src/main/java/org/odpi/openmetadata/adminservices/configuration/registration/CommonServicesDescription.java @@ -37,7 +37,7 @@ public enum CommonServicesDescription implements Serializable OPEN_METADATA_SECURITY (183, ComponentDevelopmentStatus.STABLE, "Open Metadata Security Services", - null, + null, // no REST API "Authorization services for Open Metadata and Governance", "https://egeria-project.org/services/metadata-security-services"), @@ -46,7 +46,15 @@ public enum CommonServicesDescription implements Serializable "Open Metadata Store Services", "open-metadata-store", "Provides generic open metadata retrieval and management services for Open Metadata Access Services (OMASs).", - "https://egeria-project.org/services/gaf-metadata-management"),; + "https://egeria-project.org/services/gaf-metadata-management"), + + PLATFORM_SERVICES (185, + ComponentDevelopmentStatus.STABLE, + "Platform Services", + "platform-services", + "Provides information about the registered services and connectors available in an OMAG Server Platform.", + "https://egeria-project.org/services/platform-services/overview"), + ; private static final long serialVersionUID = 1L; @@ -71,7 +79,9 @@ public static List getGovernanceServersDescriptionLis serviceDescriptionList.add(CommonServicesDescription.REPOSITORY_SERVICES); serviceDescriptionList.add(CommonServicesDescription.ADMIN_OPERATIONAL_SERVICES); serviceDescriptionList.add(CommonServicesDescription.OCF_METADATA_MANAGEMENT); + serviceDescriptionList.add(CommonServicesDescription.GAF_METADATA_MANAGEMENT); serviceDescriptionList.add(CommonServicesDescription.OPEN_METADATA_SECURITY); + serviceDescriptionList.add(CommonServicesDescription.PLATFORM_SERVICES); return serviceDescriptionList; } diff --git a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java index 5e6c1c99600..a6449a8a2a6 100644 --- a/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java +++ b/open-metadata-implementation/admin-services/admin-services-server/src/main/java/org/odpi/openmetadata/adminservices/OMAGConformanceSuiteConfigServices.java @@ -27,12 +27,12 @@ public class OMAGConformanceSuiteConfigServices { static private final int maxPageSize = 50; - private static RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(OMAGConformanceSuiteConfigServices.class), - CommonServicesDescription.ADMIN_OPERATIONAL_SERVICES.getServiceName()); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(OMAGConformanceSuiteConfigServices.class), + CommonServicesDescription.ADMIN_OPERATIONAL_SERVICES.getServiceName()); - private OMAGServerAdminStoreServices configStore = new OMAGServerAdminStoreServices(); - private OMAGServerErrorHandler errorHandler = new OMAGServerErrorHandler(); - private OMAGServerExceptionHandler exceptionHandler = new OMAGServerExceptionHandler(); + private final OMAGServerAdminStoreServices configStore = new OMAGServerAdminStoreServices(); + private final OMAGServerErrorHandler errorHandler = new OMAGServerErrorHandler(); + private final OMAGServerExceptionHandler exceptionHandler = new OMAGServerExceptionHandler(); /** diff --git a/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/GovernanceServerServiceInstanceHandler.java b/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/GovernanceServerServiceInstanceHandler.java index 4b2578c82de..716622b0e86 100644 --- a/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/GovernanceServerServiceInstanceHandler.java +++ b/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/GovernanceServerServiceInstanceHandler.java @@ -38,7 +38,7 @@ public GovernanceServerServiceInstanceHandler(String serviceName) /** - * Return the connector type for the requested connector provider after validating that the resulting + * Return a description of the connector for the requested connector provider after validating that the resulting * connector implements the correct interface. This method is for tools that are configuring * connector into an Egeria governance server. Each integration service/engine service has a specific * REST API endpoint for their service. The configuration tool calls it and this method is called. @@ -48,7 +48,7 @@ public GovernanceServerServiceInstanceHandler(String serviceName) * @param connectorProviderClassName name of the connector provider class * @param requiredConnectorInterface connector interface class * @param serviceName service name - * @return ConnectorType bean + * @return Connector report bean * @throws InvalidParameterException one of the parameters is null * @throws ConnectionCheckedException the connection passed to the connector provider is not valid * @throws ConnectorCheckedException the connector is not valid @@ -140,6 +140,8 @@ public ConnectorReport validateConnector(String connectorProviderClassName, connectorReport.setSupportedGuards(governanceActionServiceProvider.supportedGuards()); } + connector.disconnect(); + return connectorReport; } } diff --git a/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/OMAGServerPlatformInstanceMap.java b/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/OMAGServerPlatformInstanceMap.java index 704f47dc47d..73f390f1373 100644 --- a/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/OMAGServerPlatformInstanceMap.java +++ b/open-metadata-implementation/common-services/multi-tenant/src/main/java/org/odpi/openmetadata/commonservices/multitenant/OMAGServerPlatformInstanceMap.java @@ -30,8 +30,8 @@ */ public class OMAGServerPlatformInstanceMap { - private static Map activeServerInstanceMap = new HashMap<>(); - private static Map inActiveServerInstanceMap = new HashMap<>(); + private static final Map activeServerInstanceMap = new HashMap<>(); + private static final Map inActiveServerInstanceMap = new HashMap<>(); /** @@ -40,7 +40,7 @@ public class OMAGServerPlatformInstanceMap * @param userId calling user * @throws UserNotAuthorizedException calling user not allowed to use these services */ - private static void validateUserAsInvestigatorForPlatform(String userId) throws UserNotAuthorizedException + public static void validateUserAsInvestigatorForPlatform(String userId) throws UserNotAuthorizedException { try { diff --git a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-spring/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/spring/IntegrationDaemonResource.java b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-spring/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/spring/IntegrationDaemonResource.java index 64e0d0060d8..1af3ad11526 100644 --- a/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-spring/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/spring/IntegrationDaemonResource.java +++ b/open-metadata-implementation/governance-servers/integration-daemon-services/integration-daemon-services-spring/src/main/java/org/odpi/openmetadata/governanceservers/integrationdaemonservices/server/spring/IntegrationDaemonResource.java @@ -28,7 +28,7 @@ public class IntegrationDaemonResource { - private IntegrationDaemonRESTServices restAPI = new IntegrationDaemonRESTServices(); + private final IntegrationDaemonRESTServices restAPI = new IntegrationDaemonRESTServices(); diff --git a/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesClient.java b/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesClient.java index 355d039c3be..b9e0fbb3ae1 100644 --- a/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesClient.java +++ b/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesClient.java @@ -5,12 +5,14 @@ import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.ConnectorTypeResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.RegisteredOMAGService; import org.odpi.openmetadata.commonservices.ffdc.rest.RegisteredOMAGServicesResponse; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; import org.odpi.openmetadata.platformservices.properties.ServerStatus; import org.odpi.openmetadata.platformservices.rest.ServerListResponse; import org.odpi.openmetadata.platformservices.rest.ServerServicesListResponse; @@ -23,14 +25,14 @@ */ public class PlatformServicesClient { - private PlatformServicesRESTClient restClient; /* Initialized in constructor */ + private final PlatformServicesRESTClient restClient; /* Initialized in constructor */ - private String platformRootURL; /* Initialized in constructor */ - protected AuditLog auditLog; /* Initialized in constructor */ + private final String platformRootURL; /* Initialized in constructor */ + protected AuditLog auditLog; /* Initialized in constructor */ private final String retrieveURLTemplatePrefix = "/open-metadata/platform-services/users/{1}/server-platform"; - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); /** * Create a new client with no authentication embedded in the HTTP request. @@ -138,6 +140,38 @@ public String getPlatformOrigin(String userId) throws InvalidParameterExceptio } + /** + * Return the connector type for the requested connector provider after validating that the + * connector provider is available on the OMAGServerPlatform's class path. This method is for tools that are configuring + * connectors into an Egeria server. It does not validate that the connector will load and initialize. + * + * @param userId calling user + * @param connectorProviderClassName name of the connector provider class + * @return ConnectorType bean or exceptions that occur when trying to create the connector + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + + public ConnectorType getConnectorType(String userId, + String connectorProviderClassName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getConnectorType"; + final String connectorProviderParameterName = "getConnectorType"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(connectorProviderClassName, connectorProviderParameterName, methodName); + + final String urlTemplate = platformRootURL + retrieveURLTemplatePrefix + "/connector-types/{1}" + connectorProviderClassName; + + ConnectorTypeResponse restResult = restClient.callConnectorTypeGetRESTCall(methodName, urlTemplate, userId, connectorProviderClassName); + + return restResult.getConnectorType(); + } + + /** * Retrieve the server status * diff --git a/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesRESTClient.java b/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesRESTClient.java index c10118575d7..d94ad0f5216 100644 --- a/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesRESTClient.java +++ b/open-metadata-implementation/platform-services/platform-services-client/src/main/java/org/odpi/openmetadata/platformservices/client/PlatformServicesRESTClient.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.platformservices.client; +import org.odpi.openmetadata.commonservices.ffdc.rest.ConnectorTypeResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient; import org.odpi.openmetadata.commonservices.ffdc.rest.RegisteredOMAGServicesResponse; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -144,6 +145,32 @@ ServerStatusResponse callServerStatusGetRESTCall(String methodName, return restResult; } + /** + * Issue a GET REST call that returns a ConnectorTypeResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + ConnectorTypeResponse callConnectorTypeGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ConnectorTypeResponse restResult = this.callGetRESTCall(methodName, ConnectorTypeResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a GET REST call that returns a 'ServerServicesListResponse object. diff --git a/open-metadata-implementation/platform-services/platform-services-server/build.gradle b/open-metadata-implementation/platform-services/platform-services-server/build.gradle index c8a2a809146..8203e803a47 100644 --- a/open-metadata-implementation/platform-services/platform-services-server/build.gradle +++ b/open-metadata-implementation/platform-services/platform-services-server/build.gradle @@ -11,6 +11,7 @@ dependencies { implementation project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:frameworks:audit-log-framework') implementation project(':open-metadata-implementation:common-services:ffdc-services') + implementation project(':open-metadata-implementation:admin-services:admin-services-api') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' } diff --git a/open-metadata-implementation/platform-services/platform-services-server/pom.xml b/open-metadata-implementation/platform-services/platform-services-server/pom.xml index acf725add6a..b8d3409e549 100644 --- a/open-metadata-implementation/platform-services/platform-services-server/pom.xml +++ b/open-metadata-implementation/platform-services/platform-services-server/pom.xml @@ -50,6 +50,16 @@ ffdc-services + + org.odpi.egeria + admin-services-api + + + + org.odpi.egeria + open-connector-framework + + diff --git a/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformActiveServices.java b/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformActiveServices.java index 2d8cef6a822..8d863e8d27f 100644 --- a/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformActiveServices.java +++ b/open-metadata-implementation/platform-services/platform-services-server/src/main/java/org/odpi/openmetadata/platformservices/server/OMAGServerPlatformActiveServices.java @@ -3,29 +3,37 @@ package org.odpi.openmetadata.platformservices.server; +import org.odpi.openmetadata.adminservices.configuration.registration.CommonServicesDescription; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; +import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; import org.odpi.openmetadata.commonservices.ffdc.RESTExceptionHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.BooleanResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.ConnectorTypeResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.RegisteredOMAGServicesResponse; import org.odpi.openmetadata.commonservices.multitenant.OMAGServerPlatformInstanceMap; +import org.odpi.openmetadata.frameworks.connectors.ConnectorProvider; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; import org.odpi.openmetadata.platformservices.rest.ServerListResponse; import org.odpi.openmetadata.platformservices.rest.ServerServicesListResponse; import org.odpi.openmetadata.platformservices.rest.ServerStatusResponse; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; + /** * OMAGServerPlatformActiveServices allow an external caller to determine which servers are active on the * platform and the services that are active within them. */ public class OMAGServerPlatformActiveServices { - private static final Logger log = LoggerFactory.getLogger(OMAGServerPlatformActiveServices.class); + private static final RESTCallLogger restCallLogger = new RESTCallLogger(LoggerFactory.getLogger(OMAGServerPlatformActiveServices.class), + CommonServicesDescription.PLATFORM_SERVICES.getServiceName()); - private OMAGServerPlatformInstanceMap serverInstanceMap = new OMAGServerPlatformInstanceMap(); + private final OMAGServerPlatformInstanceMap serverInstanceMap = new OMAGServerPlatformInstanceMap(); - private RESTExceptionHandler exceptionHandler = new RESTExceptionHandler(); + private final RESTExceptionHandler exceptionHandler = new RESTExceptionHandler(); + private final String serverName = ""; /** * Return the list of access services that are registered (supported) in this OMAG Server Platform @@ -38,7 +46,7 @@ public RegisteredOMAGServicesResponse getRegisteredAccessServices(String userId) { final String methodName = "getRegisteredAccessServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -51,7 +59,7 @@ public RegisteredOMAGServicesResponse getRegisteredAccessServices(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -68,7 +76,7 @@ public RegisteredOMAGServicesResponse getRegisteredEngineServices(String userId) { final String methodName = "getRegisteredEngineServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -81,7 +89,7 @@ public RegisteredOMAGServicesResponse getRegisteredEngineServices(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -98,7 +106,7 @@ public RegisteredOMAGServicesResponse getRegisteredIntegrationServices(String us { final String methodName = "getRegisteredIntegrationServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -111,7 +119,7 @@ public RegisteredOMAGServicesResponse getRegisteredIntegrationServices(String us exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -128,7 +136,7 @@ public RegisteredOMAGServicesResponse getRegisteredViewServices(String userId) { final String methodName = "getRegisteredViewServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -141,7 +149,7 @@ public RegisteredOMAGServicesResponse getRegisteredViewServices(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -158,7 +166,7 @@ public RegisteredOMAGServicesResponse getRegisteredGovernanceServices(String use { final String methodName = "getRegisteredGovernanceServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -171,7 +179,7 @@ public RegisteredOMAGServicesResponse getRegisteredGovernanceServices(String use exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -188,7 +196,7 @@ public RegisteredOMAGServicesResponse getRegisteredCommonServices(String userId) { final String methodName = "getRegisteredCommonServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -201,7 +209,7 @@ public RegisteredOMAGServicesResponse getRegisteredCommonServices(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -217,7 +225,7 @@ public RegisteredOMAGServicesResponse getAllRegisteredServices(String userId) { final String methodName = "getAllRegisteredServices"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); RegisteredOMAGServicesResponse response = new RegisteredOMAGServicesResponse(); @@ -230,7 +238,56 @@ public RegisteredOMAGServicesResponse getAllRegisteredServices(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Return the connector type for the requested connector provider after validating that the + * connector provider is available on the OMAGServerPlatform's class path. This method is for tools that are configuring + * connectors into an Egeria server. It does not validate that the connector will load and initialize. + * + * @param userId calling user + * @param connectorProviderClassName name of the connector provider class + * @return ConnectorType bean or exceptions that occur when trying to create the connector + */ + public ConnectorTypeResponse getConnectorType(String userId, + String connectorProviderClassName) + { + final String methodName = "validateConnector"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ConnectorTypeResponse response = new ConnectorTypeResponse(); + + try + { + OMAGServerPlatformInstanceMap.validateUserAsInvestigatorForPlatform(userId); + + Class connectorProviderClass = Class.forName(connectorProviderClassName); + Object potentialConnectorProvider = connectorProviderClass.getDeclaredConstructor().newInstance(); + + ConnectorProvider connectorProvider = (ConnectorProvider) potentialConnectorProvider; + + ConnectorType connectorType = connectorProvider.getConnectorType(); + + if (connectorType == null) + { + connectorType = new ConnectorType(); + + connectorType.setConnectorProviderClassName(connectorProviderClassName); + } + + response.setConnectorType(connectorType); + } + catch (Exception error) + { + exceptionHandler.captureExceptions(response, error, methodName); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -248,7 +305,7 @@ public BooleanResponse isServerKnown(String userId, { final String methodName = "isServerKnown"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); BooleanResponse response = new BooleanResponse(); @@ -261,7 +318,7 @@ public BooleanResponse isServerKnown(String userId, exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -277,7 +334,7 @@ public ServerListResponse getKnownServerList(String userId) { final String methodName = "getKnownServerList"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); ServerListResponse response = new ServerListResponse(); @@ -290,7 +347,7 @@ public ServerListResponse getKnownServerList(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -306,7 +363,7 @@ public ServerListResponse getActiveServerList(String userId) { final String methodName = "getActiveServerList"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); ServerListResponse response = new ServerListResponse(); @@ -319,7 +376,7 @@ public ServerListResponse getActiveServerList(String userId) exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -337,7 +394,7 @@ public ServerStatusResponse getServerStatus(String userId, { final String methodName = "getServerStatus"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); ServerStatusResponse response = new ServerStatusResponse(); @@ -355,7 +412,7 @@ public ServerStatusResponse getServerStatus(String userId, exceptionHandler.captureExceptions(response, error, methodName); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } @@ -373,7 +430,7 @@ public ServerServicesListResponse getActiveServiceListForServer(String userId { final String methodName = "getActiveServerList"; - log.debug("Calling method: " + methodName); + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); ServerServicesListResponse response = new ServerServicesListResponse(); @@ -387,7 +444,7 @@ public ServerServicesListResponse getActiveServiceListForServer(String userId exceptionHandler.captureExceptions(response, error, methodName, null); } - log.debug("Returning from method: " + methodName + " with response: " + response.toString()); + restCallLogger.logRESTCallReturn(token, response.toString()); return response; } diff --git a/open-metadata-implementation/platform-services/platform-services-spring/src/main/java/org/odpi/openmetadata/platformservices/server/spring/OMAGServerPlatformActiveResource.java b/open-metadata-implementation/platform-services/platform-services-spring/src/main/java/org/odpi/openmetadata/platformservices/server/spring/OMAGServerPlatformActiveResource.java index 792b2783cb7..99a0aa63bee 100644 --- a/open-metadata-implementation/platform-services/platform-services-spring/src/main/java/org/odpi/openmetadata/platformservices/server/spring/OMAGServerPlatformActiveResource.java +++ b/open-metadata-implementation/platform-services/platform-services-spring/src/main/java/org/odpi/openmetadata/platformservices/server/spring/OMAGServerPlatformActiveResource.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import org.odpi.openmetadata.commonservices.ffdc.rest.BooleanResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.ConnectorTypeResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.RegisteredOMAGServicesResponse; import org.odpi.openmetadata.platformservices.rest.ServerListResponse; import org.odpi.openmetadata.platformservices.rest.ServerServicesListResponse; @@ -35,7 +36,7 @@ public class OMAGServerPlatformActiveResource { - OMAGServerPlatformActiveServices platformAPI = new OMAGServerPlatformActiveServices(); + private final OMAGServerPlatformActiveServices platformAPI = new OMAGServerPlatformActiveServices(); /** @@ -93,7 +94,7 @@ public RegisteredOMAGServicesResponse getRegisteredEngineServices(@Parameter(des /** * Return the list of integration services that are implemented in this OMAG Server Platform - * and can be configured for a integration daemon server. + * and can be configured for an integration daemon server. * * @param userId calling user * @return list of service descriptions @@ -217,6 +218,37 @@ public RegisteredOMAGServicesResponse getAllRegisteredServices(@Parameter(descri } + /** + * Return the connector type for the requested connector provider after validating that the + * connector provider is available on the OMAGServerPlatform's class path. This method is for tools that are configuring + * connectors into an Egeria server. It does not validate that the connector will load and initialize. + * + * @param userId calling user + * @param connectorProviderClassName name of the connector provider class + * @return ConnectorType bean or exceptions that occur when trying to create the connector + */ + @GetMapping(path = "/connector-types/{connectorProviderClassName}") + @Operation( summary = "Return the connector type for the requested connector provider", + description="Return the connector type for the requested connector provider after validating that the" + + " connector provider is available on the OMAGServerPlatform's class path. This method is for tools that are configuring" + + " connectors into an Egeria server. It does not validate that the connector will load and initialize.", + responses = { + @ApiResponse(responseCode = "200",description="Connector type", + content = @Content( + mediaType ="application/json", + schema = @Schema(implementation=ConnectorTypeResponse.class) + ) + + ) + }) + + public ConnectorTypeResponse getConnectorType(@Parameter(description="calling user") @PathVariable String userId, + @Parameter(description="name of the connector provider class") @PathVariable String connectorProviderClassName) + { + return platformAPI.getConnectorType(userId, connectorProviderClassName); + } + + /** * Return a flag to indicate if this server has ever run on this OMAG Server Platform. * From f16dab82aa58e40383d328b2f37af743b4ca49a4 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Sun, 13 Nov 2022 23:58:54 +0000 Subject: [PATCH 4/4] Allow local cohort provenance Signed-off-by: Mandy Chessell --- .../README.md | 37 ++++++++++-------- .../KafkaMonitorIntegrationConnector.java | 1 - .../OpenAPIMonitorIntegrationConnector.java | 4 +- .../APIBasedOpenLineageLogStoreConnector.java | 6 +-- ...eageEventReceiverIntegrationConnector.java | 4 +- .../api/connector/APIIntegratorContext.java | 12 +++--- .../APIIntegratorContextManager.java | 33 +++++++--------- .../CatalogIntegratorContextManager.java | 32 +++++++-------- .../DatabaseIntegratorContextManager.java | 27 ++++++------- .../spring/DatabaseIntegratorResource.java | 2 +- .../DisplayIntegratorContextManager.java | 27 ++++++------- ...nfrastructureIntegratorContextManager.java | 39 +++++++++---------- .../LineageIntegratorContextManager.java | 32 +++++++-------- .../OrganizationIntegratorContextManager.java | 28 ++++++------- .../SecurityIntegratorContextManager.java | 28 ++++++------- .../TopicIntegratorContextManager.java | 27 ++++++------- 16 files changed, 146 insertions(+), 193 deletions(-) diff --git a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/README.md b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/README.md index 5a3702457ec..251958b6871 100644 --- a/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/README.md +++ b/open-metadata-implementation/adapters/open-connectors/event-bus-connectors/open-metadata-topic-connectors/kafka-open-metadata-topic-connector/README.md @@ -6,12 +6,16 @@ # Kafka Open Metadata Topic Connector The Kafka Open Metadata Topic Connector implements -an [Apache Kafka](https://kafka.apache.org/) connector for a topic that exchanges +an [Apache Kafka](https://kafka.apache.org/) open metadata topic connector for a topic that exchanges Java Objects as JSON payloads. -# Default Configuration +[Link to usage instructions](https://egeria-project.org/connectors/resource/kafka-open-metadata-topic-connector/) in the connector catalog. -## Producer +## Implementation Notes +### Default Configuration +These are default property settings passed to Apache Kafka for the producer and consumer. + +#### Producer (see [Apache Kafka producer configurations](http://kafka.apache.org/0100/documentation.html#producerconfigs) for more information and options) @@ -29,7 +33,7 @@ Java Objects as JSON payloads. | bring.up.retries | 10 | | bring.up.minSleepTime | 5000 | -## Consumer +#### Consumer (see [Apache Kafka consumer configurations](http://kafka.apache.org/0100/documentation.html#newconsumerconfigs) for more information and options) @@ -45,12 +49,12 @@ Java Objects as JSON payloads. | bring.up.retries | 10 | | bring.up.minSleepTime | 5000 | -# Security +### Security -By default kafka security is not configured. The exact configuration may depend on the specific kafka service being used. Service specific notes +By default, kafka security is not configured. The exact configuration may depend on the specific kafka service being used. Service specific notes are below. They may work for other providers, and feedback is welcome so that this documentation can be updated accordingly. -## IBM Event Streams on IBM Cloud +#### IBM Event Streams on IBM Cloud There are 2 key pieces of information that are provided in the documentation for your configured cloud service @@ -69,7 +73,7 @@ There are 2 key pieces of information that are provided in the documentation for ``` An example of a use of this configuration can be found in the virtual data connector helm charts. See [odpi-egeria-vdc helm chart](https://github.com/odpi/egeria-samples/tree/main/helm-charts/odpi-egeria-vdc/README.md) -## Handling Kafka Cluster Bring Up Issues +#### Handling Kafka Cluster Bring Up Issues In some environments users have encountered issues when the Kafka Cluster hasn't become fully available, when attempting a connection to the Kafka Cluster. The Egeria KafkaTopicConnector provides a mechanism that verifies that the Kafka Cluster is actually running brokers before attempting to connect. @@ -82,27 +86,28 @@ bring.up.retries defaults to 10 and specifies the number of times the Egeria KafkaTopicConnector will retry verification before reporting a failure. bring.up.minSleepTime is set to 5000ms by default and is the minimum amount of time to wait before attempting a verification retry. -If a Kafka verification attempt takes longer than this value the KafkaTopicConnector does not pause before retring the verification. +If a Kafka verification attempt takes longer than this value the KafkaTopicConnector does not pause before retrying the verification. -## Topic Creation +#### Topic Creation -In addition many enterprise kafka services do not allow automatic topic creation. +In addition, many enterprise kafka services do not allow automatic topic creation. You will need to manually create topics of the following form BASE_TOPIC_NAME is the value used for topicURLRoot when configuring the egeria event bus. For example, the default value is `egeria`. -### Cohort topics +##### Cohort topics For each cohort being used (such as `cocoCohort`): * BASE_TOPIC_NAME.omag.openmetadata.repositoryservices.cohort.COHORT_NAME.OMRSTopic -### OMAS Topics +##### OMAS Topics + These need to be done FOR EACH SERVER configured to run one or more OMASs. -(For example for Coco Pharmaceuticals this might include `cocoMDS1`, `cocoMDS2`, `cocoMDS3` etc). +(For example for Coco Pharmaceuticals this might include `cocoMDS1`, `cocoMDS2`, `cocoMDS3` etc.) -FOR EACH OMAS configured (eg Asset Consumer OMAS, Data Platform OMAS, Governance Engine OMAS etc) +FOR EACH OMAS configured (eg Asset Consumer OMAS, Data Platform OMAS, Governance Engine OMAS etc.) * BASE_TOPIC_NAME.omag.server.SERVER_NAME.omas.OMAS_NAME.InTopic * BASE_TOPIC_NAME.omag.server.SERVER_NAME.omas.OMAS_NAME.OutTopic @@ -111,7 +116,7 @@ FOR EACH OMAS configured (eg Asset Consumer OMAS, Data Platform OMAS, Governance One way to configure is to initially run against a kafka service which allows auto topic creation, then make note of the kafka topics that have been created - so that they can be replicated on the restricted setup. -In addition review the Egeria Audit Log for any events beginning OCF-KAFKA-TOPIC-CONNECTOR so that +In addition, review the Egeria Audit Log for any events beginning OCF-KAFKA-TOPIC-CONNECTOR so that action may be taken if for example topics are found to be missing. diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java index 52e7a921c5b..9e9d9461e64 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/KafkaMonitorIntegrationConnector.java @@ -11,7 +11,6 @@ import org.odpi.openmetadata.adapters.connectors.integration.kafka.ffdc.KafkaIntegrationConnectorAuditCode; import org.odpi.openmetadata.adapters.connectors.integration.kafka.ffdc.KafkaIntegrationConnectorErrorCode; import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; -import org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties; import org.odpi.openmetadata.frameworks.connectors.properties.EndpointProperties; import org.odpi.openmetadata.integrationservices.topic.connector.TopicIntegratorConnector; import org.odpi.openmetadata.integrationservices.topic.connector.TopicIntegratorContext; diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java index 8c207cff87c..7c7189233d7 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java @@ -43,7 +43,7 @@ public class OpenAPIMonitorIntegrationConnector extends APIIntegratorConnector i private String templateQualifiedName = null; private String targetRootURL = null; - private Map restClients = new HashMap<>(); + private final Map restClients = new HashMap<>(); private APIIntegratorContext myContext = null; @@ -541,7 +541,7 @@ private String getEndpointGUID(String url, /** * Create a new API element if one does not already exist in the open metadata catalog. The GUID of the API element is - * returned but it is the responsibility of the caller to add it to the apiGUIDMap if needed. + * returned, but it is the responsibility of the caller to add it to the apiGUIDMap if needed. * * @param url URL of the API * @param endpointGUID unique identifier for endpoint element that the API should be connected to diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/APIBasedOpenLineageLogStoreConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/APIBasedOpenLineageLogStoreConnector.java index 0ff68011f56..517f850bb82 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/APIBasedOpenLineageLogStoreConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/APIBasedOpenLineageLogStoreConnector.java @@ -3,7 +3,6 @@ package org.odpi.openmetadata.adapters.connectors.integration.openlineage; import org.odpi.openmetadata.adapters.connectors.integration.openlineage.ffdc.OpenLineageIntegrationConnectorErrorCode; -import org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient; import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -23,9 +22,8 @@ /** - * FileBasedOpenLineageLogStoreConnector provides a connector implementation for a file based open lineage log. - * The open lineage log is stored in a directory and each open lineage event record is stored as a file with a filename built - * from the record's unique identifier (runId), time and status. The record is stored in a subdirectory that is made from the namespace and job. + * APIBasedOpenLineageLogStoreConnector provides a connector implementation for an API based open lineage log. + * Each lineage record is passed to the supplied lineage API. */ public class APIBasedOpenLineageLogStoreConnector extends OpenLineageLogStoreConnectorBase { diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/OpenLineageEventReceiverIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/OpenLineageEventReceiverIntegrationConnector.java index b2e2f22e15a..28177790ad2 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/OpenLineageEventReceiverIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openlineage-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openlineage/OpenLineageEventReceiverIntegrationConnector.java @@ -5,7 +5,6 @@ import org.odpi.openmetadata.adapters.connectors.integration.openlineage.ffdc.OpenLineageIntegrationConnectorAuditCode; import org.odpi.openmetadata.frameworks.connectors.Connector; -import org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension; import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; import org.odpi.openmetadata.frameworks.connectors.properties.ConnectionProperties; import org.odpi.openmetadata.frameworks.connectors.properties.EndpointProperties; @@ -15,7 +14,6 @@ import org.odpi.openmetadata.repositoryservices.connectors.openmetadatatopic.OpenMetadataTopicListener; import java.util.HashMap; -import java.util.List; import java.util.Map; @@ -26,7 +24,7 @@ public class OpenLineageEventReceiverIntegrationConnector extends LineageIntegratorConnector implements OpenMetadataTopicListener { private LineageIntegratorContext myContext = null; - private Map topicConnectors = new HashMap<>(); + private final Map topicConnectors = new HashMap<>(); /** diff --git a/open-metadata-implementation/integration-services/api-integrator/api-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/api/connector/APIIntegratorContext.java b/open-metadata-implementation/integration-services/api-integrator/api-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/api/connector/APIIntegratorContext.java index 1220c6906a3..d06ab2e53f7 100644 --- a/open-metadata-implementation/integration-services/api-integrator/api-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/api/connector/APIIntegratorContext.java +++ b/open-metadata-implementation/integration-services/api-integrator/api-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/api/connector/APIIntegratorContext.java @@ -20,12 +20,12 @@ */ public class APIIntegratorContext { - private APIManagerClient apiManagerClient; - private ConnectionManagerClient connectionManagerClient; - private DataManagerEventClient eventClient; - private String userId; - private String apiManagerGUID; - private String apiManagerName; + private final APIManagerClient apiManagerClient; + private final ConnectionManagerClient connectionManagerClient; + private final DataManagerEventClient eventClient; + private final String userId; + private final String apiManagerGUID; + private final String apiManagerName; private boolean apiManagerIsHome = true; diff --git a/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java b/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java index 089f3983269..618aa2e1c91 100644 --- a/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java @@ -10,7 +10,6 @@ import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; import org.odpi.openmetadata.accessservices.datamanager.properties.APIManagerProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -131,27 +130,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + APIManagerProperties properties = new APIManagerProperties(); - if (metadataSourceGUID == null) - { - APIManagerProperties properties = new APIManagerProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = metadataSourceClient.createAPIManager(localServerUserId, null, null, properties); + } - metadataSourceGUID = metadataSourceClient.createAPIManager(localServerUserId, null, null, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } @@ -223,9 +218,9 @@ public void setContext(String connectorId, final String parameterName = "integrationConnector"; throw new InvalidParameterException(APIIntegratorErrorCode.INVALID_CONNECTOR. - getMessageDefinition(connectorName, - IntegrationServiceDescription.API_INTEGRATOR_OMIS.getIntegrationServiceFullName(), - APIIntegratorConnector.class.getCanonicalName()), + getMessageDefinition(connectorName, + IntegrationServiceDescription.API_INTEGRATOR_OMIS.getIntegrationServiceFullName(), + APIIntegratorConnector.class.getCanonicalName()), this.getClass().getName(), methodName, parameterName); diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java index 2e237448282..9f8bb09fd7b 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java @@ -8,7 +8,6 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -31,7 +30,7 @@ */ public class CatalogIntegratorContextManager extends IntegrationContextManager { - private static String disabledExchangeServicesOption = "disabledExchangeServices"; + private final static String disabledExchangeServicesOption = "disabledExchangeServices"; private ExternalAssetManagerClient assetManagerClient; private CollaborationExchangeClient collaborationExchangeClient; @@ -192,28 +191,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); - + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = assetManagerClient.getExternalAssetManagerGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = assetManagerClient.getExternalAssetManagerGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + AssetManagerProperties properties = new AssetManagerProperties(); - if (metadataSourceGUID == null) - { - AssetManagerProperties properties = new AssetManagerProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = assetManagerClient.createExternalAssetManager(localServerUserId, properties); + } - metadataSourceGUID = assetManagerClient.createExternalAssetManager(localServerUserId, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } @@ -348,7 +342,7 @@ private SynchronizationDirection getSynchronizationDirection(PermittedSynchroniz * * @param serviceOptions options passed to the integration service. * @return null or list of disabled exchange service names - * @throws InvalidParameterException the supported zones property is not a list of zone names. + * @throws InvalidParameterException the "supported zones" property is not a list of zone names. */ private List extractDisabledExchangeServices(Map serviceOptions, String connectorName) throws InvalidParameterException diff --git a/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java b/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java index 19b2d64587f..c68e2b3f2b9 100644 --- a/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java @@ -10,7 +10,6 @@ import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; import org.odpi.openmetadata.accessservices.datamanager.properties.DatabaseManagerProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -130,27 +129,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + DatabaseManagerProperties properties = new DatabaseManagerProperties(); - if (metadataSourceGUID == null) - { - DatabaseManagerProperties properties = new DatabaseManagerProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = metadataSourceClient.createDatabaseManager(localServerUserId, null, null, properties); + } - metadataSourceGUID = metadataSourceClient.createDatabaseManager(localServerUserId, null, null, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } diff --git a/open-metadata-implementation/integration-services/database-integrator/database-integrator-spring/src/main/java/org/odpi/openmetadata/integrationservices/database/server/spring/DatabaseIntegratorResource.java b/open-metadata-implementation/integration-services/database-integrator/database-integrator-spring/src/main/java/org/odpi/openmetadata/integrationservices/database/server/spring/DatabaseIntegratorResource.java index 68813135fad..2bb10732317 100644 --- a/open-metadata-implementation/integration-services/database-integrator/database-integrator-spring/src/main/java/org/odpi/openmetadata/integrationservices/database/server/spring/DatabaseIntegratorResource.java +++ b/open-metadata-implementation/integration-services/database-integrator/database-integrator-spring/src/main/java/org/odpi/openmetadata/integrationservices/database/server/spring/DatabaseIntegratorResource.java @@ -21,7 +21,7 @@ public class DatabaseIntegratorResource { - private DatabaseIntegratorRESTServices restAPI = new DatabaseIntegratorRESTServices(); + private final DatabaseIntegratorRESTServices restAPI = new DatabaseIntegratorRESTServices(); /** diff --git a/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java b/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java index e656aec93f4..647507e1f95 100644 --- a/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java @@ -9,7 +9,6 @@ import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; import org.odpi.openmetadata.accessservices.datamanager.properties.ApplicationProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -123,27 +122,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + ApplicationProperties properties = new ApplicationProperties(); - if (metadataSourceGUID == null) - { - ApplicationProperties properties = new ApplicationProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = metadataSourceClient.createApplication(localServerUserId, null, null, properties); + } - metadataSourceGUID = metadataSourceClient.createApplication(localServerUserId, null, null, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } diff --git a/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/contextmanager/InfrastructureIntegratorContextManager.java b/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/contextmanager/InfrastructureIntegratorContextManager.java index 97fb6294bff..402c155d5e7 100644 --- a/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/contextmanager/InfrastructureIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/infrastructure-integrator/infrastructure-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/infrastructure/contextmanager/InfrastructureIntegratorContextManager.java @@ -18,7 +18,6 @@ import org.odpi.openmetadata.accessservices.itinfrastructure.metadataelements.SoftwareCapabilityElement; import org.odpi.openmetadata.accessservices.itinfrastructure.properties.SoftwareCapabilityProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -141,34 +140,32 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = null; - String metadataSourceGUID = null; + List softwareCapabilityElements = capabilityManagerClient.getSoftwareCapabilitiesByName(localServerUserId, + metadataSourceQualifiedName, + null, 0, 0); - List softwareCapabilityElements = capabilityManagerClient.getSoftwareCapabilitiesByName(localServerUserId, metadataSourceQualifiedName, null, 0 , 0); + if ((softwareCapabilityElements != null) && (! softwareCapabilityElements.isEmpty())) + { + metadataSourceGUID = softwareCapabilityElements.get(0).getElementHeader().getGUID(); + } - if ((softwareCapabilityElements != null) && (! softwareCapabilityElements.isEmpty())) - { - metadataSourceGUID = softwareCapabilityElements.get(0).getElementHeader().getGUID(); - } + if (metadataSourceGUID == null) + { + SoftwareCapabilityProperties properties = new SoftwareCapabilityProperties(); - if (metadataSourceGUID == null) - { - SoftwareCapabilityProperties properties = new SoftwareCapabilityProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = capabilityManagerClient.createSoftwareCapability(localServerUserId, null, null, false, null, properties); + } - metadataSourceGUID = capabilityManagerClient.createSoftwareCapability(localServerUserId, null, null, false, null, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } /** diff --git a/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java b/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java index 1e4a822f3ec..e6498581760 100644 --- a/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java @@ -8,7 +8,6 @@ import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -41,8 +40,8 @@ public class LineageIntegratorContextManager extends IntegrationContextManager i private GovernanceExchangeClient governanceExchangeClient; private StewardshipExchangeClient stewardshipExchangeClient; - private ObjectMapper objectMapper = new ObjectMapper(); - private List registeredEventListeners = new ArrayList<>(); + private final ObjectMapper objectMapper = new ObjectMapper(); + private final List registeredEventListeners = new ArrayList<>(); /** @@ -152,28 +151,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); - + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = assetManagerClient.getExternalAssetManagerGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = assetManagerClient.getExternalAssetManagerGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + AssetManagerProperties properties = new AssetManagerProperties(); - if (metadataSourceGUID == null) - { - AssetManagerProperties properties = new AssetManagerProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = assetManagerClient.createExternalAssetManager(localServerUserId, properties); + } - metadataSourceGUID = assetManagerClient.createExternalAssetManager(localServerUserId, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } diff --git a/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/organization/contextmanager/OrganizationIntegratorContextManager.java b/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/organization/contextmanager/OrganizationIntegratorContextManager.java index 9d167dedc57..c278572f357 100644 --- a/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/organization/contextmanager/OrganizationIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/organization/contextmanager/OrganizationIntegratorContextManager.java @@ -11,7 +11,6 @@ import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; import org.odpi.openmetadata.accessservices.communityprofile.properties.MetadataSourceProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -138,28 +137,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); - + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + MetadataSourceProperties properties = new MetadataSourceProperties(); - if (metadataSourceGUID == null) - { - MetadataSourceProperties properties = new MetadataSourceProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = metadataSourceClient.createMetadataSource(localServerUserId, properties); + } - metadataSourceGUID = metadataSourceClient.createMetadataSource(localServerUserId, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } diff --git a/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java b/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java index 31f67850a74..1533cfcecf9 100644 --- a/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java @@ -9,7 +9,6 @@ import org.odpi.openmetadata.accessservices.securitymanager.client.rest.SecurityManagerRESTClient; import org.odpi.openmetadata.accessservices.securitymanager.properties.SecurityManagerProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -123,28 +122,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); - + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = metadataSourceClient.getExternalSecurityManagerGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = metadataSourceClient.getExternalSecurityManagerGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + SecurityManagerProperties properties = new SecurityManagerProperties(); - if (metadataSourceGUID == null) - { - SecurityManagerProperties properties = new SecurityManagerProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = metadataSourceClient.createExternalSecurityManager(localServerUserId, null, null, null, properties); + } - metadataSourceGUID = metadataSourceClient.createExternalSecurityManager(localServerUserId, null, null, null, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; } diff --git a/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java b/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java index 627c5a67339..5da28fa4c7c 100644 --- a/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java @@ -11,7 +11,6 @@ import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; import org.odpi.openmetadata.accessservices.datamanager.properties.EventBrokerProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -138,27 +137,23 @@ private String setUpMetadataSource(String metadataSourceQualifiedName) throws UserNotAuthorizedException, PropertyServerException { - final String metadataSourceQualifiedNameParameterName = "metadataSourceQualifiedName"; - final String methodName = "setUpMetadataSource"; - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - invalidParameterHandler.validateName(metadataSourceQualifiedName, - metadataSourceQualifiedNameParameterName, - methodName); + if (metadataSourceQualifiedName != null) + { + String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); - String metadataSourceGUID = metadataSourceClient.getMetadataSourceGUID(localServerUserId, metadataSourceQualifiedName); + if (metadataSourceGUID == null) + { + EventBrokerProperties properties = new EventBrokerProperties(); - if (metadataSourceGUID == null) - { - EventBrokerProperties properties = new EventBrokerProperties(); + properties.setQualifiedName(metadataSourceQualifiedName); - properties.setQualifiedName(metadataSourceQualifiedName); + metadataSourceGUID = metadataSourceClient.createEventBroker(localServerUserId, null, null, properties); + } - metadataSourceGUID = metadataSourceClient.createEventBroker(localServerUserId, null, null, properties); + return metadataSourceGUID; } - return metadataSourceGUID; + return null; }