From 0b4696d4862a2bd4830dcc01a2f9792937eb8767 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Sun, 23 Apr 2023 08:11:56 +0100 Subject: [PATCH 1/2] Add secrets connector Signed-off-by: Mandy Chessell --- .../CollaborationExchangeInterface.java | 35 +- .../StewardshipExchangeInterface.java | 413 +++++++- .../CollaborationManagementInterface.java | 28 + .../StewardshipManagementInterface.java | 274 +++++ .../metadataelements/AssetElement.java | 194 ++++ .../properties/AssetOriginProperties.java | 29 +- .../properties/DataFieldValuesProperties.java | 12 +- .../properties/FeedbackProperties.java | 4 +- .../properties/FindAssetOriginProperties.java | 185 ++++ .../properties/FindNameProperties.java | 128 +++ .../properties/FindProperties.java | 70 ++ .../properties/LevelIdentifierProperties.java | 111 ++ .../properties/OwnerProperties.java | 1 - .../rest/AssetElementsResponse.java | 151 +++ .../assetmanager/rest/ConnectionResponse.java | 4 +- .../rest/ConnectionsResponse.java | 4 +- .../rest/ConnectorTypeRequestBody.java | 4 +- .../rest/ConnectorTypeResponse.java | 4 +- .../rest/ConnectorTypesResponse.java | 4 +- .../rest/ControlFlowElementResponse.java | 4 +- .../rest/ControlFlowRequestBody.java | 4 +- .../rest/DataAssetElementResponse.java | 4 +- .../rest/DataAssetElementsResponse.java | 4 +- .../rest/DataAssetRequestBody.java | 4 +- .../rest/DataFlowElementResponse.java | 4 +- .../rest/DataFlowElementsResponse.java | 4 +- .../rest/DataFlowRequestBody.java | 4 +- .../rest/ElementHeaderResponse.java | 4 +- .../rest/ElementHeadersResponse.java | 6 +- .../rest/ElementStubsResponse.java | 152 +++ .../rest/EndpointRequestBody.java | 4 +- .../assetmanager/rest/EndpointResponse.java | 4 +- .../assetmanager/rest/EndpointsResponse.java | 4 +- ...xternalGlossaryElementLinkRequestBody.java | 4 +- .../ExternalGlossaryLinkElementsResponse.java | 4 +- .../rest/ExternalGlossaryLinkRequestBody.java | 4 +- .../ExternalReferenceElementResponse.java | 4 +- .../ExternalReferenceElementsResponse.java | 4 +- .../ExternalReferenceLinkElementResponse.java | 4 +- ...ExternalReferenceLinkElementsResponse.java | 4 +- .../ExternalReferenceLinkRequestBody.java | 4 +- .../rest/ExternalReferenceRequestBody.java | 4 +- ....java => FindByPropertiesRequestBody.java} | 59 +- .../rest/ForeignKeyRequestBody.java | 4 +- .../rest/GlossaryCategoryElementResponse.java | 4 +- .../GlossaryCategoryElementsResponse.java | 4 +- .../rest/GlossaryElementResponse.java | 4 +- .../rest/GlossaryRequestBody.java | 151 --- .../rest/GlossaryTermElementResponse.java | 4 +- .../rest/GovernanceActionElementResponse.java | 4 +- .../GovernanceActionElementsResponse.java | 4 +- ...overnanceActionProcessElementResponse.java | 4 +- ...vernanceActionProcessElementsResponse.java | 4 +- .../GovernanceActionTypeElementResponse.java | 4 +- .../GovernanceActionTypeElementsResponse.java | 4 +- .../rest/InformalTagResponse.java | 4 +- .../rest/LineageMappingElementResponse.java | 4 +- .../rest/LineageMappingElementsResponse.java | 4 +- ...tGovernanceActionTypeElementsResponse.java | 4 +- .../rest/PortElementResponse.java | 4 +- .../rest/PortElementsResponse.java | 4 +- .../assetmanager/rest/PortRequestBody.java | 4 +- .../PrimaryKeyClassificationRequestBody.java | 4 +- .../rest/ProcessCallElementResponse.java | 4 +- .../rest/ProcessCallElementsResponse.java | 4 +- .../rest/ProcessCallRequestBody.java | 4 +- .../rest/ProcessElementResponse.java | 4 +- .../rest/ProcessElementsResponse.java | 4 +- .../assetmanager/rest/ProcessRequestBody.java | 4 +- .../rest/ProcessStatusRequestBody.java | 2 + .../rest/RelationshipElementResponse.java | 4 +- .../rest/RelationshipElementsResponse.java | 4 +- .../rest/SchemaAttributeElementResponse.java | 4 +- .../rest/SchemaAttributeElementsResponse.java | 4 +- .../rest/SchemaAttributeRequestBody.java | 4 +- .../rest/SchemaTypeRequestBody.java | 4 +- .../client/AssetManagerBaseClient.java | 71 +- .../exchange/CollaborationExchangeClient.java | 65 ++ .../exchange/StewardshipExchangeClient.java | 652 ++++++++++++ .../CollaborationManagementClient.java | 33 + .../StewardshipManagementClient.java | 432 +++++++- .../client/rest/AssetManagerRESTClient.java | 60 +- .../converters/AssetManagerOMASConverter.java | 58 ++ .../converters/RelatedElementConverter.java | 64 ++ .../handlers/CommentExchangeHandler.java | 5 +- .../handlers/GlossaryExchangeHandler.java | 60 ++ .../server/AssetManagerInstanceHandler.java | 91 ++ .../server/AssetManagerServicesInstance.java | 98 +- .../StewardshipExchangeRESTServices.java | 974 +++++++++++++++++- .../spring/StewardshipExchangeResource.java | 406 ++++++-- .../api/SubjectAreasInterface.java | 1 + .../adapters/open-connectors/README.md | 4 +- .../atlas-integration-connector/README.md | 18 + .../atlas-integration-connector/build.gradle | 38 + .../ApacheAtlasIntegrationConnector.java | 442 ++++++++ .../ApacheAtlasIntegrationProvider.java | 86 ++ .../apacheatlas/ApacheAtlasRESTClient.java | 496 +++++++++ .../ffdc/ApacheAtlasAuditCode.java | 214 ++++ .../ffdc/ApacheAtlasErrorCode.java | 114 ++ .../apacheatlas/ffdc/package-info.java | 9 + .../integration/apacheatlas/package-info.java | 7 + .../AtlasGlossaryAnchorElement.java | 86 ++ .../AtlasGlossaryBaseProperties.java | 156 +++ .../properties/AtlasGlossaryElement.java | 63 ++ .../AtlasGlossaryMemberBaseProperties.java | 48 + .../properties/AtlasGlossaryProperties.java | 88 ++ .../AtlasGlossaryTermProperties.java | 88 ++ .../properties/AtlasRelatedTermHeader.java | 86 ++ .../apacheatlas/ffdc/AuditCodeTest.java | 27 + .../apacheatlas/ffdc/ErrorCodeTest.java | 27 + .../KafkaIntegrationConnectorAuditCode.java | 18 +- .../KafkaIntegrationConnectorErrorCode.java | 5 +- .../integration/openapis/RESTClient.java | 2 +- .../InMemoryOMRSMetadataCollection.java | 18 +- .../secrets-store-connectors/README.md | 14 + .../README.md | 17 + .../build.gradle | 22 + .../envar/EnvVarSecretsStoreConnector.java | 24 + .../envar/EnvVarSecretsStoreProvider.java | 77 ++ .../secretsstore/envar/package-info.java | 7 + .../generichandlers/AssetHandler.java | 153 ++- .../generichandlers/CommentHandler.java | 71 +- .../generichandlers/ReferenceableBuilder.java | 16 +- .../generichandlers/ReferenceableHandler.java | 565 +++++++++- .../frameworks/connectors/ConnectorBase.java | 38 +- .../connectors/ConnectorBroker.java | 133 +-- .../connectors/SecretsStoreConnector.java | 34 + .../connectors/SecureConnectorExtension.java | 21 + .../properties/ConnectionProperties.java | 6 +- .../context/IntegrationContext.java | 38 +- .../opentypes/OpenMetadataTypesArchive.java | 12 +- .../open-metadata-security-samples/README.md | 52 +- settings.gradle | 2 + 133 files changed, 8287 insertions(+), 458 deletions(-) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/AssetElement.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindAssetOriginProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindNameProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LevelIdentifierProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetElementsResponse.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementStubsResponse.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/{GlossaryCategoryRequestBody.java => FindByPropertiesRequestBody.java} (54%) delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryRequestBody.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RelatedElementConverter.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/build.gradle create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationConnector.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationProvider.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasRESTClient.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasErrorCode.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/package-info.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryAnchorElement.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryBaseProperties.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryElement.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryMemberBaseProperties.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryProperties.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryTermProperties.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasRelatedTermHeader.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/AuditCodeTest.java create mode 100644 open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ErrorCodeTest.java create mode 100644 open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/README.md create mode 100644 open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/README.md create mode 100644 open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/build.gradle create mode 100644 open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreConnector.java create mode 100644 open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreProvider.java create mode 100644 open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/package-info.java create mode 100644 open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecretsStoreConnector.java create mode 100644 open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecureConnectorExtension.java diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java index dd6179323b8..66381deb405 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java @@ -22,8 +22,7 @@ import java.util.List; /** - * The CollaborationExchangeInterface supports the exchange of comments, likes, reviews/ratings and - * informal tags. + * The CollaborationExchangeInterface supports the exchange of comments, likes, reviews/ratings and informal tags. */ public interface CollaborationExchangeInterface { @@ -766,6 +765,38 @@ List getNoteLogsByName(String userId, PropertyServerException; + /** + * Retrieve the list of note log metadata elements attached to the element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique elementGUID of software capability representing the caller + * @param elementGUID element to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of matching metadata elements + * + * @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) + */ + List getNoteLogsForElement(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Retrieve the note log metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/StewardshipExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/StewardshipExchangeInterface.java index 14b0b1cdf47..f0d62a8f733 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/StewardshipExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/StewardshipExchangeInterface.java @@ -2,6 +2,10 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceDefinitionElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.OwnerProperties; @@ -12,8 +16,10 @@ 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.ElementStub; import java.util.Date; +import java.util.List; /** @@ -83,6 +89,40 @@ void clearConfidenceClassification(String userId, PropertyServerException; + /** + * Return information about the elements classified with the confidence classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getConfidenceClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify/reclassify the element (typically an asset) to indicate how critical the element (or associated resource) * is to the organization. The level of criticality is expressed by the levelIdentifier property. @@ -143,6 +183,40 @@ void clearCriticalityClassification(String userId, PropertyServerException; + /** + * Return information about the elements classified with the criticality classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getCriticalityClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify/reclassify the element (typically a data field, schema attribute or glossary term) to indicate the level of confidentiality * that any data associated with the element should be given. If the classification is attached to a glossary term, the level @@ -205,6 +279,42 @@ void clearConfidentialityClassification(String userId, PropertyServerException; + + + /** + * Return information about the elements classified with the confidentiality classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getConfidentialityClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify/reclassify the element (typically an asset) to indicate how long the element (or associated resource) * is to be retained by the organization. The policy to apply to the element/resource is captured by the retentionBasis @@ -266,6 +376,41 @@ void clearRetentionClassification(String userId, UserNotAuthorizedException, PropertyServerException; + + /** + * Return information about the elements classified with the retention classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificBasisIdentifier should the results be filtered by basisIdentifier? + * @param basisIdentifier the identifier to filter by (if returnSpecificBasisIdentifier=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getRetentionClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificBasisIdentifier, + int basisIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Add or replace the security tags for an element. * @@ -324,6 +469,35 @@ void clearSecurityTags(String userId, PropertyServerException; + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getSecurityTaggedElements(String userId, + String assetManagerGUID, + String assetManagerName, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + /** * Add or replace the ownership classification for an element. * @@ -382,6 +556,38 @@ void clearOwnership(String userId, PropertyServerException; + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param owner unique identifier for the owner + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getOwnersElements(String userId, + String assetManagerGUID, + String assetManagerName, + String owner, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Add or replace the origin classification for an asset. * @@ -440,6 +646,38 @@ void clearAssetOrigin(String userId, PropertyServerException; + /** + * Return information about the assets from a specific origin. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param properties values to search on - null means any value + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of the assets + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getAssetsByOrigin(String userId, + String assetManagerGUID, + String assetManagerName, + AssetOriginProperties properties, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify the element to assert that the definitions it represents are part of a subject area definition. * @@ -498,6 +736,38 @@ void removeElementFromSubjectArea(String userId, PropertyServerException; + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param subjectAreaName unique identifier for the subject area + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getMembersOfSubjectArea(String userId, + String assetManagerGUID, + String assetManagerName, + String subjectAreaName, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Create a semantic assignment relationship between a glossary term and an element (normally a schema attribute, data field or asset). * This relationship indicates that the data associated with the element meaning matches the description in the glossary term. @@ -556,6 +826,67 @@ void clearSemanticAssignment(String userId, UserNotAuthorizedException, PropertyServerException; + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + List getMeanings(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the elements linked via a "SemanticAssignment" relationship to the requested glossary term. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param glossaryTermGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + List getSemanticAssignees(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryTermGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + /** * Link a governance definition to an element using the GovernedBy relationship. @@ -602,14 +933,76 @@ void addGovernanceDefinitionToElement(String userId, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void removeGovernanceDefinitionFromElement(String userId, - String assetManagerGUID, - String assetManagerName, - String definitionGUID, - String elementGUID, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void removeGovernanceDefinitionFromElement(String userId, + String assetManagerGUID, + String assetManagerName, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the governance definitions linked via a "GovernedBy" relationship to the requested element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + List getGovernedByDefinitions(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the elements linked via a "GovernedBy" relationship to the requested governance definition. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param governanceDefinitionGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + List getGovernedElements(String userId, + String assetManagerGUID, + String assetManagerName, + String governanceDefinitionGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java index ba85505b271..fecf0592fb7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java @@ -690,6 +690,34 @@ List getNoteLogsByName(String userId, PropertyServerException; + /** + * Retrieve the list of note log metadata elements attached to the element. + * + * @param userId calling user + * @param elementGUID element to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of matching metadata elements + * + * @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) + */ + List getNoteLogsForElement(String userId, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Retrieve the note log metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/StewardshipManagementInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/StewardshipManagementInterface.java index 9ca82c4ee72..f3b20008349 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/StewardshipManagementInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/StewardshipManagementInterface.java @@ -2,6 +2,10 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetmanager.api.management; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceDefinitionElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.OwnerProperties; @@ -12,8 +16,10 @@ 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.ElementStub; import java.util.Date; +import java.util.List; /** @@ -71,6 +77,30 @@ void clearConfidenceClassification(String userId, PropertyServerException; + /** + * Return information about the elements classified with the confidence classification. + * + * @param userId calling user + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getConfidenceClassifiedElements(String userId, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify/reclassify the element (typically an asset) to indicate how critical the element (or associated resource) * is to the organization. The level of criticality is expressed by the levelIdentifier property. @@ -119,6 +149,30 @@ void clearCriticalityClassification(String userId, PropertyServerException; + /** + * Return information about the elements classified with the criticality classification. + * + * @param userId calling user + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getCriticalityClassifiedElements(String userId, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify/reclassify the element (typically a data field, schema attribute or glossary term) to indicate the level of confidentiality * that any data associated with the element should be given. If the classification is attached to a glossary term, the level @@ -169,6 +223,30 @@ void clearConfidentialityClassification(String userId, PropertyServerException; + /** + * Return information about the elements classified with the confidentiality classification. + * + * @param userId calling user + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getConfidentialityClassifiedElements(String userId, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify/reclassify the element (typically an asset) to indicate how long the element (or associated resource) * is to be retained by the organization. The policy to apply to the element/resource is captured by the retentionBasis @@ -218,6 +296,32 @@ void clearRetentionClassification(String userId, UserNotAuthorizedException, PropertyServerException; + + /** + * Return information about the elements classified with the retention classification. + * + * @param userId calling user + * @param returnSpecificBasisIdentifier should the results be filtered by basisIdentifier? + * @param basisIdentifier the identifier to filter by (if returnSpecificBasisIdentifier=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getRetentionClassifiedElements(String userId, + boolean returnSpecificBasisIdentifier, + int basisIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** * Add or replace the security tags for an element. * @@ -264,6 +368,26 @@ void clearSecurityTags(String userId, PropertyServerException; + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getSecurityTaggedElements(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Add or replace the ownership classification for an element. * @@ -310,6 +434,28 @@ void clearOwnership(String userId, PropertyServerException; + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param owner unique identifier for the owner + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getOwnersElements(String userId, + String owner, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Add or replace the origin classification for an asset. * @@ -356,6 +502,28 @@ void clearAssetOrigin(String userId, PropertyServerException; + /** + * Return information about the assets from a specific origin. + * + * @param userId calling user + * @param properties values to search on - null means any value + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of the assets + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getAssetsByOrigin(String userId, + AssetOriginProperties properties, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Classify the element to assert that it is part of a subject area definition. * @@ -402,6 +570,28 @@ void removeElementFromSubjectArea(String userId, PropertyServerException; + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param subjectAreaName unique identifier for the subject area + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getMembersOfSubjectArea(String userId, + String subjectAreaName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Create a semantic assignment relationship between a glossary term and an element (normally a schema attribute, data field or asset). * This relationship indicates that the data associated with the element meaning matches the description in the glossary term. @@ -453,6 +643,48 @@ void clearSemanticAssignment(String userId, PropertyServerException; + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + List getMeanings(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the elements linked via a "SemanticAssignment" relationship to the requested glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + List getSemanticAssignees(String userId, + String glossaryTermGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** * Link a governance definition to an element using the GovernedBy relationship. * @@ -499,4 +731,46 @@ void removeGovernanceDefinitionFromElement(String userId, boolean forDuplicateProcessing) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; + + + /** + * Retrieve the governance definitions linked via a "GovernedBy" relationship to the requested element. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + List getGovernedByDefinitions(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the elements linked via a "GovernedBy" relationship to the requested governance definition. + * + * @param userId calling user + * @param governanceDefinitionGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + List getGovernedElements(String userId, + String governanceDefinitionGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/AssetElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/AssetElement.java new file mode 100644 index 00000000000..7cca5b15b89 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/AssetElement.java @@ -0,0 +1,194 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetProperties; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AssetElement contains the properties and header for an asset retrieved from the metadata repository. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AssetElement implements MetadataElement, Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + private AssetProperties assetProperties = null; + private List correlationHeaders = null; + private ElementHeader elementHeader = null; + + + /** + * Default constructor + */ + public AssetElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssetElement(AssetElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + correlationHeaders = template.getCorrelationHeaders(); + assetProperties = template.getAssetProperties(); + } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + @Override + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + @Override + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the details of the external identifier and other correlation properties about the metadata source. + * There is one entry in the list for each element in the third party technology that maps to the single open source + * element. + * + * @return list of correlation properties objects + */ + @Override + public List getCorrelationHeaders() + { + if (correlationHeaders == null) + { + return null; + } + else if (correlationHeaders.isEmpty()) + { + return null; + } + + return correlationHeaders; + } + + + /** + * Set up the details of the external identifier and other correlation properties about the metadata source. + * There is one entry in the list for each element in the third party technology that maps to the single open source + * element. + * + * @param correlationHeaders list of correlation properties objects + */ + @Override + public void setCorrelationHeaders(List correlationHeaders) + { + this.correlationHeaders = correlationHeaders; + } + + + /** + * Return the properties for the asset. + * + * @return asset properties (using appropriate subclass) + */ + public AssetProperties getAssetProperties() + { + return assetProperties; + } + + + /** + * Set up the properties for the asset. + * + * @param assetProperties asset properties + */ + public void setAssetProperties(AssetProperties assetProperties) + { + this.assetProperties = assetProperties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "AssetElement{" + + "assetProperties=" + assetProperties + + ", correlationHeaders=" + correlationHeaders + + ", elementHeader=" + elementHeader + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + AssetElement that = (AssetElement) objectToCompare; + return Objects.equals(getAssetProperties(), that.getAssetProperties()) && + Objects.equals(getCorrelationHeaders(), that.getCorrelationHeaders()) && + Objects.equals(getElementHeader(), that.getElementHeader()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, correlationHeaders, assetProperties); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetOriginProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetOriginProperties.java index 8a25f3812be..6ff42f3c61b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetOriginProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetOriginProperties.java @@ -132,12 +132,6 @@ public void setOtherOriginValues(Map otherOriginValues) } - /** - * Equals method that returns true if containing properties are the same. - * - * @param objectToCompare object to compare - * @return boolean result of comparison - */ /** * JSON-style toString. * @@ -157,6 +151,29 @@ public String toString() } + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (! (objectToCompare instanceof AssetOriginProperties that)) + { + return false; + } + return Objects.equals(organizationGUID, that.organizationGUID) && + Objects.equals(businessCapabilityGUID, that.businessCapabilityGUID) && + Objects.equals(otherOriginValues, that.otherOriginValues); + } + + /** * Return hash code for this object * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFieldValuesProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFieldValuesProperties.java index a9338bdcfe7..4b39dfdb9e9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFieldValuesProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFieldValuesProperties.java @@ -28,8 +28,8 @@ public class DataFieldValuesProperties extends ClassificationProperties private String defaultValue = null; private List sampleValues = null; - private String dataPattern = null; - private String namePattern = null; + private List dataPattern = null; + private List namePattern = null; /** @@ -109,7 +109,7 @@ public void setSampleValues(List sampleValues) * * @return string */ - public String getDataPattern() + public List getDataPattern() { return dataPattern; } @@ -120,7 +120,7 @@ public String getDataPattern() * * @param dataPattern string */ - public void setDataPattern(String dataPattern) + public void setDataPattern(List dataPattern) { this.dataPattern = dataPattern; } @@ -131,7 +131,7 @@ public void setDataPattern(String dataPattern) * * @return string */ - public String getNamePattern() + public List getNamePattern() { return namePattern; } @@ -142,7 +142,7 @@ public String getNamePattern() * * @param namePattern string */ - public void setNamePattern(String namePattern) + public void setNamePattern(List namePattern) { this.namePattern = namePattern; } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FeedbackProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FeedbackProperties.java index 423d3bbbd1c..051c0f7e55d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FeedbackProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FeedbackProperties.java @@ -42,7 +42,9 @@ public FeedbackProperties() */ public FeedbackProperties(FeedbackProperties template) { - if (template != null) + super(template); + + if (template != null) { this.isPublic = template.getIsPublic(); } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindAssetOriginProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindAssetOriginProperties.java new file mode 100644 index 00000000000..1a4c390cd15 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindAssetOriginProperties.java @@ -0,0 +1,185 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serial; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AssetOriginProperties provides a structure for passing information about an asset's origin. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class FindAssetOriginProperties extends FindProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private String organizationGUID = null; + private String businessCapabilityGUID = null; + private Map otherOriginValues = null; + + + /** + * Default constructor + */ + public FindAssetOriginProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public FindAssetOriginProperties(FindAssetOriginProperties template) + { + if (template != null) + { + this.organizationGUID = template.getOrganizationGUID(); + this.businessCapabilityGUID = template.getBusinessCapabilityGUID(); + this.otherOriginValues = template.getOtherOriginValues(); + } + } + + + /** + * Return the unique identifier (GUID) of the organization where this asset originated from. + * + * @return unique identifier (GUID) + */ + public String getOrganizationGUID() + { + return organizationGUID; + } + + + /** + * Set up the unique identifier (GUID) of the organization where this asset originated from. + * + * @param organizationGUID unique identifier (GUID) + */ + public void setOrganizationGUID(String organizationGUID) + { + this.organizationGUID = organizationGUID; + } + + + /** + * Return the unique identifier (GUID) of the business capability where this asset originated from. + * + * @return unique identifier (GUID) + */ + public String getBusinessCapabilityGUID() + { + return businessCapabilityGUID; + } + + + /** + * Set up the unique identifier (GUID) of the business capability where this asset originated from. + * + * @param businessCapabilityGUID unique identifier (GUID) + */ + public void setBusinessCapabilityGUID(String businessCapabilityGUID) + { + this.businessCapabilityGUID = businessCapabilityGUID; + } + + + /** + * Return any other descriptive labels describing origin of the asset. + * + * @return map of property values + */ + public Map getOtherOriginValues() + { + if (otherOriginValues == null) + { + return null; + } + else if (otherOriginValues.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(otherOriginValues); + } + } + + + /** + * Set up any descriptive labels describing origin of the asset. + * + * @param otherOriginValues map of property values + */ + public void setOtherOriginValues(Map otherOriginValues) + { + this.otherOriginValues = otherOriginValues; + } + + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "FindAssetOriginProperties{" + + "organizationGUID='" + organizationGUID + '\'' + + ", businessCapabilityGUID='" + businessCapabilityGUID + '\'' + + ", otherOriginValues=" + otherOriginValues + + '}'; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (! (objectToCompare instanceof FindAssetOriginProperties that)) + { + return false; + } + return Objects.equals(organizationGUID, that.organizationGUID) && + Objects.equals(businessCapabilityGUID, that.businessCapabilityGUID) && + Objects.equals(otherOriginValues, that.otherOriginValues); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), getOrganizationGUID(), getBusinessCapabilityGUID(), getOtherOriginValues()); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindNameProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindNameProperties.java new file mode 100644 index 00000000000..fbd77e59851 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindNameProperties.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serial; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * FindNameProperties is the request body structure used on OMAG REST API calls that passes a name that is used to retrieve + * an element by name. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class FindNameProperties extends FindProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private String name = null; + + + /** + * Default constructor + */ + public FindNameProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public FindNameProperties(FindNameProperties template) + { + super(template); + + if (template != null) + { + name = template.getName(); + } + } + + + /** + * Return the name for the query request. + * + * @return string name + */ + public String getName() + { + return name; + } + + + /** + * Set up the name for the query request. + * + * @param name string + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "FindNameProperties{" + + "name='" + name + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + FindNameProperties that = (FindNameProperties) objectToCompare; + return Objects.equals(name, that.name); + } + + + /** + * Create a hash code for this element type. + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), name); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindProperties.java new file mode 100644 index 00000000000..4343469592a --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FindProperties.java @@ -0,0 +1,70 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ActivityDescriptionProperties; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * FindProperties provides the base class for find by property requests. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "class") +@JsonSubTypes( + { + @JsonSubTypes.Type(value = LevelIdentifierProperties.class, name = "LevelIdentifierProperties"), + }) +public class FindProperties implements Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + /** + * Default constructor + */ + public FindProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public FindProperties(FindProperties template) + { + + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "FindProperties{}"; + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LevelIdentifierProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LevelIdentifierProperties.java new file mode 100644 index 00000000000..9039a32e8b0 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LevelIdentifierProperties.java @@ -0,0 +1,111 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serial; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * LevelIdentifierProperties describes the properties for searching for a governance action classification by its level. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class LevelIdentifierProperties extends FindProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private boolean returnSpecificLevel = false; + private int levelIdentifier = 0; + + + /** + * Default constructor + */ + public LevelIdentifierProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public LevelIdentifierProperties(LevelIdentifierProperties template) + { + super(template); + + if (template != null) + { + this.returnSpecificLevel = template.getReturnSpecificLevel(); + this.levelIdentifier = template.getLevelIdentifier(); + } + } + + + /** + * Return whether the level identifier is in use + * + * @return boolean + */ + public boolean getReturnSpecificLevel() + { + return returnSpecificLevel; + } + + + /** + * Set up whether the level identifier is in use. + * + * @param flag boolean + */ + public void setReturnSpecificLevel(boolean flag) + { + returnSpecificLevel = flag; + } + + + /** + * Return the level to match on. + * + * @return int + */ + public int getLevelIdentifier() + { + return levelIdentifier; + } + + + /** + * Set up the level to match on. + * + * @param levelIdentifier int + */ + public void setLevelIdentifier(int levelIdentifier) + { + this.levelIdentifier = levelIdentifier; + } + + + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "LevelIdentifierProperties{" + + "returnSpecificLevel=" + returnSpecificLevel + + ", levelIdentifier=" + levelIdentifier + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OwnerProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OwnerProperties.java index 7ee73c64eb2..aba9ecf0b77 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OwnerProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OwnerProperties.java @@ -20,7 +20,6 @@ public class OwnerProperties extends ClassificationProperties private String ownerPropertyName = null; - /** * Default constructor */ diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetElementsResponse.java new file mode 100644 index 00000000000..78f0e0a4df6 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetElementsResponse.java @@ -0,0 +1,151 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement; + +import java.io.Serial; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * DataAssetElementsResponse is a response object for passing back a a list of assets + * or an exception if the request failed. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AssetElementsResponse extends AssetManagerOMASAPIResponse +{ + @Serial + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public AssetElementsResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssetElementsResponse(AssetElementsResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(elementList); + } + } + + + /** + * Set up the metadata element to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "AssetElementsResponse{" + + "elementList=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + AssetElementsResponse that = (AssetElementsResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionResponse.java index 85723b28e6c..7f3d807cb88 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectionElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectionResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ConnectionElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionsResponse.java index 334536d57c4..58ff39ecee2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectionsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectionElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectionsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeRequestBody.java index 72367bacd23..942457d1ae3 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.ConnectorTypeProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectorTypeRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ConnectorTypeProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeResponse.java index 01aa8a833a1..ae650f8ec53 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypeResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectorTypeElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectorTypeResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ConnectorTypeElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypesResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypesResponse.java index 6344644108f..c1e01aaa098 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypesResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ConnectorTypesResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectorTypeElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectorTypesResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementResponse.java index cb69052a665..78faa585cd9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ControlFlowElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ControlFlowElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ControlFlowElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowRequestBody.java index 70523ca561d..a9eea223ba7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.ControlFlowProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ControlFlowRequestBody extends AssetManagerIdentifiersRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ControlFlowProperties properties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementResponse.java index 3aad4eb4d30..9bd3dc30455 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataAssetElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataAssetElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private DataAssetElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementsResponse.java index 9f69e1e368c..04055f9bc84 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataAssetElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataAssetElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetRequestBody.java index 04cc1ca2d9f..b22f31b7760 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataAssetRequestBody.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.DataAssetProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataAssetRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private DataAssetProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementResponse.java index da6211eb501..7da3457bd71 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataFlowElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataFlowElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private DataFlowElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementsResponse.java index 25bde7df1de..b67eb210842 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataFlowElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataFlowElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowRequestBody.java index bfcd6e9623f..130e2b9678b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/DataFlowRequestBody.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.DataFlowProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataFlowRequestBody extends AssetManagerIdentifiersRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private DataFlowProperties properties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeaderResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeaderResponse.java index d5a29cf849e..6575899814d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeaderResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeaderResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ElementHeaderResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ElementHeader element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeadersResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeadersResponse.java index fda2fc64f4c..ad9f0ee6c49 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeadersResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementHeadersResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -17,7 +18,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * ElementHeadersResponse is a response object for passing back a a list of element headers + * ElementHeadersResponse is a response object for passing back a list of element headers * or an exception if the request failed. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ElementHeadersResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementStubsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementStubsResponse.java new file mode 100644 index 00000000000..9645aa11f29 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ElementStubsResponse.java @@ -0,0 +1,152 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; + +import java.io.Serial; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ElementStubsResponse is a response object for passing back a list of element stubs + * or an exception if the request failed. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ElementStubsResponse extends AssetManagerOMASAPIResponse +{ + @Serial + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public ElementStubsResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ElementStubsResponse(ElementStubsResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return new ArrayList<>(elementList); + } + } + + + /** + * Set up the metadata element to return. + * + * @param elementList result object + */ + public void setElementList(List elementList) + { + this.elementList = elementList; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ElementStubsResponse{" + + "elementList=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ElementStubsResponse that = (ElementStubsResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointRequestBody.java index ffe38b81ad1..b77513ac406 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointRequestBody.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.EndpointProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class EndpointRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private EndpointProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointResponse.java index 22dc81b5186..3126806c043 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.EndpointElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class EndpointResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private EndpointElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointsResponse.java index ace722bab1c..705bd8fd34e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/EndpointsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.EndpointElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class EndpointsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryElementLinkRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryElementLinkRequestBody.java index b088898333d..4d008986ae9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryElementLinkRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryElementLinkRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryElementLinkProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalGlossaryElementLinkRequestBody extends AssetManagerIdentifiersRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ExternalGlossaryElementLinkProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkElementsResponse.java index 95da8435fe3..73ac2b51ca8 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkElementsResponse.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalGlossaryLinkElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -26,7 +27,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalGlossaryLinkElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkRequestBody.java index 83392e69a77..7094b3a9aa3 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalGlossaryLinkRequestBody.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryLinkProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalGlossaryLinkRequestBody extends EffectiveTimeQueryRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ExternalGlossaryLinkProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementResponse.java index 1c1db2f07ac..fa029bd1480 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ExternalReferenceElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementsResponse.java index 74e00b5b4ca..3e366dab27c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementResponse.java index af005bcca4d..7b98677d11e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceLinkElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceLinkElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ExternalReferenceLinkElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementsResponse.java index 6cbe51105c0..9b29da5f494 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceLinkElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceLinkElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkRequestBody.java index 22a0207f0f9..bf144a9724b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceLinkRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalReferenceLinkProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceLinkRequestBody extends EffectiveTimeQueryRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ExternalReferenceLinkProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceRequestBody.java index e4c5ef7e8bf..e50cde44e2e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ExternalReferenceRequestBody.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalReferenceProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ExternalReferenceProperties elementProperties = null; private String anchorGUID = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/FindByPropertiesRequestBody.java similarity index 54% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryRequestBody.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/FindByPropertiesRequestBody.java index b5d8caa7d8e..1be0f7b0bb7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/FindByPropertiesRequestBody.java @@ -2,11 +2,10 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetmanager.rest; - import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryCategoryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FindProperties; import java.io.Serial; import java.util.Objects; @@ -16,87 +15,89 @@ /** - * GlossaryCategoryRequestBody describes the request body used to create/update glossary category properties. + * FindByPropertiesRequestBody is the request body structure used on OMAG REST API calls that passes a name that is used to retrieve + * an element by name. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class GlossaryCategoryRequestBody extends UpdateRequestBody +public class FindByPropertiesRequestBody extends EffectiveTimeQueryRequestBody { @Serial private static final long serialVersionUID = 1L; - private GlossaryCategoryProperties elementProperties = null; + private FindProperties properties = null; /** * Default constructor */ - public GlossaryCategoryRequestBody() + public FindByPropertiesRequestBody() { super(); } /** - * Copy/clone constructor. + * Copy/clone constructor * * @param template object to copy */ - public GlossaryCategoryRequestBody(GlossaryCategoryRequestBody template) + public FindByPropertiesRequestBody(FindByPropertiesRequestBody template) { super(template); if (template != null) { - elementProperties = template.getElementProperties(); + properties = template.getProperties(); } } /** - * Return the properties for the element. + * Return the name for the query request. * - * @return properties object + * @return string name */ - public GlossaryCategoryProperties getElementProperties() + public FindProperties getProperties() { - return elementProperties; + return properties; } /** - * Set up the properties for the element. + * Set up the name for the query request. * - * @param elementProperties properties object + * @param properties string */ - public void setElementProperties(GlossaryCategoryProperties elementProperties) + public void setProperties(FindProperties properties) { - this.elementProperties = elementProperties; + this.properties = properties; } /** - * JSON-style toString + * Standard toString method. * - * @return return string containing the property names and values + * @return print out of variables in a JSON-style */ @Override public String toString() { - return "GlossaryCategoryRequestBody{" + - "elementProperties=" + elementProperties + - ", metadataCorrelationProperties=" + getMetadataCorrelationProperties() + + return "FindByPropertiesRequestBody{" + + "properties=" + properties + ", effectiveTime=" + getEffectiveTime() + + ", assetManagerGUID='" + getAssetManagerGUID() + '\'' + + ", assetManagerName='" + getAssetManagerName() + '\'' + '}'; } /** - * Return comparison result based on the content of the properties. + * Compare the values of the supplied object with those stored in the current object. * - * @param objectToCompare test object - * @return result of comparison + * @param objectToCompare supplied object + * @return boolean result of comparison */ @Override public boolean equals(Object objectToCompare) @@ -113,19 +114,19 @@ public boolean equals(Object objectToCompare) { return false; } - GlossaryCategoryRequestBody that = (GlossaryCategoryRequestBody) objectToCompare; - return Objects.equals(elementProperties, that.elementProperties); + FindByPropertiesRequestBody that = (FindByPropertiesRequestBody) objectToCompare; + return Objects.equals(properties, that.properties); } /** - * Return hash code for this object + * Create a hash code for this element type. * * @return int hash code */ @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementProperties); + return Objects.hash(super.hashCode(), properties); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ForeignKeyRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ForeignKeyRequestBody.java index f366182e607..0bcf53f382b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ForeignKeyRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ForeignKeyRequestBody.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.ForeignKeyProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ForeignKeyRequestBody extends EffectiveTimeQueryRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ForeignKeyProperties properties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementResponse.java index 4710d679a2c..094051c97ea 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GlossaryCategoryElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GlossaryCategoryElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementsResponse.java index c7bd385e9de..383a3d08112 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryCategoryElementsResponse.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -26,7 +27,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GlossaryCategoryElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryElementResponse.java index a11e1b4e45f..f7dfc1b4ab0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GlossaryElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GlossaryElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryRequestBody.java deleted file mode 100644 index b22e7941847..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryRequestBody.java +++ /dev/null @@ -1,151 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.rest; - - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; - -import java.io.Serial; -import java.io.Serializable; -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - - -/** - * GlossaryRequestBody describes the request body used to create/update glossary properties. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class GlossaryRequestBody implements Serializable -{ - @Serial - private static final long serialVersionUID = 1L; - - private MetadataCorrelationProperties metadataCorrelationProperties = null; - private GlossaryProperties elementProperties = null; - - - /** - * Default constructor - */ - public GlossaryRequestBody() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public GlossaryRequestBody(GlossaryRequestBody template) - { - if (template != null) - { - metadataCorrelationProperties = template.getMetadataCorrelationProperties(); - elementProperties = template.getElementProperties(); - } - } - - - /** - * Return the properties used to correlate the external metadata element with the open metadata element. - * - * @return properties object - */ - public MetadataCorrelationProperties getMetadataCorrelationProperties() - { - return metadataCorrelationProperties; - } - - - /** - * Set up the properties used to correlate the external metadata element with the open metadata element. - * - * @param metadataCorrelationProperties properties object - */ - public void setMetadataCorrelationProperties(MetadataCorrelationProperties metadataCorrelationProperties) - { - this.metadataCorrelationProperties = metadataCorrelationProperties; - } - - - /** - * Return the properties for the element. - * - * @return properties object - */ - public GlossaryProperties getElementProperties() - { - return elementProperties; - } - - - /** - * Set up the properties for the element. - * - * @param elementProperties properties object - */ - public void setElementProperties(GlossaryProperties elementProperties) - { - this.elementProperties = elementProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "GlossaryRequestBody{" + - "metadataCorrelationProperties=" + metadataCorrelationProperties + - ", elementProperties=" + elementProperties + - '}'; - } - - - /** - * Return comparison result based on the content of the properties. - * - * @param objectToCompare test object - * @return result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - GlossaryRequestBody that = (GlossaryRequestBody) objectToCompare; - return Objects.equals(getMetadataCorrelationProperties(), that.getMetadataCorrelationProperties()) && - Objects.equals(getElementProperties(), that.getElementProperties()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), metadataCorrelationProperties, elementProperties); - } -} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermElementResponse.java index fb66819ead3..c1a115cfb90 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GlossaryTermElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GlossaryTermElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementResponse.java index 54a43041537..e49a0939ffd 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GovernanceActionElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementsResponse.java index 9c6a3a05752..7aa05ec6dd6 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elements = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementResponse.java index 55d299867ec..72914552a9e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionProcessElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionProcessElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GovernanceActionProcessElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementsResponse.java index e339a2ff515..61ac32c9850 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionProcessElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionProcessElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionProcessElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elements = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementResponse.java index 88fee4e0418..e34db4dae77 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionTypeElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionTypeElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GovernanceActionTypeElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementsResponse.java index 90325c708a6..011bb0a6114 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GovernanceActionTypeElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionTypeElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionTypeElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elements = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/InformalTagResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/InformalTagResponse.java index 7d5a54ee167..1dea2cde328 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/InformalTagResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/InformalTagResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class InformalTagResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private InformalTagElement tag = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementResponse.java index c815ebeb99a..f990eec5a84 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.LineageMappingElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class LineageMappingElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private LineageMappingElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementsResponse.java index 0de617746db..f813ebc96f3 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/LineageMappingElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.LineageMappingElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class LineageMappingElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/NextGovernanceActionTypeElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/NextGovernanceActionTypeElementsResponse.java index dd4478a5e67..406c7338071 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/NextGovernanceActionTypeElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/NextGovernanceActionTypeElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NextGovernanceActionTypeElement; +import java.io.Serial; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class NextGovernanceActionTypeElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elements = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementResponse.java index 1b518abe438..25d0d443d74 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.PortElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class PortElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private PortElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementsResponse.java index ab4eb3d7b67..224d99ff8b1 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.PortElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class PortElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortRequestBody.java index e672b25c6c4..c61b165f504 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PortRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.PortProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class PortRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private PortProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PrimaryKeyClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PrimaryKeyClassificationRequestBody.java index df5e178c1f7..177c752a19c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PrimaryKeyClassificationRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/PrimaryKeyClassificationRequestBody.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.PrimaryKeyProperties; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class PrimaryKeyClassificationRequestBody extends EffectiveTimeQueryRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private PrimaryKeyProperties primaryKeyProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementResponse.java index bc145116eb5..5ec8a60242f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ProcessCallElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessCallElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ProcessCallElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementsResponse.java index 1a58cdd4d8d..bab965eafea 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ProcessCallElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessCallElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallRequestBody.java index f4309c1638f..3f88047ab6f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessCallRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.ProcessCallProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessCallRequestBody extends AssetManagerIdentifiersRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ProcessCallProperties properties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementResponse.java index b0be77435d0..dd7e46067b4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ProcessElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ProcessElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementsResponse.java index ec6ef942bba..5cc7003ba09 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ProcessElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessRequestBody.java index ccec2456204..eb996047052 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessRequestBody.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.ProcessProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ProcessStatus; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ProcessStatus processStatus = null; private ProcessProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessStatusRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessStatusRequestBody.java index 04e7002a9df..261528bae94 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessStatusRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ProcessStatusRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.ProcessStatus; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -22,6 +23,7 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessStatusRequestBody extends UpdateRequestBody { + @Serial private static final long serialVersionUID = 1L; private ProcessStatus processStatus = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementResponse.java index 78f69861f4f..586844715b7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelationshipElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class RelationshipElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private RelationshipElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementsResponse.java index 23b12ceeed4..55645461057 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipElementsResponse.java @@ -9,6 +9,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataFlowElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelationshipElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -26,7 +27,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class RelationshipElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementResponse.java index c16ba59ffc8..1539cede41f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaAttributeElement; +import java.io.Serial; import java.util.Arrays; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class SchemaAttributeElementResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private SchemaAttributeElement element = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementsResponse.java index 9be7e84a696..2d1b4dc1e11 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeElementsResponse.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaAttributeElement; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class SchemaAttributeElementsResponse extends AssetManagerOMASAPIResponse { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List elementList = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeRequestBody.java index 982b34dc155..d68c1d236da 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaAttributeRequestBody.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.SchemaAttributeProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class SchemaAttributeRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private SchemaAttributeProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaTypeRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaTypeRequestBody.java index 5e9cb0cf7ea..7851a3472ff 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaTypeRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/SchemaTypeRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.SchemaTypeProperties; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class SchemaTypeRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private SchemaTypeProperties elementProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java index e27b7a29290..694283b5c7c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java @@ -7,6 +7,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.ClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FindProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationshipStatus; import org.odpi.openmetadata.accessservices.assetmanager.properties.KeyPattern; import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; @@ -16,6 +17,8 @@ import org.odpi.openmetadata.accessservices.assetmanager.rest.AssetManagerIdentifiersRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.ClassificationRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.EffectiveTimeQueryRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ElementStubsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.FindByPropertiesRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossaryTermRelationshipRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.NameRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableRequestBody; @@ -32,6 +35,7 @@ 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.ElementStub; import java.util.Date; import java.util.List; @@ -1095,13 +1099,11 @@ protected String createFeedbackWithParent(String userId, UserNotAuthorizedException, PropertyServerException { - final String qualifiedNameParameterName = "qualifiedName"; - final String requestParamsURLTemplate = "?assetManagerIsHome={3}&isPublic={4}&forLineage={5}&forDuplicateProcessing={6}"; + final String requestParamsURLTemplate = "?assetManagerIsHome={3}&isPublic={4}&forLineage={5}&forDuplicateProcessing={6}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentGUID, parentGUIDParameterName, methodName); invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); ReferenceableUpdateRequestBody requestBody = new ReferenceableUpdateRequestBody(); @@ -1678,6 +1680,7 @@ protected List getRelatedElements(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); RelatedElementsResponse restResult = restClient.callRelatedElementsPostRESTCall(methodName, urlTemplate + requestParamsURLTemplate, @@ -1688,7 +1691,7 @@ protected List getRelatedElements(String userId, userId, startingElementGUID, startFrom, - pageSize, + validatedPageSize, forLineage, forDuplicateProcessing); @@ -1696,6 +1699,66 @@ protected List getRelatedElements(String userId, } + /** + * Retrieve a collection of classified elements. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param properties values to search on + * @param urlTemplate URL to call (no expected placeholders) + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param methodName calling method + * + * @return list of related elements + * @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) + */ + protected List getClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + FindProperties properties, + String urlTemplate, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + FindByPropertiesRequestBody requestBody = new FindByPropertiesRequestBody(); + + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setEffectiveTime(effectiveTime); + requestBody.setProperties(properties); + + ElementStubsResponse restResult = restClient.callElementStubsPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + /** * Remove the metadata element. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java index c775f43197b..ca93f761eb3 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java @@ -20,6 +20,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.EffectiveTimeQueryRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagsResponse; @@ -1267,6 +1268,9 @@ public String createNoteLog(String userId, final String methodName = "createNoteLog"; final String guidParameterName = "elementGUID"; final String propertiesParameterName = "noteLogProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateName(noteLogProperties.getQualifiedName(), qualifiedNameParameterName, methodName); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/note-logs"; @@ -1519,6 +1523,67 @@ public List getNoteLogsByName(String userId, } + /** + * Retrieve the list of note log metadata elements attached to the element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique elementGUID of software capability representing the caller + * @param elementGUID element to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of matching metadata elements + * + * @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) + */ + @Override + public List getNoteLogsForElement(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNoteLogsForElement"; + final String guidParameterName = "elementGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + EffectiveTimeQueryRequestBody requestBody = new EffectiveTimeQueryRequestBody(); + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setEffectiveTime(effectiveTime); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/note-logs/retrieve?startFrom={3}&pageSize={4}&forLineage={5}&forDuplicateProcessing={6}"; + + NoteLogElementsResponse restResult = restClient.callNoteLogElementsPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + /** * Retrieve the note log metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/StewardshipExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/StewardshipExchangeClient.java index 8d3c5503b00..3f1639bc818 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/StewardshipExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/StewardshipExchangeClient.java @@ -5,19 +5,31 @@ import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.StewardshipExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceDefinitionElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FindAssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FindNameProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LevelIdentifierProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.OwnerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RetentionClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SecurityTagsProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SemanticAssignmentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SubjectAreaMemberProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.AssetElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.FindByPropertiesRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossaryTermElementsResponse; 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.ElementStub; import java.util.Date; +import java.util.List; /** @@ -222,6 +234,62 @@ public void clearConfidenceClassification(String userId, } + /** + * Return information about the elements classified with the confidence classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getConfidenceClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getConfidenceClassifiedElements"; + + LevelIdentifierProperties properties = new LevelIdentifierProperties(); + properties.setLevelIdentifier(levelIdentifier); + properties.setReturnSpecificLevel(returnSpecificLevel); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-confidence"; + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + properties, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + /** * Classify/reclassify the element (typically an asset) to indicate how critical the element (or associated resource) * is to the organization. The level of criticality is expressed by the levelIdentifier property. @@ -321,6 +389,62 @@ public void clearCriticalityClassification(String userId, } + /** + * Return information about the elements classified with the criticality classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getCriticalityClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getCriticalityClassifiedElements"; + + LevelIdentifierProperties properties = new LevelIdentifierProperties(); + properties.setLevelIdentifier(levelIdentifier); + properties.setReturnSpecificLevel(returnSpecificLevel); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-criticality"; + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + properties, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + /** * Classify/reclassify the element (typically a data field, schema attribute or glossary term) to indicate the level of confidentiality * that any data associated with the element should be given. If the classification is attached to a glossary term, the level @@ -422,6 +546,62 @@ public void clearConfidentialityClassification(String userId, } + /** + * Return information about the elements classified with the confidentiality classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getConfidentialityClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getConfidentialityClassifiedElements"; + + LevelIdentifierProperties properties = new LevelIdentifierProperties(); + properties.setLevelIdentifier(levelIdentifier); + properties.setReturnSpecificLevel(returnSpecificLevel); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-confidentiality"; + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + properties, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + /** * Classify/reclassify the element (typically an asset) to indicate how long the element (or associated resource) * is to be retained by the organization. The policy to apply to the element/resource is captured by the retentionBasis @@ -523,6 +703,63 @@ public void clearRetentionClassification(String userId, } + /** + * Return information about the elements classified with the retention classification. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param returnSpecificBasisIdentifier should the results be filtered by basisIdentifier? + * @param basisIdentifier the identifier to filter by (if returnSpecificBasisIdentifier=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getRetentionClassifiedElements(String userId, + String assetManagerGUID, + String assetManagerName, + boolean returnSpecificBasisIdentifier, + int basisIdentifier, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getRetentionClassifiedElements"; + + LevelIdentifierProperties properties = new LevelIdentifierProperties(); + properties.setLevelIdentifier(basisIdentifier); + properties.setReturnSpecificLevel(returnSpecificBasisIdentifier); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-confidentiality"; + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + properties, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** * Add or replace the security tags for an element. * @@ -620,6 +857,54 @@ public void clearSecurityTags(String userId, } + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getSecurityTaggedElements(String userId, + String assetManagerGUID, + String assetManagerName, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getSecurityTaggedElements"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-security-tags"; + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + null, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + /** * Add or replace the ownership classification for an element. * @@ -717,6 +1002,60 @@ public void clearOwnership(String userId, } + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param owner unique identifier for the owner + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getOwnersElements(String userId, + String assetManagerGUID, + String assetManagerName, + String owner, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getOwnersElements"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-ownership"; + + FindNameProperties properties = new FindNameProperties(); + + properties.setName(owner); + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + properties, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + /** * Add or replace the origin classification for an asset. * @@ -813,6 +1152,72 @@ public void clearAssetOrigin(String userId, } + /** + * Return information about the assets from a specific origin. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param properties values to search on - null means any value + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of the assets + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getAssetsByOrigin(String userId, + String assetManagerGUID, + String assetManagerName, + AssetOriginProperties properties, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getAssetsByOrigin"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/assets/by-origin"; + final String requestParamsURLTemplate = "?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + invalidParameterHandler.validateUserId(userId, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + FindAssetOriginProperties findProperties = new FindAssetOriginProperties(); + + findProperties.setOrganizationGUID(properties.getOrganizationGUID()); + findProperties.setBusinessCapabilityGUID(properties.getBusinessCapabilityGUID()); + findProperties.setOtherOriginValues(properties.getOtherOriginValues()); + + FindByPropertiesRequestBody requestBody = new FindByPropertiesRequestBody(); + + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setEffectiveTime(effectiveTime); + requestBody.setProperties(findProperties); + + AssetElementsResponse restResult = restClient.callAssetsPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + /** * Classify the element to assert that the definitions it represents are part of a subject area definition. * @@ -910,6 +1315,60 @@ public void removeElementFromSubjectArea(String userId, } + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param subjectAreaName unique identifier for the subject area + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getMembersOfSubjectArea(String userId, + String assetManagerGUID, + String assetManagerName, + String subjectAreaName, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getMembersOfSubjectArea"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-subject-area-membership"; + + FindNameProperties properties = new FindNameProperties(); + + properties.setName(subjectAreaName); + + return super.getClassifiedElements(userId, + assetManagerGUID, + assetManagerName, + properties, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + /** * Create a semantic assignment relationship between a glossary term and an element (normally a schema attribute, data field or asset). * This relationship indicates that the data associated with the element meaning matches the description in the glossary term. @@ -1011,6 +1470,113 @@ public void clearSemanticAssignment(String userId, } + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + @Override + public List getMeanings(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getMeanings"; + final String elementGUIDParameterName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/by-semantic-assignment/{2}?startFrom={3}&pageSize={4}&forLineage={5}&forDuplicateProcessing={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + GlossaryTermElementsResponse restResult = restClient.callGlossaryTermsPostRESTCall(methodName, + urlTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), + serverName, + userId, + elementGUID, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the elements linked via a "SemanticAssignment" relationship to the requested glossary term. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param glossaryTermGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + @Override + public List getSemanticAssignees(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryTermGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getSemanticAssignees"; + final String elementGUIDParameterName = "glossaryTermGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-semantic-assignment/{2}"; + + return super.getRelatedElements(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + elementGUIDParameterName, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** * Link a governance definition to an element using the GovernedBy relationship. * @@ -1108,4 +1674,90 @@ public void removeGovernanceDefinitionFromElement(String userId, forDuplicateProcessing, methodName); } + + + /** + * Retrieve the governance definitions linked via a "GovernedBy" relationship to the requested element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + @Override + public List getGovernedByDefinitions(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return null; + } + + + /** + * Retrieve the elements linked via a "GovernedBy" relationship to the requested governance definition. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param governanceDefinitionGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of related elements + * @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) + */ + @Override + public List getGovernedElements(String userId, + String assetManagerGUID, + String assetManagerName, + String governanceDefinitionGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getGovernedElements"; + final String elementGUIDParameterName = "governanceDefinitionGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/governed-by/{2}"; + + return super.getRelatedElements(userId, + assetManagerGUID, + assetManagerName, + governanceDefinitionGUID, + elementGUIDParameterName, + urlTemplate, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java index 7f0ad498ab8..427a53cbaa4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java @@ -923,6 +923,39 @@ public List getNoteLogsByName(String userId, } + /** + * Retrieve the list of note log metadata elements attached to the element. + * + * @param userId calling user + * @param elementGUID element to start from + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @return list of matching metadata elements + * + * @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) + */ + @Override + public List getNoteLogsForElement(String userId, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getNoteLogsForElement(userId, null, null, elementGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** * Retrieve the note log metadata element with the supplied unique identifier. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/StewardshipManagementClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/StewardshipManagementClient.java index 2c8d0073e74..e03449d7c20 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/StewardshipManagementClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/StewardshipManagementClient.java @@ -6,6 +6,10 @@ import org.odpi.openmetadata.accessservices.assetmanager.api.management.StewardshipManagementInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.StewardshipExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceDefinitionElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.OwnerProperties; @@ -17,8 +21,10 @@ 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.ElementStub; import java.util.Date; +import java.util.List; /** @@ -28,7 +34,7 @@ public class StewardshipManagementClient implements StewardshipManagementInterface { private final StewardshipExchangeClient client; - + /** * Create a new client with no authentication embedded in the HTTP request. * @@ -182,6 +188,44 @@ public void clearConfidenceClassification(String userId, } + /** + * Return information about the elements classified with the confidence classification. + * + * @param userId calling user + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getConfidenceClassifiedElements(String userId, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getConfidenceClassifiedElements(userId, + null, + null, + returnSpecificLevel, + levelIdentifier, + startFrom, + pageSize, + null, + false, + false); + } + + + /** * Classify/reclassify the element (typically an asset) to indicate how critical the element (or associated resource) * is to the organization. The level of criticality is expressed by the levelIdentifier property. @@ -238,6 +282,45 @@ public void clearCriticalityClassification(String userId, } + + + /** + * Return information about the elements classified with the criticality classification. + * + * @param userId calling user + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getCriticalityClassifiedElements(String userId, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getCriticalityClassifiedElements(userId, + null, + null, + returnSpecificLevel, + levelIdentifier, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Classify/reclassify the element (typically a data field, schema attribute or glossary term) to indicate the level of confidentiality * that any data associated with the element should be given. If the classification is attached to a glossary term, the level @@ -296,6 +379,43 @@ public void clearConfidentialityClassification(String userId, } + /** + * Return information about the elements classified with the confidentiality classification. + * + * @param userId calling user + * @param returnSpecificLevel should the results be filtered by levelIdentifier? + * @param levelIdentifier the identifier to filter by (if returnSpecificLevel=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getConfidentialityClassifiedElements(String userId, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getConfidentialityClassifiedElements(userId, + null, + null, + returnSpecificLevel, + levelIdentifier, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Classify/reclassify the element (typically an asset) to indicate how long the element (or associated resource) * is to be retained by the organization. The policy to apply to the element/resource is captured by the retentionBasis @@ -354,6 +474,44 @@ public void clearRetentionClassification(String userId, } + + /** + * Return information about the elements classified with the retention classification. + * + * @param userId calling user + * @param returnSpecificBasisIdentifier should the results be filtered by basisIdentifier? + * @param basisIdentifier the identifier to filter by (if returnSpecificBasisIdentifier=true) + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getRetentionClassifiedElements(String userId, + boolean returnSpecificBasisIdentifier, + int basisIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getRetentionClassifiedElements(userId, + null, + null, + returnSpecificBasisIdentifier, + basisIdentifier, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Add or replace the security tags for an element. * @@ -408,6 +566,37 @@ public void clearSecurityTags(String userId, } + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getSecurityTaggedElements(String userId, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getSecurityTaggedElements(userId, + null, + null, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Add or replace the ownership classification for an element. * @@ -462,6 +651,40 @@ public void clearOwnership(String userId, } + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param owner unique identifier for the owner + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getOwnersElements(String userId, + String owner, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getOwnersElements(userId, + null, + null, + owner, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Add or replace the origin classification for an asset. * @@ -516,6 +739,41 @@ public void clearAssetOrigin(String userId, } + /** + * Return information about the assets from a specific origin. + * + * @param userId calling user + * @param properties values to search on - null means any value + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of the assets + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getAssetsByOrigin(String userId, + AssetOriginProperties properties, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + return client.getAssetsByOrigin(userId, + null, + null, + properties, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Classify the element to assert that the definitions it represents are part of a subject area definition. * @@ -570,6 +828,41 @@ public void removeElementFromSubjectArea(String userId, } + /** + * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param subjectAreaName unique identifier for the subject area + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of element stubs + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getMembersOfSubjectArea(String userId, + String subjectAreaName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + return client.getMembersOfSubjectArea(userId, + null, + null, + subjectAreaName, + startFrom, + pageSize, + null, + false, + false); + } + + /** * Create a semantic assignment relationship between a glossary term and an element (normally a schema attribute, data field or asset). * This relationship indicates that the data associated with the element meaning matches the description in the glossary term. @@ -628,6 +921,75 @@ public void clearSemanticAssignment(String userId, } + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + @Override + public List getMeanings(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + return client.getMeanings(userId, + null, + null, + elementGUID, + startFrom, + pageSize, + null, + false, + false); + } + + + /** + * Retrieve the elements linked via a "SemanticAssignment" relationship to the requested glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + @Override + public List getSemanticAssignees(String userId, + String glossaryTermGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + return client.getSemanticAssignees(userId, + null, + null, + glossaryTermGUID, + startFrom, + pageSize, + null, + false, + false); + } + + + /** * Link a governance definition to an element using the GovernedBy relationship. * @@ -682,4 +1044,72 @@ public void removeGovernanceDefinitionFromElement(String userId, { client.removeGovernanceDefinitionFromElement(userId, null, null, definitionGUID, elementGUID, effectiveTime, forLineage, forDuplicateProcessing); } + + + /** + * Retrieve the governance definitions linked via a "GovernedBy" relationship to the requested element. + * + * @param userId calling user + * @param elementGUID unique identifier of the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + @Override + public List getGovernedByDefinitions(String userId, + String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + return client.getGovernedByDefinitions(userId, + null, + null, + elementGUID, + startFrom, + pageSize, + null, + false, + false); + } + + + /** + * Retrieve the elements linked via a "GovernedBy" relationship to the requested governance definition. + * + * @param userId calling user + * @param governanceDefinitionGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of related elements + * @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) + */ + @Override + public List getGovernedElements(String userId, + String governanceDefinitionGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + return client.getGovernedElements(userId, + null, + null, + governanceDefinitionGUID, + startFrom, + pageSize, + null, + false, + false); + } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/rest/AssetManagerRESTClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/rest/AssetManagerRESTClient.java index ffbcbe2eac7..f899ad71c3b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/rest/AssetManagerRESTClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/rest/AssetManagerRESTClient.java @@ -90,6 +90,34 @@ public AssetManagerRESTClient(String serverName, + /** + * Issue a POST REST call that returns a ElementStubsResponse 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 requestBody object that passes additional 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. + */ + public ElementStubsResponse callElementStubsPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + ElementStubsResponse restResult = this.callPostRESTCall(methodName, ElementStubsResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a POST REST call that returns a RelatedElementsResponse object. * @@ -107,8 +135,8 @@ public RelatedElementsResponse callRelatedElementsPostRESTCall(String methodN String urlTemplate, Object requestBody, Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + UserNotAuthorizedException, + PropertyServerException { RelatedElementsResponse restResult = this.callPostRESTCall(methodName, RelatedElementsResponse.class, urlTemplate, requestBody, params); @@ -1102,6 +1130,34 @@ public DataAssetElementsResponse callDataAssetsPostRESTCall(String methodName } + /** + * Issue a POST REST call that returns a AssetsResponse 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 requestBody object that passes additional 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. + */ + public AssetElementsResponse callAssetsPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + AssetElementsResponse restResult = this.callPostRESTCall(methodName, AssetElementsResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a POST REST call that returns a PortElementResponse object. diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerOMASConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerOMASConverter.java index 6ae72b8c85e..97dca808ef7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerOMASConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetManagerOMASConverter.java @@ -2,10 +2,14 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetmanager.converters; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericConverter; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.*; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; import java.util.Map; @@ -38,6 +42,60 @@ public AssetManagerOMASConverter(OMRSRepositoryHelper repositoryHelper, * Methods to fill out headers and enums */ + /** + * Using the supplied instances, return a new instance of a relatedElement bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + public RelatedElement getRelatedElement(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + RelatedElement relatedElement = new RelatedElement(); + + relatedElement.setRelationshipHeader(this.getMetadataElementHeader(beanClass, relationship, null, methodName)); + + if (relationship != null) + { + InstanceProperties instanceProperties = new InstanceProperties(relationship.getProperties()); + + RelationshipProperties relationshipProperties = new RelationshipProperties(); + + relationshipProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); + relationshipProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); + relationshipProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); + + relatedElement.setRelationshipProperties(relationshipProperties); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.RELATIONSHIP_DEF, methodName); + } + + + if (entity != null) + { + ElementStub elementStub = this.getElementStub(beanClass, entity, methodName); + + relatedElement.setRelatedElement(elementStub); + } + else + { + handleMissingMetadataInstance(beanClass.getName(), TypeDefCategory.ENTITY_DEF, methodName); + } + + return relatedElement; + } + + + /** * Extract and delete the sortOrder property from the supplied instance properties. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RelatedElementConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RelatedElementConverter.java new file mode 100644 index 00000000000..7c6b9db11d2 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RelatedElementConverter.java @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.converters; + + +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + + +/** + * RelatedElementConverter generates a RelatedElement from a relationship and attached entity + */ +public class RelatedElementConverter extends AssetManagerOMASConverter +{ + /** + * Constructor + * + * @param repositoryHelper helper object to parse entity + * @param serviceName name of this component + * @param serverName local server name + */ + public RelatedElementConverter(OMRSRepositoryHelper repositoryHelper, + String serviceName, + String serverName) + { + super(repositoryHelper, serviceName, serverName); + } + + + + /** + * Using the supplied instances, return a new instance of the bean. This is used for beans that + * contain a combination of the properties from an entity and that of a connected relationship. + * + * @param beanClass name of the class to create + * @param entity entity containing the properties + * @param relationship relationship containing the properties + * @param methodName calling method + * @return bean populated with properties from the instances supplied + * @throws PropertyServerException there is a problem instantiating the bean + */ + @Override + @SuppressWarnings(value = "unchecked") + public B getNewBean(Class beanClass, + EntityDetail entity, + Relationship relationship, + String methodName) throws PropertyServerException + { + try + { + return (B)super.getRelatedElement(beanClass, entity, relationship, methodName); + } + catch (ClassCastException error) + { + super.handleInvalidBeanClass(beanClass.getName(), error, methodName); + } + + return null; + } + + +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java index 3620040f873..8b5e0ea901a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java @@ -168,12 +168,11 @@ public String createComment(String userId, PropertyServerException { final String propertiesParameterName = "commentProperties"; - final String qualifiedNameParameterName = "commentProperties.qualifiedName"; + final String commentText = "commentProperties.getText"; invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateObject(commentProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(commentProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + invalidParameterHandler.validateName(commentProperties.getCommentText(), commentText, methodName); int commentType = CommentType.STANDARD_COMMENT.getOpenTypeOrdinal(); diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java index ffb86091f9b..ae873e5338b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/GlossaryExchangeHandler.java @@ -4317,6 +4317,66 @@ public List getGlossaryTermHistory(String u } + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param userId calling user + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param glossaryTermGUID unique identifier of object to retrieve + * @param startFrom the starting element number of the historical versions to return. This is used when retrieving + * versions beyond the first page of results. Zero means start from the first element. + * @param pageSize the maximum number of result versions that can be returned on this request. Zero means unrestricted + * return results size. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * @return list of beans + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem removing the properties from the repositories. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public List getMeanings(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryTermGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "glossaryTermGUID"; + + List results = glossaryTermHandler.getMeanings(userId, + glossaryTermGUID, + guidParameterName, + OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + this.addCorrelationPropertiesToGlossaryTerms(userId, + assetManagerGUID, + assetManagerName, + results, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + return results; + } + + /* ========================================================================================= * Support for linkage to external glossary resources. These glossary resources are not * stored as metadata - they could be web pages, ontologies or some other format. diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java index 29f17e7dab4..caf2607cdaa 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerInstanceHandler.java @@ -18,6 +18,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; class AssetManagerInstanceHandler extends OMASServiceInstanceHandler { @@ -62,6 +63,96 @@ SoftwareCapabilityHandler getAssetManagerHandler(Stri } + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + AssetHandler getAssetHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + AssetManagerServicesInstance instance = (AssetManagerServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getAssetHandler(); + } + + return null; + } + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + ReferenceableHandler getElementStubHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + AssetManagerServicesInstance instance = (AssetManagerServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getElementStubHandler(); + } + + return null; + } + + + /** + * Retrieve the specific handler for the access service. + * + * @param userId calling user + * @param serverName name of the server tied to the request + * @param serviceOperationName name of the REST API call (typically the top-level methodName) + * @return handler for use by the requested instance + * @throws InvalidParameterException no available instance for the requested server + * @throws UserNotAuthorizedException user does not have access to the requested server + * @throws PropertyServerException error in the requested server + */ + ReferenceableHandler getRelatedElementHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + AssetManagerServicesInstance instance = (AssetManagerServicesInstance)super.getServerServiceInstance(userId, + serverName, + serviceOperationName); + + if (instance != null) + { + return instance.getRelatedElementHandler(); + } + + return null; + } + + /** * Retrieve the specific handler for the access service. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java index a4369ec9f66..32e816e7fa1 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerServicesInstance.java @@ -22,6 +22,7 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector; import java.util.List; @@ -34,6 +35,9 @@ public class AssetManagerServicesInstance extends OMASServiceInstance { private static final AccessServiceDescription myDescription = AccessServiceDescription.ASSET_MANAGER_OMAS; + private final ReferenceableHandler elementStubHandler; + private final ReferenceableHandler relatedElementHandler; + private final AssetHandler assetHandler; private final SoftwareCapabilityHandler assetManagerHandler; private final ExternalIdentifierHandler externalIdentifierHandler; private final ConnectionExchangeHandler connectionExchangeHandler; @@ -48,8 +52,8 @@ public class AssetManagerServicesInstance extends OMASServiceInstance private final InformalTagHandler informalTagHandler; private final LikeHandler likeHandler; private final RatingHandler ratingHandler; - private final CommentExchangeHandler commentHandler; - private final NoteLogExchangeHandler noteLogHandler; + private final CommentExchangeHandler commentHandler; + private final NoteLogExchangeHandler noteLogHandler; /** * Set up the local repository connector that will service the REST Calls. @@ -96,6 +100,48 @@ public AssetManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, } + this.elementStubHandler = new ReferenceableHandler<>(new ElementStubConverter<>(repositoryHelper, serviceName, serverName), + ElementStub.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.relatedElementHandler = new ReferenceableHandler<>(new RelatedElementConverter<>(repositoryHelper, serviceName, serverName), + RelatedElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + this.assetHandler = new AssetHandler<>(new AssetConverter<>(repositoryHelper, serviceName, serverName), + AssetElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + this.assetManagerHandler = new SoftwareCapabilityHandler<>(new AssetManagerConverter<>(repositoryHelper, serviceName, serverName), SoftwareCapabilityElement.class, serviceName, @@ -323,6 +369,54 @@ SoftwareCapabilityHandler getAssetManagerIntegratorHa } + /** + * Return the handler for managing assets. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + AssetHandler getAssetHandler() throws PropertyServerException + { + final String methodName = "getAssetHandler"; + + validateActiveRepository(methodName); + + return assetHandler; + } + + + /** + * Return the handler for managing arbitrary referenceable objects. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + ReferenceableHandler getElementStubHandler() throws PropertyServerException + { + final String methodName = "getElementStubHandler"; + + validateActiveRepository(methodName); + + return elementStubHandler; + } + + + /** + * Return the handler for managing arbitrary referenceable objects. + * + * @return handler object + * @throws PropertyServerException the instance has not been initialized successfully + */ + ReferenceableHandler getRelatedElementHandler() throws PropertyServerException + { + final String methodName = "getRelatedElementHandler"; + + validateActiveRepository(methodName); + + return relatedElementHandler; + } + + /** * Return the handler for managing external identifiers for third party metadata elements. * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/StewardshipExchangeRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/StewardshipExchangeRESTServices.java index 384172c0c76..672abda53da 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/StewardshipExchangeRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/StewardshipExchangeRESTServices.java @@ -4,24 +4,38 @@ package org.odpi.openmetadata.accessservices.assetmanager.server; import org.odpi.openmetadata.accessservices.assetmanager.handlers.DataAssetExchangeHandler; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.GlossaryExchangeHandler; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SoftwareCapabilityElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FindAssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FindNameProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LevelIdentifierProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.OwnerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RetentionClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SecurityTagsProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SemanticAssignmentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SubjectAreaMemberProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.AssetElementsResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.ClassificationRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.EffectiveTimeQueryRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ElementStubsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.FindByPropertiesRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossaryTermElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.RelatedElementsResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.RelationshipRequestBody; 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.VoidResponse; +import org.odpi.openmetadata.commonservices.generichandlers.AssetHandler; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.commonservices.generichandlers.ReferenceableHandler; import org.odpi.openmetadata.commonservices.generichandlers.SoftwareCapabilityHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; import org.slf4j.LoggerFactory; @@ -250,6 +264,99 @@ public VoidResponse clearConfidenceClassification(String serv } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getConfidenceClassifiedElements(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getConfidenceClassifiedElements"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof LevelIdentifierProperties properties) + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + properties.getReturnSpecificLevel(), + properties.getLevelIdentifier(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(LevelIdentifierProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Classify/reclassify the element (typically an asset) to indicate how critical the element (or associated resource) * is to the organization. The level of criticality is expressed by the levelIdentifier property. @@ -454,6 +561,99 @@ public VoidResponse clearCriticalityClassification(String ser } + /** + * Return information about the elements classified with the criticality classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getCriticalityClassifiedElements(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getCriticalityClassifiedElements"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof LevelIdentifierProperties properties) + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + properties.getReturnSpecificLevel(), + properties.getLevelIdentifier(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(LevelIdentifierProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Classify/reclassify the element (typically a data field, schema attribute or glossary term) to indicate the level of confidentiality * that any data associated with the element should be given. If the classification is attached to a glossary term, the level @@ -660,6 +860,99 @@ public VoidResponse clearConfidentialityClassification(String } + /** + * Return information about the elements classified with the confidentiality classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getConfidentialityClassifiedElements(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getConfidentialityClassifiedElements"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof LevelIdentifierProperties properties) + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + properties.getReturnSpecificLevel(), + properties.getLevelIdentifier(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(LevelIdentifierProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getGovernanceActionClassifiedElements(userId, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Classify/reclassify the element (typically an asset) to indicate how long the element (or associated resource) * is to be retained by the organization. The policy to apply to the element/resource is captured by the retentionBasis @@ -864,6 +1157,96 @@ public VoidResponse clearRetentionClassification(String serve } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getRetentionClassifiedElements(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getRetentionClassifiedElements"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof LevelIdentifierProperties properties) + { + response.setElementList(handler.getRetentionClassifiedElements(userId, + properties.getReturnSpecificLevel(), + properties.getLevelIdentifier(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getRetentionClassifiedElements(userId, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(LevelIdentifierProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getRetentionClassifiedElements(userId, + false, + 0, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Add or replace the security tags for an element. * @@ -1005,6 +1388,73 @@ public VoidResponse removeSecurityTags(String serverName, } + /** + * Return information about the elements classified with the security tags classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getSecurityTaggedElements(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getSecurityTaggedElements"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + response.setElementList(handler.getSecurityTagsClassifiedElements(userId, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + response.setElementList(handler.getSecurityTagsClassifiedElements(userId, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Add or replace the ownership classification for an element. * @@ -1145,6 +1595,93 @@ public VoidResponse clearOwnership(String serverName, } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getOwnersElements(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getOwnersElements"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof FindNameProperties properties) + { + response.setElementList(handler.getOwnersElements(userId, + properties.getName(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getOwnersElements(userId, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(FindNameProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getOwnersElements(userId, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Add or replace the origin classification for an asset. * @@ -1160,11 +1697,11 @@ public VoidResponse clearOwnership(String serverName, * PropertyServerException problem accessing property server or * UserNotAuthorizedException security access problem */ - public VoidResponse addAssetOrigin(String serverName, - String userId, - String assetGUID, - boolean forLineage, - boolean forDuplicateProcessing, + public VoidResponse addAssetOrigin(String serverName, + String userId, + String assetGUID, + boolean forLineage, + boolean forDuplicateProcessing, ClassificationRequestBody requestBody) { final String methodName = "addAssetOrigin"; @@ -1289,6 +1826,99 @@ public VoidResponse clearAssetOrigin(String serverName, } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public AssetElementsResponse getAssetsByOrigin(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getAssetsByOrigin"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + AssetElementsResponse response = new AssetElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + AssetHandler handler = instanceHandler.getAssetHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof FindAssetOriginProperties properties) + { + response.setElementList(handler.getAssetsFromOrigin(userId, + properties.getOrganizationGUID(), + properties.getBusinessCapabilityGUID(), + properties.getOtherOriginValues(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getAssetsFromOrigin(userId, + null, + null, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(FindAssetOriginProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getAssetsFromOrigin(userId, + null, + null, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Classify the element to assert that the definitions it represents are part of a subject area definition. * @@ -1467,6 +2097,93 @@ else if (requestBody.getMetadataCorrelationProperties() == null) } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public ElementStubsResponse getMembersOfSubjectArea(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + FindByPropertiesRequestBody requestBody) + { + final String methodName = "getMembersOfSubjectArea"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + ElementStubsResponse response = new ElementStubsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getElementStubHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof FindNameProperties properties) + { + response.setElementList(handler.getSubjectAreaMembers(userId, + properties.getName(), + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else if (requestBody.getProperties() == null) + { + response.setElementList(handler.getSubjectAreaMembers(userId, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(FindNameProperties.class.getName(), methodName); + } + } + else + { + response.setElementList(handler.getSubjectAreaMembers(userId, + null, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Create a semantic assignment relationship between a glossary term and an element (normally a schema attribute, data field or asset). * This relationship indicates that the data associated with the element meaning matches the description in the glossary term. @@ -1601,16 +2318,16 @@ public VoidResponse clearSemanticAssignment(String server if (requestBody == null) { handler.removeSemanticAssignment(userId, - null, - null, - elementGUID, - elementGUIDParameterName, - glossaryTermGUID, - glossaryTermGUIDParameterName, - forLineage, - forDuplicateProcessing, - null, - methodName); + null, + null, + elementGUID, + elementGUIDParameterName, + glossaryTermGUID, + glossaryTermGUIDParameterName, + forLineage, + forDuplicateProcessing, + null, + methodName); } else { @@ -1637,6 +2354,157 @@ public VoidResponse clearSemanticAssignment(String server } + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the element that is being assigned to the glossary term + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for relationship request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public GlossaryTermElementsResponse getMeanings(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "getMeanings"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + GlossaryTermElementsResponse response = new GlossaryTermElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + + if (requestBody == null) + { + response.setElementList(handler.getMeanings(userId, + null, + null, + elementGUID, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + else + { + response.setElementList(handler.getMeanings(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + elementGUID, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Retrieve the glossary terms linked via a "SemanticAssignment" relationship to the requested element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for relationship request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public RelatedElementsResponse getSemanticAssignees(String serverName, + String userId, + String glossaryTermGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "getMeanings"; + final String elementGUIDParameterName = "glossaryTermGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementsResponse response = new RelatedElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody == null) + { + response.setElementList(handler.getSemanticAssignments(userId, + glossaryTermGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + else + { + response.setElementList(handler.getSemanticAssignments(userId, + glossaryTermGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + /** * Link a governance definition to an element using the GovernedBy relationship. * @@ -1790,4 +2658,80 @@ public VoidResponse removeGovernanceDefinitionFromElement(String restCallLogger.logRESTCallReturn(token, response.toString()); return response; } + + + /** + * Retrieve the elements linked via a "GovernedBy" relationship to the requested governance definition. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param governanceDefinitionGUID unique identifier of the glossary term that the returned elements are linked to + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for relationship request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public RelatedElementsResponse getGovernedElements(String serverName, + String userId, + String governanceDefinitionGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "getGovernedElements"; + final String elementGUIDParameterName = "governanceDefinitionGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + RelatedElementsResponse response = new RelatedElementsResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + ReferenceableHandler handler = instanceHandler.getRelatedElementHandler(userId, serverName, methodName); + + if (requestBody == null) + { + response.setElementList(handler.getGovernedElements(userId, + governanceDefinitionGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } + else + { + response.setElementList(handler.getGovernedElements(userId, + governanceDefinitionGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/StewardshipExchangeResource.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/StewardshipExchangeResource.java index aa25f5007a1..ef4deacf5cd 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/StewardshipExchangeResource.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/StewardshipExchangeResource.java @@ -4,8 +4,11 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; +import org.odpi.openmetadata.accessservices.assetmanager.rest.AssetElementsResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.ClassificationRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.EffectiveTimeQueryRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ElementStubsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.FindByPropertiesRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.rest.RelationshipRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.server.StewardshipExchangeRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; @@ -64,11 +67,11 @@ public VoidResponse setConfidenceClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setConfidenceClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -96,16 +99,51 @@ public VoidResponse clearConfidenceClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearConfidenceClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-confidence") + + public ElementStubsResponse getConfidenceClassifiedElements(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getConfidenceClassifiedElements(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + /** * Classify/reclassify the element (typically an asset) to indicate how critical the element (or associated resource) * is to the organization. The level of criticality is expressed by the levelIdentifier property. @@ -128,11 +166,11 @@ public VoidResponse setCriticalityClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setCriticalityClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -160,16 +198,51 @@ public VoidResponse clearCriticalityClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearCriticalityClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the criticality classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-criticality") + + public ElementStubsResponse getCriticalityClassifiedElements(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getCriticalityClassifiedElements(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + /** * Classify/reclassify the element (typically a data field, schema attribute or glossary term) to indicate the level of confidentiality * that any data associated with the element should be given. If the classification is attached to a glossary term, the level @@ -194,11 +267,11 @@ public VoidResponse setConfidentialityClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setConfidentialityClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -226,16 +299,52 @@ public VoidResponse clearConfidentialityClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearConfidentialityClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the confidentiality classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-confidentiality") + + public ElementStubsResponse getConfidentialityClassifiedElements(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getConfidentialityClassifiedElements(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + + /** * Classify/reclassify the element (typically an asset) to indicate how long the element (or associated resource) * is to be retained by the organization. The policy to apply to the element/resource is captured by the retentionBasis @@ -260,11 +369,11 @@ public VoidResponse setRetentionClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setRetentionClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -292,16 +401,52 @@ public VoidResponse clearRetentionClassification(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearRetentionClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-retention") + + public ElementStubsResponse getRetentionClassifiedElements(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getRetentionClassifiedElements(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + + /** * Add or replace the security tags for an element. * @@ -323,11 +468,11 @@ public VoidResponse addSecurityTags(@PathVariable String serv @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.addSecurityTags(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -354,16 +499,51 @@ public VoidResponse removeSecurityTags(@PathVariable String serverName, @PathVariable String userId, @PathVariable String elementGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.removeSecurityTags(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the security tags classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-security-tags") + + public ElementStubsResponse getSecurityTaggedElements(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getSecurityTaggedElements(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + /** * Add or replace the ownership classification for an element. * @@ -385,11 +565,11 @@ public VoidResponse addOwnership(@PathVariable String serverN @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.addOwnership(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -416,16 +596,51 @@ public VoidResponse clearOwnership(@PathVariable String serve @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearOwnership(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the security tags classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-ownership") + + public ElementStubsResponse getOwnersElements(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getOwnersElements(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + /** * Add or replace the origin classification for an asset. * @@ -447,11 +662,11 @@ public VoidResponse addAssetOrigin(@PathVariable String serve @PathVariable String userId, @PathVariable String assetGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.addAssetOrigin(serverName, userId, assetGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -478,16 +693,51 @@ public VoidResponse clearAssetOrigin(@PathVariable String ser @PathVariable String userId, @PathVariable String assetGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearAssetOrigin(serverName, userId, assetGUID, forLineage, forDuplicateProcessing, requestBody); } + /** + * Return information about the elements classified with the confidence classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/asset/by-origin") + + public AssetElementsResponse getAssetsByOrigin(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getAssetsByOrigin(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + /** * Classify the element to assert that the definitions it represents are part of a subject area definition. * @@ -509,11 +759,11 @@ public VoidResponse addElementToSubjectArea(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.addElementToSubjectArea(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -540,16 +790,52 @@ public VoidResponse removeElementFromSubjectArea(@PathVariable String @PathVariable String userId, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - ClassificationRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.removeElementFromSubjectArea(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } + + /** + * Return information about the elements classified with the security tags classification. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for the request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/elements/by-subject-area-membership") + + public ElementStubsResponse getMembersOfSubjectArea(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam(required = false, defaultValue = "0") + int startFrom, + @RequestParam(required = false, defaultValue = "0") + int pageSize, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam(required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + FindByPropertiesRequestBody requestBody) + { + return restAPI.getMembersOfSubjectArea(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); + } + + /** * Create a semantic assignment relationship between a glossary term and an element (normally a schema attribute, data field or asset). * This relationship indicates that the data associated with the element meaning matches the description in the glossary term. @@ -574,11 +860,11 @@ public VoidResponse setupSemanticAssignment(@PathVariable String @PathVariable String elementGUID, @PathVariable String glossaryTermGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - RelationshipRequestBody requestBody) + RelationshipRequestBody requestBody) { return restAPI.setupSemanticAssignment(serverName, userId, elementGUID, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -607,11 +893,11 @@ public VoidResponse clearSemanticAssignment(@PathVariable String @PathVariable String elementGUID, @PathVariable String glossaryTermGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - EffectiveTimeQueryRequestBody requestBody) + EffectiveTimeQueryRequestBody requestBody) { return restAPI.clearSemanticAssignment(serverName, userId, elementGUID, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -640,11 +926,11 @@ public VoidResponse addGovernanceDefinitionToElement(@PathVariable String @PathVariable String definitionGUID, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - RelationshipRequestBody requestBody) + RelationshipRequestBody requestBody) { return restAPI.addGovernanceDefinitionToElement(serverName, userId, definitionGUID, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -673,11 +959,11 @@ public VoidResponse removeGovernanceDefinitionFromElement(@PathVariable String @PathVariable String definitionGUID, @PathVariable String elementGUID, @RequestParam(required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody (required = false) - EffectiveTimeQueryRequestBody requestBody) + EffectiveTimeQueryRequestBody requestBody) { return restAPI.removeGovernanceDefinitionFromElement(serverName, userId, definitionGUID, elementGUID, forLineage, forDuplicateProcessing, requestBody); } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/SubjectAreasInterface.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/SubjectAreasInterface.java index 338fbdb9042..ff91bb0f625 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/SubjectAreasInterface.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/api/SubjectAreasInterface.java @@ -219,6 +219,7 @@ void deleteSubjectAreaMemberClassification(String userId, UserNotAuthorizedException, PropertyServerException; + /** * Return information about the contents of a subject area such as the glossaries, reference data sets and quality definitions. * diff --git a/open-metadata-implementation/adapters/open-connectors/README.md b/open-metadata-implementation/adapters/open-connectors/README.md index a6d5b7b8856..d24d7dfe03c 100644 --- a/open-metadata-implementation/adapters/open-connectors/README.md +++ b/open-metadata-implementation/adapters/open-connectors/README.md @@ -49,7 +49,9 @@ These connectors enable the OMRS to be adapted to many different platforms. * **[rest-client-connectors](rest-client-connectors)** provides a connector to call a REST API from Java. -In addition there is the **[connector-configuration-factory](connector-configuration-factory)** +* **[secrets-store-connectors](secrets-store-connectors)** provides connectors to access secrets (passwords, certificates etc) at runtime. + +In addition, there is the **[connector-configuration-factory](connector-configuration-factory)** that creates **Connection** objects to configure these connectors. ---- diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md new file mode 100644 index 00000000000..4b261de90dc --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md @@ -0,0 +1,18 @@ + + + +# The Apache Atlas Integration Connector + +The Apache Atlas integration connector publishes glossary terms to Apache Atlas. + +## Deployment and configuration + +The kafka monitor integration connector is included in the main Egeria assembly. +It runs in the [Catalog Integrator OMIS](../../../../integration-services/catalog-integrator). + +---- +* Return to [Integration Connectors module](..) + +---- +License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), +Copyright Contributors to the ODPi Egeria project. \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/build.gradle b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/build.gradle new file mode 100644 index 00000000000..bbbd813c4f9 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/build.gradle @@ -0,0 +1,38 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Contributors to the ODPi Egeria project. + */ + + +dependencies { + compileOnly project(':open-metadata-implementation:frameworks:audit-log-framework') + compileOnly project(':open-metadata-implementation:frameworks:open-connector-framework') + compileOnly project(':open-metadata-implementation:frameworks:governance-action-framework') + compileOnly project(':open-metadata-implementation:frameworks:open-integration-framework') + compileOnly project(':open-metadata-implementation:access-services:asset-manager:asset-manager-api') + compileOnly project(':open-metadata-implementation:integration-services:catalog-integrator:catalog-integrator-api') + compileOnly project(':open-metadata-implementation:repository-services:repository-services-apis') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:rest-client-connectors-api') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:rest-client-factory') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector') + testImplementation project(':open-metadata-implementation:frameworks:audit-log-framework') + testImplementation project(':open-metadata-implementation:repository-services:repository-services-apis') + testImplementation project(':open-metadata-test:open-metadata-ut') + testImplementation 'org.testng:testng' + compileOnly 'org.springframework:spring-core' + compileOnly 'com.fasterxml.jackson.core:jackson-databind' + compileOnly 'com.fasterxml.jackson.core:jackson-annotations' + +} + +description = 'Apache Atlas Integration Connector' + +java { + withJavadocJar() +} + +test { + useTestNG() + // This will default to standard search pattern - see https://docs.gradle.org/current/userguide/java_testing.html#sec:test_detection + scanForTestClasses = false +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationConnector.java new file mode 100644 index 00000000000..e3a1bebd97e --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationConnector.java @@ -0,0 +1,442 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas; + + +import org.odpi.openmetadata.accessservices.assetmanager.api.AssetManagerEventListener; +import org.odpi.openmetadata.accessservices.assetmanager.events.AssetManagerEventType; +import org.odpi.openmetadata.accessservices.assetmanager.events.AssetManagerOutTopicEvent; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc.ApacheAtlasAuditCode; +import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc.ApacheAtlasErrorCode; +import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasGlossaryAnchorElement; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.properties.EndpointProperties; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementType; +import org.odpi.openmetadata.integrationservices.catalog.connector.CatalogIntegratorConnector; +import org.odpi.openmetadata.integrationservices.catalog.connector.CatalogIntegratorContext; +import org.odpi.openmetadata.integrationservices.catalog.connector.GlossaryExchangeService; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * ApacheAtlasIntegrationConnector catalogues glossary terms in Apache Atlas. + */ +public class ApacheAtlasIntegrationConnector extends CatalogIntegratorConnector implements AssetManagerEventListener +{ + private String glossaryQualifiedName = null; + private String glossaryGUID = null; + private String targetRootURL = "localhost:21000"; + + private CatalogIntegratorContext myContext = null; + private GlossaryExchangeService glossaryExchangeService = null; + private ApacheAtlasRESTClient atlasClient = null; + + + /** + * Indicates that the connector is completely configured and can begin processing. + * This call can be used to register with non-blocking services. + * + * @throws ConnectorCheckedException there is a problem within the connector. + */ + @Override + public void start() throws ConnectorCheckedException + { + super.start(); + + final String methodName = "start"; + + myContext = super.getContext(); + + /* + * Retrieve the configuration + */ + EndpointProperties endpoint = connectionProperties.getEndpoint(); + + if (endpoint != null) + { + targetRootURL = endpoint.getAddress(); + } + + Map configurationProperties = connectionProperties.getConfigurationProperties(); + + if (configurationProperties != null) + { + glossaryQualifiedName = configurationProperties.get(ApacheAtlasIntegrationProvider.GLOSSARY_QUALIFIED_NAME_CONFIGURATION_PROPERTY).toString(); + } + + /* + * Record the configuration + */ + if (auditLog != null) + { + if (glossaryQualifiedName == null) + { + auditLog.logMessage(methodName, ApacheAtlasAuditCode.CONNECTOR_CONFIGURATION_ALL.getMessageDefinition(connectorName, targetRootURL)); + } + else + { + auditLog.logMessage(methodName, ApacheAtlasAuditCode.CONNECTOR_CONFIGURATION_SPECIFIC.getMessageDefinition(connectorName, targetRootURL, glossaryQualifiedName)); + } + } + + try + { + /* + * This request registers this connector to receive events from the open metadata ecosystem. When an event occurs, + * the processEvent() method is called. + */ + myContext.registerListener(this); + + /* + * This creates the client to call Apache Atlas. + */ + atlasClient = new ApacheAtlasRESTClient("Apache Atlas at " + targetRootURL, + targetRootURL, + auditLog); + + /* + * The glossaryExchangeService provides access to the open metadata API. + */ + glossaryExchangeService = myContext.getGlossaryExchangeService(); + } + catch (Exception error) + { + if (auditLog != null) + { + auditLog.logException(methodName, + ApacheAtlasAuditCode.MISSING_TEMPLATE.getMessageDefinition(connectorName, glossaryQualifiedName), + error); + } + } + } + + + /** + * Requests that the connector does a comparison of the metadata in the third party technology and open metadata repositories. + * Refresh is called when the integration connector first starts and then at intervals defined in the connector's configuration + * as well as any external REST API calls to explicitly refresh the connector. + * + * This method performs two sweeps. It first retrieves the topics from the event broker (Kafka) and validates that are in the + * catalog - adding or updating them if necessary. The second sweep is to ensure that all the topics catalogued + * actually exist in the event broker. + * + * @throws ConnectorCheckedException there is a problem with the connector. It is not able to refresh the metadata. + */ + @Override + public void refresh() throws ConnectorCheckedException + { + final String methodName = "refresh"; + + try + { + if (glossaryQualifiedName == null) + { + List glossaries = glossaryExchangeService.findGlossaries(".*", 0, 0, new Date()); + + if (glossaries != null) + { + for (GlossaryElement glossary : glossaries) + { + this.refreshGlossary(glossary); + } + } + } + else + { + List glossaries = glossaryExchangeService.getGlossariesByName(glossaryGUID, 0, 0, new Date()); + + if (glossaries != null) + { + for (GlossaryElement glossary : glossaries) + { + this.refreshGlossary(glossary); + } + } + } + } + catch (InvalidParameterException error) + { + if (auditLog != null) + { + auditLog.logException(methodName, + ApacheAtlasAuditCode.UNABLE_TO_RETRIEVE_TOPICS.getMessageDefinition(connectorName, + "localhost:9092", + error.getClass().getName(), + error.getMessage()), + error); + } + } + catch (Exception error) + { + if (auditLog != null) + { + auditLog.logException(methodName, + ApacheAtlasAuditCode.UNABLE_TO_RETRIEVE_TOPICS.getMessageDefinition(connectorName, + "localhost:9092", + error.getClass().getName(), + error.getMessage()), + error); + + + } + + throw new ConnectorCheckedException(ApacheAtlasErrorCode.UNEXPECTED_EXCEPTION.getMessageDefinition(connectorName, + error.getClass().getName(), + error.getMessage()), + this.getClass().getName(), + methodName, + error); + } + } + + + + private GlossaryElement getGlossaryElement(String glossaryQualifiedName, + String methodName) throws ConnectorCheckedException + { + try + { + List egeriaGlossaries = glossaryExchangeService.getGlossariesByName(glossaryQualifiedName, 0, 0, null); + + if (egeriaGlossaries != null) + { + for (GlossaryElement glossaryElement : egeriaGlossaries) + { + String qualifiedName = glossaryElement.getGlossaryProperties().getQualifiedName(); + + if (glossaryQualifiedName.equals(qualifiedName)) + { + glossaryGUID = glossaryElement.getElementHeader().getGUID(); + } + } + } + + if (glossaryGUID == null) + { + if (auditLog != null) + { + auditLog.logMessage(methodName, + ApacheAtlasAuditCode.MISSING_TEMPLATE.getMessageDefinition(connectorName, glossaryQualifiedName)); + } + } + } + catch (Exception error) + { + if (auditLog != null) + { + auditLog.logException(methodName, + ApacheAtlasAuditCode.UNABLE_TO_RETRIEVE_TOPICS.getMessageDefinition(connectorName, + "localhost:9092", + error.getClass().getName(), + error.getMessage()), + error); + + + } + + throw new ConnectorCheckedException(ApacheAtlasErrorCode.UNEXPECTED_EXCEPTION.getMessageDefinition(connectorName, + error.getClass().getName(), + error.getMessage()), + this.getClass().getName(), + methodName, + error); + } + + return null; + } + + /** + * Process an event that was published by the Asset Manager OMAS. This connector is only interested in + * glossaries and glossary terms. + * + * @param event event object + */ + @Override + public void processEvent(AssetManagerOutTopicEvent event) + { + ElementHeader elementHeader = event.getElementHeader(); + AssetManagerEventType eventType = event.getEventType(); + + if (elementHeader != null) + { + /* + * Understand the type of the element that has changed. + */ + ElementType elementType = elementHeader.getType(); + if (elementType != null) + { + List elementTypeNames = new ArrayList<>(); + + elementTypeNames.add(elementType.getTypeName()); + if (elementType.getSuperTypeNames() != null) + { + elementTypeNames.addAll(elementType.getSuperTypeNames()); + } + + /* + * Is the element of interest? + */ + if (elementTypeNames.contains("Glossary")) + { + if (glossaryGUID == null) + { + /* + * Process any glossary + */ + this.refreshGlossary(eventType, elementHeader); + } + else if (glossaryGUID.equals(elementHeader.getGUID())) + { + /* + * Process the specific glossary + */ + this.refreshGlossary(eventType, elementHeader); + } + } + else if (elementTypeNames.contains("GlossaryTerm")) + { + if (glossaryGUID == null) + { + /* + * Process any term from any glossary + */ + this.refreshGlossaryTerm(eventType, elementHeader); + } + else + { + String anchorGUID = myContext.getAnchorGUID(elementHeader); + + if (glossaryGUID.equals(anchorGUID)) + { + /* + * This term is from the appropriate glossary + */ + this.refreshGlossaryTerm(eventType, elementHeader); + } + } + } + } + } + } + + + private void refreshGlossary(AssetManagerEventType eventType, + ElementHeader glossaryHeader) + { + try + { + GlossaryElement glossary = glossaryExchangeService.getGlossaryByGUID(glossaryHeader.getGUID(), new Date()); + + if (glossary != null) + { + this.refreshGlossary(glossary); + } + } + catch (InvalidParameterException notFound) + { + /* + * No term is present - was this a delete event? + */ + if (eventType != AssetManagerEventType.ELEMENT_DELETED) + { + /* + * Report an error + */ + } + } + catch (Exception error) + { + /* + * Report an error + */ + } + } + + + private void refreshGlossary(GlossaryElement glossaryElement) + { + if (glossaryElement != null) + { + AtlasGlossaryAnchorElement atlasGlossaryAnchor = atlasClient.syncGlossary(glossaryElement); + + if (atlasGlossaryAnchor != null) + { + + } + } + } + + + private void refreshGlossaryTerm(AssetManagerEventType eventType, + ElementHeader glossaryTermHeader) + { + try + { + GlossaryTermElement glossaryTerm = glossaryExchangeService.getGlossaryTermByGUID(glossaryTermHeader.getGUID(), new Date()); + + if (glossaryTerm != null) + { + this.refreshGlossaryTerm(glossaryTerm, null); + } + } + catch (InvalidParameterException notFound) + { + /* + * No term is present - was this a delete event? + */ + if (eventType != AssetManagerEventType.ELEMENT_DELETED) + { + /* + * Report an error + */ + } + } + catch (Exception error) + { + /* + * Report an error + */ + } + } + + + private void refreshGlossaryTerm(GlossaryTermElement glossaryTerm, + AtlasGlossaryAnchorElement atlasGlossaryAnchor) + { + if (glossaryTerm.getElementHeader().getStatus() == ElementStatus.ACTIVE) + { + atlasClient.syncGlossaryTerm(glossaryTerm, atlasGlossaryAnchor); + } + } + + + /** + * Shutdown glossary monitoring + * + * @throws ConnectorCheckedException something failed in the super class + */ + @Override + public void disconnect() throws ConnectorCheckedException + { + final String methodName = "disconnect"; + + + if (auditLog != null) + { + auditLog.logMessage(methodName, + ApacheAtlasAuditCode.CONNECTOR_STOPPING.getMessageDefinition(connectorName)); + } + + super.disconnect(); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationProvider.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationProvider.java new file mode 100644 index 00000000000..df9488bbcc1 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasIntegrationProvider.java @@ -0,0 +1,86 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas; + +import org.odpi.openmetadata.frameworks.auditlog.AuditLogReportingComponent; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; +import org.odpi.openmetadata.frameworks.integration.connectors.IntegrationConnectorProvider; + +import java.util.ArrayList; +import java.util.List; + + +/** + * ApacheAtlasIntegrationProvider is the connector provider for the Apache Atlas integration connector that publishes glossary terms to Apache Atlas. + */ +public class ApacheAtlasIntegrationProvider extends IntegrationConnectorProvider +{ + /* + * Unique identifier of the connector for the audit log. + */ + private static final int connectorComponentId = 659; + + /* + * Unique identifier for the connector type. + */ + private static final String connectorTypeGUID = "aeca7da2-80c1-4e2a-baa5-8c30472be766"; + + /* + * Descriptive information about the connector for the connector type and audit log. + */ + private static final String connectorQualifiedName = "Egeria:IntegrationConnector:Catalog:ApacheAtlas"; + private static final String connectorDisplayName = "Apache Atlas Integration Connector"; + private static final String connectorDescription = "Connector publishes active glossary terms to Apache Atlas."; + private static final String connectorWikiPage = "https://egeria-project.org/connectors/integration/apache-atlas-integration-connector/"; + + /* + * Class of the connector. + */ + private static final Class connectorClass = ApacheAtlasIntegrationConnector.class; + + + static final String GLOSSARY_QUALIFIED_NAME_CONFIGURATION_PROPERTY = "glossaryQualifiedName"; + + /** + * Constructor used to initialize the ConnectorProvider with the Java class name of the specific + * store implementation. + */ + public ApacheAtlasIntegrationProvider() + { + super(); + + /* + * Set up the class name of the connector that this provider creates. + */ + super.setConnectorClassName(connectorClass.getName()); + + /* + * Set up the connector type that should be included in a connection used to configure this connector. + */ + ConnectorType connectorType = new ConnectorType(); + connectorType.setType(ConnectorType.getConnectorTypeType()); + connectorType.setGUID(connectorTypeGUID); + connectorType.setQualifiedName(connectorQualifiedName); + connectorType.setDisplayName(connectorDisplayName); + connectorType.setDescription(connectorDescription); + connectorType.setConnectorProviderClassName(this.getClass().getName()); + List recognizedConfigurationProperties = new ArrayList<>(); + recognizedConfigurationProperties.add(GLOSSARY_QUALIFIED_NAME_CONFIGURATION_PROPERTY); + connectorType.setRecognizedConfigurationProperties(recognizedConfigurationProperties); + + super.connectorTypeBean = connectorType; + + /* + * Set up the component description used in the connector's audit log messages. + */ + AuditLogReportingComponent componentDescription = new AuditLogReportingComponent(); + + componentDescription.setComponentId(connectorComponentId); + componentDescription.setComponentName(connectorQualifiedName); + componentDescription.setComponentDescription(connectorDescription); + componentDescription.setComponentWikiURL(connectorWikiPage); + + super.setConnectorComponentDescription(componentDescription); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasRESTClient.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasRESTClient.java new file mode 100644 index 00000000000..281591a9ab3 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ApacheAtlasRESTClient.java @@ -0,0 +1,496 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas; + + +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc.ApacheAtlasAuditCode; +import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc.ApacheAtlasErrorCode; +import org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties.AtlasGlossaryAnchorElement; +import org.odpi.openmetadata.adapters.connectors.restclients.RESTClientConnector; +import org.odpi.openmetadata.adapters.connectors.restclients.factory.RESTClientFactory; +import org.odpi.openmetadata.adapters.connectors.restclients.spring.SpringRESTClientConnector; +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.springframework.core.ParameterizedTypeReference; + +import java.util.List; + + +/** + * RESTClient is responsible for issuing calls to the OMAS REST APIs. + */ +public class ApacheAtlasRESTClient +{ + protected String serverName; /* Initialized in constructor */ + protected String url; /* Initialized in constructor */ + protected AuditLog auditLog; /* Initialized in constructor */ + + + private final RESTClientConnector clientConnector; /* Initialized in constructor */ + + + /** + * Constructor for no authentication with audit log. + * + * @param serverName name of the Atlas Server to call + * @param url URL root of the server platform where the OMAG Server is running. + * @param auditLog destination for log messages. + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + protected ApacheAtlasRESTClient(String serverName, + String url, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "RESTClient(no authentication)"; + + this.serverName = serverName; + this.url = url; + this.auditLog = auditLog; + + RESTClientFactory factory = new RESTClientFactory(serverName, url); + + try + { + this.clientConnector = factory.getClientConnector(); + } + catch (Exception error) + { + throw new InvalidParameterException(ApacheAtlasErrorCode.NULL_URL.getMessageDefinition(serverName, error.getMessage()), + this.getClass().getName(), + methodName, + error, + "url or serverName"); + } + } + + + /** + * Constructor for simple userId and password authentication with audit log. + * + * @param serverName name of the OMAG Server to call + * @param url URL root of the server platform where the OMAG Server is running. + * @param userId user id for the HTTP request + * @param password password for the HTTP request + * @param auditLog destination for log messages. + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + protected ApacheAtlasRESTClient(String serverName, + String url, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "RESTClient(userId and password)"; + + this.serverName = serverName; + this.url = url; + this.auditLog = auditLog; + + RESTClientFactory factory = new RESTClientFactory(serverName, + url, + userId, + password); + + try + { + this.clientConnector = factory.getClientConnector(); + } + catch (Exception error) + { + throw new InvalidParameterException(ApacheAtlasErrorCode.NULL_URL.getMessageDefinition(serverName, error.getMessage()), + this.getClass().getName(), + methodName, + error, + "url or serverName"); + } + } + + + AtlasGlossaryAnchorElement syncGlossary(GlossaryElement egeriaGlossary) + { + String atlasGUID = null; + + /* + * Retrieve the named glossary + */ + + /* + * If found, update glossary + */ + + /* + * If not found create glossary + */ + + return null; + } + + + String syncGlossaryTerm(GlossaryTermElement egeriaGlossaryTerm, + AtlasGlossaryAnchorElement atlasGlossaryAnchor) + { + String atlasGUID = null; + /* + * Retrieve the terms from the glossary + */ + + /* + * Scan the terms to match on the egeriaGUID + */ + + /* + * If a match is found; update if required + */ + + /* + * If no match; create a new term + */ + + return atlasGUID; + } + + + /** + * Issue a GET REST call that returns a response object. + * + * @param return type + * @param methodName name of the method being called. + * @param returnClass class of the response object. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * + * @return response object + * @throws PropertyServerException something went wrong with the REST call stack. + */ + protected T callGetRESTCallNoParams(String methodName, + Class returnClass, + String urlTemplate) throws PropertyServerException + { + try + { + return clientConnector.callGetRESTCall(methodName, returnClass, urlTemplate); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + + /** + * Issue a GET REST call that returns a response object. + * + * @param return type + * @param methodName name of the method being called. + * @param returnClass class of the response object. + * @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 PropertyServerException something went wrong with the REST call stack. + */ + protected T callGetRESTCall(String methodName, + Class returnClass, + String urlTemplate, + Object... params) throws PropertyServerException + { + try + { + return clientConnector.callGetRESTCall(methodName, returnClass, urlTemplate, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + /** + * Issue a GET REST call that returns a response object. It's working only with {@link SpringRESTClientConnector} + * + * @param return type + * @param methodName name of the method being called. + * @param responseType class of the response object. + * @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 PropertyServerException something went wrong with the REST call stack. + */ + protected T callGetRESTCall(String methodName, + ParameterizedTypeReference responseType, + String urlTemplate, + Object... params) throws PropertyServerException + { + try + { + SpringRESTClientConnector clientConnector = (SpringRESTClientConnector) this.clientConnector; + return clientConnector.callGetRESTCall(methodName, responseType, urlTemplate, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + + /** + * Issue a POST REST call that returns a response object. This is typically a create, update, or find with + * complex parameters. + * + * @param return type + * @param methodName name of the method being called. + * @param returnClass class of the response object. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param requestBody request body for the request. + * + * @return response object + * @throws PropertyServerException something went wrong with the REST call stack. + */ + protected T callPostRESTCallNoParams(String methodName, + Class returnClass, + String urlTemplate, + Object requestBody) throws PropertyServerException + { + try + { + return clientConnector.callPostRESTCallNoParams(methodName, returnClass, urlTemplate, requestBody); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + + /** + * Issue a POST REST call that returns a response object. This is typically a create, update, or find with + * complex parameters. + * + * @param return type + * @param methodName name of the method being called. + * @param returnClass class of the response object. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param requestBody request body for the request. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws PropertyServerException something went wrong with the REST call stack. + */ + protected T callPostRESTCall(String methodName, + Class returnClass, + String urlTemplate, + Object requestBody, + Object... params) throws PropertyServerException + { + try + { + return clientConnector.callPostRESTCall(methodName, returnClass, urlTemplate, requestBody, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + /** + * Issue a POST REST call that returns a response object. This is typically a create, update, or find with + * complex parameters. It's working only with {@link SpringRESTClientConnector} + * + * @param return type + * @param methodName name of the method being called. + * @param responseType class of the response for generic object. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param requestBody request body for the request. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws PropertyServerException something went wrong with the REST call stack. + */ + protected T callPostRESTCall(String methodName, + ParameterizedTypeReference responseType, + String urlTemplate, + Object requestBody, + Object... params) throws PropertyServerException + { + try + { + SpringRESTClientConnector clientConnector = (SpringRESTClientConnector) this.clientConnector; + return clientConnector.callPostRESTCall(methodName, responseType, urlTemplate, requestBody, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + /** + * Issue a PUT REST call that returns a response object. This is typically an update. + * + * @param return type + * @param methodName name of the method being called. + * @param returnClass class of the response object. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param requestBody request body for the request. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws PropertyServerException something went wrong with the REST call stack. + */ + protected T callPutRESTCall(String methodName, + Class returnClass, + String urlTemplate, + Object requestBody, + Object... params) throws PropertyServerException + { + try + { + return clientConnector.callPutRESTCall(methodName, returnClass, urlTemplate, requestBody, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + /** + * Issue a PUT REST call that returns a response object. This is typically an update. + * It's working only with {@link SpringRESTClientConnector} + * + * @param return type + * @param methodName name of the method being called. + * @param responseType class of the response for generic object. + * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param requestBody request body for the request. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws PropertyServerException something went wrong with the REST call stack. + */ + protected T callPutRESTCall(String methodName, + ParameterizedTypeReference responseType, + String urlTemplate, + Object requestBody, + Object... params) throws PropertyServerException + { + try + { + SpringRESTClientConnector clientConnector = (SpringRESTClientConnector) this.clientConnector; + return clientConnector.callPutRESTCall(methodName, responseType, urlTemplate, requestBody, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + + /** + * Issue a Delete REST call that returns a response object. + * + * @param return type + * @param methodName name of the method being called. + * @param returnClass class of the response object. + * @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 PropertyServerException something went wrong with the REST call stack. + */ + protected T callDeleteRESTCall(String methodName, + Class returnClass, + String urlTemplate, + Object... params) throws PropertyServerException + { + try + { + return clientConnector.callDeleteRESTCall(methodName, returnClass, urlTemplate, null, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + + /** + * Issue a Delete REST call that returns a response object. + * + * @param return type + * @param methodName name of the method being called. + * @param responseType class of the response for generic object. + * @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 PropertyServerException something went wrong with the REST call stack. + */ + protected T callDeleteRESTCall(String methodName, + ParameterizedTypeReference responseType, + String urlTemplate, Object... params) throws PropertyServerException + { + try + { + SpringRESTClientConnector clientConnector = (SpringRESTClientConnector) this.clientConnector; + return clientConnector.callDeleteRESTCall(methodName, responseType, urlTemplate, null, params); + } + catch (Exception error) + { + logRESTCallException(methodName, error); + } + + return null; + } + + + /** + * Provide detailed logging for exceptions. + * + * @param methodName calling method + * @param error resulting exception + * @throws PropertyServerException wrapping exception + */ + private void logRESTCallException(String methodName, + Exception error) throws PropertyServerException + { + if (auditLog != null) + { + auditLog.logException(methodName, + ApacheAtlasAuditCode.CLIENT_SIDE_REST_API_ERROR.getMessageDefinition(methodName, + serverName, + url, + error.getMessage()), + error); + } + + throw new PropertyServerException(ApacheAtlasErrorCode.CLIENT_SIDE_REST_API_ERROR.getMessageDefinition(methodName, + serverName, + url, + error.getMessage()), + this.getClass().getName(), + methodName, + error); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java new file mode 100644 index 00000000000..23870c4a840 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java @@ -0,0 +1,214 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc; + +import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageDefinition; +import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogMessageSet; +import org.odpi.openmetadata.repositoryservices.auditlog.OMRSAuditLogRecordSeverity; + + +/** + * The ApacheAtlasAuditCode is used to define the message content for the OMRS Audit Log. + * + * The 5 fields in the enum are: + *
    + *
  • Log Message Id - to uniquely identify the message
  • + *
  • Severity - is this an event, decision, action, error or exception
  • + *
  • Log Message Text - includes placeholder to allow additional values to be captured
  • + *
  • Additional Information - further parameters and data relating to the audit message (optional)
  • + *
  • SystemAction - describes the result of the situation
  • + *
  • UserAction - describes how a user should correct the situation
  • + *
+ */ +public enum ApacheAtlasAuditCode implements AuditLogMessageSet +{ + CONNECTOR_CONFIGURATION_ALL("APACHE-ATLAS-INTEGRATION-CONNECTOR-0001", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has been initialized to publish all glossary terms to the Apache Atlas server at URL {1}", + "The connector is designed to publish changes to all active glossary terms to Apache Atlas glossaries.", + "No specific action is required. This message is to confirm the configuration for the integration connector allows all glossaries to be published."), + + CONNECTOR_CONFIGURATION_SPECIFIC("APACHE-ATLAS-INTEGRATION-CONNECTOR-0002", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has been initialized to publish glossary terms from glossary {2} to the Apache Atlas server at URL {1}", + "The connector is designed to publish changes to all active glossary terms from the name glossary to an equivalent glossary on Apache Atlas.", + "No specific action is required. This message is to confirm the configuration for the integration connector limits which glossaries are to be published."), + + BAD_CONFIGURATION("APACHE-ATLAS-INTEGRATION-CONNECTOR-0002", + OMRSAuditLogRecordSeverity.EXCEPTION, + "The {0} integration connector encountered an {1} exception when opening event broker {2} during the {3} method. The exception message included was {4}", + "The exception is passed back to the Topic Integrator OMIS in the integration daemon that is hosting " + + "this connector to enable it to perform error handling. More messages are likely to follow describing the " + + "error handling that was performed. These can help to determine how to recover from this error", + "This message contains the exception that was the original cause of the problem. Use the information from the " + + "exception stack trace to determine why the connector is not able to access the event broker and resolve that issue. " + + "Use the messages that where subsequently logged during the error handling to discover how to restart the " + + "connector in the integration daemon once the original cause of the error has been corrected."), + + UNABLE_TO_RETRIEVE_TOPICS("APACHE-ATLAS-INTEGRATION-CONNECTOR-0004", + OMRSAuditLogRecordSeverity.EXCEPTION, + "The {0} integration connector received an unexpected {2} exception when retrieving topics from event broker at {1}. The error message was {3}", + "The exception is returned to the integration daemon that is hosting this connector to enable it to perform error handling.", + "Use the message in the nested exception to determine the root cause of the error. Once this is " + + "resolved, follow the instructions in the messages produced by the integration daemon to restart this connector."), + + RETRIEVED_TOPICS("APACHE-ATLAS-INTEGRATION-CONNECTOR-0005", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has retrieved {2} topics from {1}", + "The connector will maintain these topics as assets.", + "No action is required unless there are errors that follow indicating that the topics can not be maintained."), + + CONNECTOR_STOPPING("APACHE-ATLAS-INTEGRATION-CONNECTOR-0009", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has stopped its topic monitoring and is shutting down", + "The connector is disconnecting.", + "No action is required unless there are errors that follow indicating that there were problems shutting down."), + + UNEXPECTED_EXC_TOPIC_UPDATE("APACHE-ATLAS-INTEGRATION-CONNECTOR-0014", + OMRSAuditLogRecordSeverity.EXCEPTION, + "An unexpected {0} exception was returned to the {1} integration connector when it tried to update the " + + "Topic in the metadata repositories for topic {2}. The error message was {3}", + "The exception is logged and the integration connector continues to synchronize metadata. " + + "This topic is not catalogued at this time but may succeed later.", + "Use the message in the unexpected exception to determine the root cause of the error and fix it."), + + MISSING_TEMPLATE("APACHE-ATLAS-INTEGRATION-CONNECTOR-0015", + OMRSAuditLogRecordSeverity.ERROR, + "The {0} integration connector is unable to retrieve the Topic template with qualified name: {1}", + "The metadata element for the template is not found in the open metadata repositories. " + + "The template name was configured for the connector. This means that topics should be catalogued " + + "using the template. Since the template is missing, topics are not being catalogued.", + "Create the template in the metadata repository. The connector will catalog the topics during " + + "its next periodic refresh or you can force it to refresh immediately by calling the refresh" + + "operation on the integration daemon."), + + TOPIC_CREATED("APACHE-ATLAS-INTEGRATION-CONNECTOR-0016", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector created the Topic {1} ({2}) for a new real-world topic", + "The connector created the Topic as part of its monitoring of the topics in the event broker.", + "No action is required. This message is to record the reason why the Topic was created."), + + TOPIC_CREATED_FROM_TEMPLATE("APACHE-ATLAS-INTEGRATION-CONNECTOR-0017", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector created the Topic {1} ({2}) for a new real-world topic using template {3} ({4})", + "The connector created the Topic as part of its monitoring of the topics in the event broker. " + + "The template provides details of additional metadata that should also be attached to the new Topic element. " + + "It was specified in the templateQualifiedName configuration property of the connector.", + "No action is required. This message is to record the reason why the Topic was created with the template."), + + TOPIC_UPDATED("APACHE-ATLAS-INTEGRATION-CONNECTOR-0018", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has updated the Topic {1} ({2}) because the real-world topic changed", + "The connector updated the Topic as part of its monitoring of the topics in the event broker.", + "No action is required. This message is to record the reason why the Topic was updated."), + + TOPIC_DELETED("APACHE-ATLAS-INTEGRATION-CONNECTOR-0019", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has deleted the Topic {1} ({2}) because the real-world topic is no longer defined in the event broker", + "The connector removed the Topic as part of its monitoring of the topics in the event broker.", + "No action is required. This message is to record the reason why the Topic was removed."), + + TOPIC_ARCHIVED("APACHE-ATLAS-INTEGRATION-CONNECTOR-0020", + OMRSAuditLogRecordSeverity.INFO, + "The {0} integration connector has archived the Topic {1} ({2}) because the real-world topic is no longer stored in the event broker", + "The connector updated the Topic to reflect that is is now just a placeholder for an asset that no longer exists. " + + "Its presence is still needed in the metadata repository for lineage reporting.", + "No action is required. This message is to record the reason why the Topic was archived."), + + + CLIENT_SIDE_REST_API_ERROR( "APACHE-ATLAS-INTEGRATION-CONNECTOR-0030", + OMRSAuditLogRecordSeverity.EXCEPTION, + "A client-side exception was received from API call {0} to OMAG Server {1} at {2}. The error message was {3}", + "The server has issued a call to the open metadata access service REST API in a remote server and has received an exception from the local client libraries.", + "Look for errors in the local server's console to understand and correct the source of the error.") + + + ; + + private final String logMessageId; + private final OMRSAuditLogRecordSeverity severity; + private final String logMessage; + private final String systemAction; + private final String userAction; + + + /** + * The constructor for ApacheAtlasAuditCode expects to be passed one of the enumeration rows defined in + * ApacheAtlasAuditCode above. For example: + * + * ApacheAtlasAuditCode auditCode = ApacheAtlasAuditCode.SERVER_NOT_AVAILABLE; + * + * This will expand out to the 4 parameters shown below. + * + * @param messageId - unique Id for the message + * @param severity - severity of the message + * @param message - text for the message + * @param systemAction - description of the action taken by the system when the condition happened + * @param userAction - instructions for resolving the situation, if any + */ + ApacheAtlasAuditCode(String messageId, + OMRSAuditLogRecordSeverity severity, + String message, + String systemAction, + String userAction) + { + this.logMessageId = messageId; + this.severity = severity; + this.logMessage = message; + this.systemAction = systemAction; + this.userAction = userAction; + } + + + /** + * Retrieve a message definition object for logging. This method is used when there are no message inserts. + * + * @return message definition object. + */ + @Override + public AuditLogMessageDefinition getMessageDefinition() + { + return new AuditLogMessageDefinition(logMessageId, + severity, + logMessage, + systemAction, + userAction); + } + + + /** + * Retrieve a message definition object for logging. This method is used when there are values to be inserted into the message. + * + * @param params array of parameters (all strings). They are inserted into the message according to the numbering in the message text. + * @return message definition object. + */ + @Override + public AuditLogMessageDefinition getMessageDefinition(String ...params) + { + AuditLogMessageDefinition messageDefinition = new AuditLogMessageDefinition(logMessageId, + severity, + logMessage, + systemAction, + userAction); + messageDefinition.setMessageParameters(params); + return messageDefinition; + } + + + /** + * JSON-style toString + * + * @return string of property names and values for this enum + */ + @Override + public String toString() + { + return "ApacheAtlasAuditCode{" + + "logMessageId='" + logMessageId + '\'' + + ", severity=" + severity + + ", logMessage='" + logMessage + '\'' + + ", systemAction='" + systemAction + '\'' + + ", userAction='" + userAction + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasErrorCode.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasErrorCode.java new file mode 100644 index 00000000000..8edad41fdd9 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasErrorCode.java @@ -0,0 +1,114 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc; + +import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageDefinition; +import org.odpi.openmetadata.frameworks.auditlog.messagesets.ExceptionMessageSet; + +/** + * The ApacheAtlasErrorCode is used to define first failure data capture (FFDC) for errors that occur when working with + * the Kafka monitor integration connector. It is used in conjunction with both Checked and Runtime (unchecked) exceptions. + * + * The 5 fields in the enum are: + *
    + *
  • HTTP Error Code - for translating between REST and JAVA - Typically the numbers used are:
  • + *
    • + *
    • 500 - internal error
    • + *
    • 400 - invalid parameters
    • + *
    • 404 - not found
    • + *
    • 409 - data conflict errors - eg item already defined
    • + *
  • + *
  • Error Message Id - to uniquely identify the message
  • + *
  • Error Message Text - includes placeholder to allow additional values to be captured
  • + *
  • SystemAction - describes the result of the error
  • + *
  • UserAction - describes how a consumer should correct the error
  • + *
+ */ +public enum ApacheAtlasErrorCode implements ExceptionMessageSet +{ + UNEXPECTED_EXCEPTION(500, "APACHE-ATLAS-INTEGRATION-CONNECTOR-500-001", + "The {0} integration connector received an unexpected exception {1} when cataloguing topics; the error message was: {2}", + "The connector is unable to catalog one or more topics.", + "Use the details from the error message to determine the cause of the error and retry the request once it is resolved."), + + + NULL_URL(400, "APACHE-ATLAS-INTEGRATION-CONNECTOR-400-014", + "OMAG server has been called with a null local server name", + "The system is unable to configure the local server without knowing what it is called.", + "The local server name is supplied by the caller to the OMAG server. This call needs to be corrected before the server can operate correctly."), + + CLIENT_SIDE_REST_API_ERROR(503, "APACHE-ATLAS-INTEGRATION-CONNECTOR-503-001", + "A client-side exception of {0} was received from API call {1} to URL {2}. The error message was {3}", + "The integration has issued a call to the open metadata access service REST API in a remote server and has received an exception from the local client libraries.", + "Look for errors in the local server's console to understand and correct the source of the error."), + + ; + + private final ExceptionMessageDefinition messageDefinition; + + + /** + * The constructor for ApacheAtlasErrorCode expects to be passed one of the enumeration rows defined in + * ApacheAtlasErrorCode above. For example: + * + * ApacheAtlasErrorCode errorCode = ApacheAtlasErrorCode.ERROR_SENDING_EVENT; + * + * This will expand out to the 5 parameters shown below. + * + * + * @param httpErrorCode error code to use over REST calls + * @param errorMessageId unique Id for the message + * @param errorMessage text for the message + * @param systemAction description of the action taken by the system when the error condition happened + * @param userAction instructions for resolving the error + */ + ApacheAtlasErrorCode(int httpErrorCode, String errorMessageId, String errorMessage, String systemAction, String userAction) + { + this.messageDefinition = new ExceptionMessageDefinition(httpErrorCode, + errorMessageId, + errorMessage, + systemAction, + userAction); + } + + + /** + * Retrieve a message definition object for an exception. This method is used when there are no message inserts. + * + * @return message definition object. + */ + @Override + public ExceptionMessageDefinition getMessageDefinition() + { + return messageDefinition; + } + + + /** + * Retrieve a message definition object for an exception. This method is used when there are values to be inserted into the message. + * + * @param params array of parameters (all strings). They are inserted into the message according to the numbering in the message text. + * @return message definition object. + */ + @Override + public ExceptionMessageDefinition getMessageDefinition(String... params) + { + messageDefinition.setMessageParameters(params); + + return messageDefinition; + } + + + /** + * JSON-style toString + * + * @return string of property names and values for this enum + */ + @Override + public String toString() + { + return "ApacheAtlasErrorCode{" + + "messageDefinition=" + messageDefinition + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/package-info.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/package-info.java new file mode 100644 index 00000000000..7e7d09196fe --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/package-info.java @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +/** + * FFDC stands for First Failure Data Capture. The classes in this package provide the message definitions and + * descriptions used by the kafka monitor integration connector. AtlasIntegrationConnectorAuditCode contains the + * messages for the audit log and the AtlasIntegrationConnectorErrorCode contains the messages for any exceptions + * that are thrown by the connectors. + */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc; diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/package-info.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/package-info.java new file mode 100644 index 00000000000..c047284f848 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * The Apache Atlas integration connector publishes glossary terms to Apache Atlas. + */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas; diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryAnchorElement.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryAnchorElement.java new file mode 100644 index 00000000000..bff9f1e9a17 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryAnchorElement.java @@ -0,0 +1,86 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AtlasRelatedTermHeader describes the relationship between a glossary and one of its terms. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AtlasGlossaryAnchorElement +{ + private String glossaryGuid = null; + private String relationGuid = null; + private String displayText = null; + + + public AtlasGlossaryAnchorElement() + { + } + + + public AtlasGlossaryAnchorElement(AtlasGlossaryAnchorElement template) + { + if (template != null) + { + glossaryGuid = template.getGlossaryGuid(); + relationGuid = template.getRelationGuid(); + displayText = template.getDisplayText(); + } + } + + + public String getGlossaryGuid() + { + return glossaryGuid; + } + + + public void setGlossaryGuid(String glossaryGuid) + { + this.glossaryGuid = glossaryGuid; + } + + + public String getRelationGuid() + { + return relationGuid; + } + + + public void setRelationGuid(String relationGuid) + { + this.relationGuid = relationGuid; + } + + + public String getDisplayText() + { + return displayText; + } + + + public void setDisplayText(String displayText) + { + this.displayText = displayText; + } + + + @Override + public String toString() + { + return "AtlasRelatedTermHeader{" + + "termGuid='" + glossaryGuid + '\'' + + ", relationGuid='" + relationGuid + '\'' + + ", displayText='" + displayText + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryBaseProperties.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryBaseProperties.java new file mode 100644 index 00000000000..4ef990c58bd --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryBaseProperties.java @@ -0,0 +1,156 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.HashMap; +import java.util.Map; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AtlasGlossaryBaseProperties describes the common properties found on all an Apache Atlas glossary elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AtlasGlossaryBaseProperties +{ + private String guid = null; + private String qualifiedName = null; + private String name = null; + private String shortDescription = null; + private String longDescription = null; + private Map additionalAttributes = null; + + + /** + * Standard constructor + */ + public AtlasGlossaryBaseProperties() + { + } + + + /** + * Copy/clone Constructor + * + * @param template object to copy + */ + public AtlasGlossaryBaseProperties(AtlasGlossaryBaseProperties template) + { + if (template != null) + { + guid = template.getGuid(); + qualifiedName = template.getQualifiedName(); + name = template.getQualifiedName(); + shortDescription = template.getShortDescription(); + longDescription = template.getLongDescription(); + additionalAttributes = template.getAdditionalAttributes(); + } + } + + + /** + * Return the unique identifier from Atlas. + * + * @return string + */ + public String getGuid() + { + return guid; + } + + + /** + * Set up the unique identifier from Atlas. + * + * @param guid string + */ + public void setGuid(String guid) + { + this.guid = guid; + } + + + /** + * Return the unique name from + * @return + */ + public String getQualifiedName() + { + return qualifiedName; + } + + + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + public String getName() + { + return name; + } + + + public void setName(String name) + { + this.name = name; + } + + + public String getShortDescription() + { + return shortDescription; + } + + + public void setShortDescription(String shortDescription) + { + this.shortDescription = shortDescription; + } + + + public String getLongDescription() + { + return longDescription; + } + + + public void setLongDescription(String longDescription) + { + this.longDescription = longDescription; + } + + + public Map getAdditionalAttributes() + { + return additionalAttributes; + } + + + public void setAdditionalAttributes(Map additionalAttributes) + { + this.additionalAttributes = additionalAttributes; + } + + + @Override + public String toString() + { + return "AtlasGlossaryBaseProperties{" + + "guid='" + guid + '\'' + + ", qualifiedName='" + qualifiedName + '\'' + + ", name='" + name + '\'' + + ", shortDescription='" + shortDescription + '\'' + + ", longDescription='" + longDescription + '\'' + + ", additionalAttributes=" + additionalAttributes + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryElement.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryElement.java new file mode 100644 index 00000000000..599d8e7b7b2 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryElement.java @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AtlasGlossaryElement describes an Apache Atlas glossary and its terms retrieved from Apache Atlas. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AtlasGlossaryElement extends AtlasGlossaryBaseProperties +{ + private AtlasRelatedTermHeader terms = null; + + + public AtlasGlossaryElement() + { + } + + + public AtlasGlossaryElement(AtlasGlossaryElement template) + { + super(template); + + if (template != null) + { + terms = template.getTerms(); + } + } + + + public AtlasRelatedTermHeader getTerms() + { + return terms; + } + + + public void setTerms(AtlasRelatedTermHeader terms) + { + this.terms = terms; + } + + + @Override + public String toString() + { + return "AtlasGlossaryElement{" + + "terms=" + terms + + ", guid='" + getGuid() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", name='" + getName() + '\'' + + ", shortDescription='" + getShortDescription() + '\'' + + ", longDescription='" + getLongDescription() + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryMemberBaseProperties.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryMemberBaseProperties.java new file mode 100644 index 00000000000..87768de4483 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryMemberBaseProperties.java @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + +/** + * AtlasGlossaryMemberBaseProperties is the base class for terms and categories. + */ +public class AtlasGlossaryMemberBaseProperties extends AtlasGlossaryBaseProperties +{ + private AtlasGlossaryAnchorElement anchor = null; + + + /** + * Standard constructor + */ + public AtlasGlossaryMemberBaseProperties() + { + } + + + /** + * Copy/clone Constructor + * + * @param template object to copy + */ + public AtlasGlossaryMemberBaseProperties(AtlasGlossaryMemberBaseProperties template) + { + super(template); + + if (template != null) + { + anchor = template.getAnchor(); + } + + } + + + public AtlasGlossaryAnchorElement getAnchor() + { + return anchor; + } + + + public void setAnchor(AtlasGlossaryAnchorElement anchor) + { + this.anchor = anchor; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryProperties.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryProperties.java new file mode 100644 index 00000000000..19203a285b6 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryProperties.java @@ -0,0 +1,88 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AtlasGlossaryProperties provides the properties of a glossary - used as part of a request body. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AtlasGlossaryProperties extends AtlasGlossaryBaseProperties +{ + private String language = null; + private String usage = null; + + + /** + * Standard constructor + */ + public AtlasGlossaryProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AtlasGlossaryProperties(AtlasGlossaryProperties template) + { + super(template); + + if (template != null) + { + language = template.getLanguage(); + usage = template.getUsage(); + } + } + + + public String getLanguage() + { + return language; + } + + + public void setLanguage(String language) + { + this.language = language; + } + + + public String getUsage() + { + return usage; + } + + + public void setUsage(String usage) + { + this.usage = usage; + } + + + @Override + public String toString() + { + return "AtlasGlossaryProperties{" + + "language='" + language + '\'' + + ", usage='" + usage + '\'' + + ", guid='" + getGuid() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", name='" + getName() + '\'' + + ", shortDescription='" + getShortDescription() + '\'' + + ", longDescription='" + getLongDescription() + '\'' + + ", additionalAttributes=" + getAdditionalAttributes() + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryTermProperties.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryTermProperties.java new file mode 100644 index 00000000000..8e29e4aa127 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasGlossaryTermProperties.java @@ -0,0 +1,88 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AtlasGlossaryTermProperties describes an Apache Atlas glossary term used to call Apache Atlas. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AtlasGlossaryTermProperties extends AtlasGlossaryMemberBaseProperties +{ + private String abbreviation = null; + private String usage = null; + + + /** + * Standard constructor + */ + public AtlasGlossaryTermProperties() + { + } + + + /** + * Copy/clone Constructor + * + * @param template object to copy + */ + public AtlasGlossaryTermProperties(AtlasGlossaryTermProperties template) + { + super(template); + + if (template != null) + { + abbreviation = template.getAbbreviation(); + usage = template.getUsage(); + } + } + + + public String getAbbreviation() + { + return abbreviation; + } + + + public void setAbbreviation(String abbreviation) + { + this.abbreviation = abbreviation; + } + + + public String getUsage() + { + return usage; + } + + + public void setUsage(String usage) + { + this.usage = usage; + } + + + @Override + public String toString() + { + return "AtlasGlossaryTermProperties{" + + "abbreviation='" + abbreviation + '\'' + + ", usage='" + usage + '\'' + + ", anchor=" + getAnchor() + + ", guid='" + getGuid() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", name='" + getName() + '\'' + + ", shortDescription='" + getShortDescription() + '\'' + + ", longDescription='" + getLongDescription() + '\'' + + ", additionalAttributes=" + getAdditionalAttributes() + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasRelatedTermHeader.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasRelatedTermHeader.java new file mode 100644 index 00000000000..e741f0124b7 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/properties/AtlasRelatedTermHeader.java @@ -0,0 +1,86 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AtlasRelatedTermHeader describes the relationship between a glossary and one of its terms. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AtlasRelatedTermHeader +{ + private String termGuid = null; + private String relationGuid = null; + private String displayText = null; + + + public AtlasRelatedTermHeader() + { + } + + + public AtlasRelatedTermHeader(AtlasRelatedTermHeader template) + { + if (template != null) + { + termGuid = template.getTermGuid(); + relationGuid = template.getRelationGuid(); + displayText = template.getDisplayText(); + } + } + + + public String getTermGuid() + { + return termGuid; + } + + + public void setTermGuid(String termGuid) + { + this.termGuid = termGuid; + } + + + public String getRelationGuid() + { + return relationGuid; + } + + + public void setRelationGuid(String relationGuid) + { + this.relationGuid = relationGuid; + } + + + public String getDisplayText() + { + return displayText; + } + + + public void setDisplayText(String displayText) + { + this.displayText = displayText; + } + + + @Override + public String toString() + { + return "AtlasRelatedTermHeader{" + + "termGuid='" + termGuid + '\'' + + ", relationGuid='" + relationGuid + '\'' + + ", displayText='" + displayText + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/AuditCodeTest.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/AuditCodeTest.java new file mode 100644 index 00000000000..50ce4d73818 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/AuditCodeTest.java @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc; + +import org.odpi.openmetadata.test.unittest.utilities.AuditLogMessageSetTest; +import org.testng.annotations.Test; + + +/** + * Verify the ApacheAtlasAuditCode enum contains unique message ids, non-null names and descriptions and can be + * serialized to JSON and back again. + */ +public class AuditCodeTest extends AuditLogMessageSetTest +{ + final static String messageIdPrefix = "APACHE-ATLAS-INTEGRATION-CONNECTOR"; + + /** + * Validated the values of the enum. + */ + @Test public void testAllAuditCodeValues() + { + for (ApacheAtlasAuditCode errorCode : ApacheAtlasAuditCode.values()) + { + super.testSingleAuditCodeValue(errorCode, messageIdPrefix); + } + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ErrorCodeTest.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ErrorCodeTest.java new file mode 100644 index 00000000000..631631544e8 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/test/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ErrorCodeTest.java @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.adapters.connectors.integration.apacheatlas.ffdc; + +import org.odpi.openmetadata.test.unittest.utilities.ExceptionMessageSetTest; +import org.testng.annotations.Test; + + +/** + * Verify the ApacheAtlasErrorCode enum contains unique message ids, non-null names and descriptions and can be + * serialized to JSON and back again. + */ +public class ErrorCodeTest extends ExceptionMessageSetTest +{ + final static String messageIdPrefix = "APACHE-ATLAS-INTEGRATION-CONNECTOR"; + + /** + * Validated the values of the enum. + */ + @Test public void testAllErrorCodeValues() + { + for (ApacheAtlasErrorCode errorCode : ApacheAtlasErrorCode.values()) + { + super.testSingleErrorCodeValue(errorCode, messageIdPrefix); + } + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorAuditCode.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorAuditCode.java index 2e23edb8aba..8deb8f75e7d 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorAuditCode.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorAuditCode.java @@ -113,11 +113,11 @@ public enum KafkaIntegrationConnectorAuditCode implements AuditLogMessageSet ; - private String logMessageId; - private OMRSAuditLogRecordSeverity severity; - private String logMessage; - private String systemAction; - private String userAction; + private final String logMessageId; + private final OMRSAuditLogRecordSeverity severity; + private final String logMessage; + private final String systemAction; + private final String userAction; /** @@ -135,10 +135,10 @@ public enum KafkaIntegrationConnectorAuditCode implements AuditLogMessageSet * @param userAction - instructions for resolving the situation, if any */ KafkaIntegrationConnectorAuditCode(String messageId, - OMRSAuditLogRecordSeverity severity, - String message, - String systemAction, - String userAction) + OMRSAuditLogRecordSeverity severity, + String message, + String systemAction, + String userAction) { this.logMessageId = messageId; this.severity = severity; diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorErrorCode.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorErrorCode.java index ebb0d6c7ad0..daf21c459c5 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorErrorCode.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/kafka-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/kafka/ffdc/KafkaIntegrationConnectorErrorCode.java @@ -26,6 +26,9 @@ */ public enum KafkaIntegrationConnectorErrorCode implements ExceptionMessageSet { + /** + * KAFKA-INTEGRATION-CONNECTOR-500-001 - The {0} integration connector received an unexpected exception {1} when cataloguing topics; the error message was: {2} + */ UNEXPECTED_EXCEPTION(500, "KAFKA-INTEGRATION-CONNECTOR-500-001", "The {0} integration connector received an unexpected exception {1} when cataloguing topics; the error message was: {2}", "The connector is unable to catalog one or more topics.", @@ -33,7 +36,7 @@ public enum KafkaIntegrationConnectorErrorCode implements ExceptionMessageSet ; - private ExceptionMessageDefinition messageDefinition; + private final ExceptionMessageDefinition messageDefinition; /** diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/RESTClient.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/RESTClient.java index 0222b525866..dc5af47d4bc 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/RESTClient.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/RESTClient.java @@ -24,7 +24,7 @@ public class RESTClient protected AuditLog auditLog = null; /* Initialized in constructor */ - private RESTClientConnector clientConnector; /* Initialized in constructor */ + private final RESTClientConnector clientConnector; /* Initialized in constructor */ /** diff --git a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java index 1b861d8060a..d55e4cd9713 100644 --- a/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java +++ b/open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/inmemory-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/inmemory/repositoryconnector/InMemoryOMRSMetadataCollection.java @@ -1715,14 +1715,22 @@ public EntityDetail undoEntityUpdate(String userId, */ EntityDetail currentEntity = repositoryStore.getEntity(entityGUID); EntityDetail restoredEntity = repositoryStore.retrievePreviousVersionOfEntity(entityGUID); - restoredEntity = repositoryHelper.incrementVersion(userId, currentEntity, restoredEntity); - repositoryValidator.validateEntityFromStore(repositoryName, entityGUID, restoredEntity, methodName); - repositoryValidator.validateEntityIsNotDeleted(repositoryName, restoredEntity, methodName); + if (restoredEntity != null) + { + restoredEntity = repositoryHelper.incrementVersion(userId, currentEntity, restoredEntity); - repositoryStore.addEntityToStore(restoredEntity); + repositoryValidator.validateEntityFromStore(repositoryName, entityGUID, restoredEntity, methodName); + repositoryValidator.validateEntityIsNotDeleted(repositoryName, restoredEntity, methodName); - return repositoryStore.getEntity(entityGUID); + repositoryStore.addEntityToStore(restoredEntity); + + return repositoryStore.getEntity(entityGUID); + } + else + { + return null; + } } diff --git a/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/README.md b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/README.md new file mode 100644 index 00000000000..63bfbd73bc1 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/README.md @@ -0,0 +1,14 @@ + + + +![Released](../../../../images/egeria-content-status-released.png#pagewidth) + +# Secrets Store Connectors + +The secrets store connectors provide access to secrets, such as passwords and certificates, at runtime. + +Return to [open-connectors](..) + +---- +License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), +Copyright Contributors to the ODPi Egeria project. \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/README.md b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/README.md new file mode 100644 index 00000000000..38472571612 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/README.md @@ -0,0 +1,17 @@ + + + +# The Environment Variable Secrets Store Connector + +The *Environment Variable Secrets Store Connector* retrieves secrets from environment variables. The name of the secret requested is the name of the environment variable it tries to retrieve. It returns null if the environment variable is not defined. + +## Deployment and configuration + +See [https://egeria-project.org/connectors/secrets/environment-variable-secrets-store-connector](https://egeria-project.org/connectors/secrets/environment-variable-secrets-store-connector) + +---- +* Return to [Secrets Store Connectors module](..) + +---- +License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), +Copyright Contributors to the ODPi Egeria project. \ No newline at end of file diff --git a/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/build.gradle b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/build.gradle new file mode 100644 index 00000000000..ee1d312ada4 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/build.gradle @@ -0,0 +1,22 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Contributors to the ODPi Egeria project. + */ + + +dependencies { + compileOnly project(':open-metadata-implementation:frameworks:audit-log-framework') + compileOnly project(':open-metadata-implementation:frameworks:open-connector-framework') +} + +description = 'Environment Variable Secrets Store Connector' + +java { + withJavadocJar() +} + +test { + useTestNG() + // This will default to standard search pattern - see https://docs.gradle.org/current/userguide/java_testing.html#sec:test_detection + scanForTestClasses = false +} diff --git a/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreConnector.java b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreConnector.java new file mode 100644 index 00000000000..895bac2b852 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreConnector.java @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.secretsstore.envar; + +import org.odpi.openmetadata.frameworks.connectors.SecretsStoreConnector; + +/** + * EnvVarSecretsStoreConnector retrieves secrets from environment variables. Each secret is named for its environment variable. + */ +public class EnvVarSecretsStoreConnector extends SecretsStoreConnector +{ + /** + * Retrieve a secret from the secrets store. + * + * @param secretName name of the secret. + * @return secret + */ + @Override + public String getSecret(String secretName) + { + return System.getenv(secretName); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreProvider.java b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreProvider.java new file mode 100644 index 00000000000..a9a9dfd2823 --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/EnvVarSecretsStoreProvider.java @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.adapters.connectors.secretsstore.envar; + +import org.odpi.openmetadata.frameworks.auditlog.AuditLogReportingComponent; +import org.odpi.openmetadata.frameworks.connectors.ConnectorProviderBase; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; + + +/** + * EnvVarSecretsStoreProvider is the connector provider for the Apache Atlas integration connector that publishes glossary terms to Apache Atlas. + */ +public class EnvVarSecretsStoreProvider extends ConnectorProviderBase +{ + /* + * Unique identifier of the connector for the audit log. + */ + private static final int connectorComponentId = 660; + + /* + * Unique identifier for the connector type. + */ + private static final String connectorTypeGUID = "2b797adb-f776-421f-9d72-ef47b38ddcdd"; + + /* + * Descriptive information about the connector for the connector type and audit log. + */ + private static final String connectorQualifiedName = "Egeria:SecretsStoreConnector:EnvironmentVariable"; + private static final String connectorDisplayName = "Environment Variable Secrets Store Connector"; + private static final String connectorDescription = "Connector retrieves secrets from environment variables."; + private static final String connectorWikiPage = "https://egeria-project.org/connectors/secrets/environment-variable-secrets-store-connector/"; + + /* + * Class of the connector. + */ + private static final Class connectorClass = EnvVarSecretsStoreConnector.class; + + /** + * Constructor used to initialize the ConnectorProvider with the Java class name of the specific + * store implementation. + */ + public EnvVarSecretsStoreProvider() + { + super(); + + /* + * Set up the class name of the connector that this provider creates. + */ + super.setConnectorClassName(connectorClass.getName()); + + /* + * Set up the connector type that should be included in a connection used to configure this connector. + */ + ConnectorType connectorType = new ConnectorType(); + connectorType.setType(ConnectorType.getConnectorTypeType()); + connectorType.setGUID(connectorTypeGUID); + connectorType.setQualifiedName(connectorQualifiedName); + connectorType.setDisplayName(connectorDisplayName); + connectorType.setDescription(connectorDescription); + connectorType.setConnectorProviderClassName(this.getClass().getName()); + + super.connectorTypeBean = connectorType; + + /* + * Set up the component description used in the connector's audit log messages. + */ + AuditLogReportingComponent componentDescription = new AuditLogReportingComponent(); + + componentDescription.setComponentId(connectorComponentId); + componentDescription.setComponentName(connectorQualifiedName); + componentDescription.setComponentDescription(connectorDescription); + componentDescription.setComponentWikiURL(connectorWikiPage); + + super.setConnectorComponentDescription(componentDescription); + } +} diff --git a/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/package-info.java b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/package-info.java new file mode 100644 index 00000000000..29464425a8d --- /dev/null +++ b/open-metadata-implementation/adapters/open-connectors/secrets-store-connectors/env-variable-secrets-store-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/secretsstore/envar/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * The Environment Variable Secrets Store Connector retrieves secrets from environment variables. Each secret is named for its environment variable.. + */ +package org.odpi.openmetadata.adapters.connectors.secretsstore.envar; diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java index 2d9961a7bc8..78efe4e5756 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java @@ -1576,7 +1576,7 @@ public void addAssetOrigin(String userId, /* * Validate the organization and the business capability exist. */ - if (organizationGUID != null) + if (organizationGUID != null) { this.validateAnchorEntity(userId, organizationGUID, @@ -1671,6 +1671,157 @@ public void removeAssetOrigin(String userId, } + /** + * Returns the list of assets that are classified with a specific origin. + * + * @param userId userId of user making request + * @param organizationGUID Unique identifier (GUID) of the organization where this asset originated from - or null + * @param businessCapabilityGUID Unique identifier (GUID) of the business capability where this asset originated from. + * @param otherOriginValues Descriptive labels describing origin of the asset + * @param serviceSupportedZones supported zones for calling service + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of elements or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getAssetsFromOrigin(String userId, + String organizationGUID, + String businessCapabilityGUID, + Map otherOriginValues, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "originEntity.getGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + + int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + List entities = repositoryHandler.getEntitiesForClassificationType(userId, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + OpenMetadataAPIMapper.ASSET_ORIGIN_CLASSIFICATION_NAME, + forLineage, + forDuplicateProcessing, + startFrom, + queryPageSize, + effectiveTime, + methodName); + + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + try + { + this.validateAnchorEntity(userId, + entity.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + entity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + Classification classification = repositoryHelper.getClassificationFromEntity(serviceName, + entity, + OpenMetadataAPIMapper.ASSET_ORIGIN_CLASSIFICATION_NAME, + methodName); + if (classification != null) + { + String orgGUID = repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.ORGANIZATION_PROPERTY_NAME, + classification.getProperties(), + methodName); + + String bcGUID = repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.BUSINESS_CAPABILITY_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if ((organizationGUID == null) || (organizationGUID.equals(orgGUID))) + { + if (((businessCapabilityGUID == null) || (businessCapabilityGUID.equals(bcGUID)))) + { + if ((otherOriginValues == null) || (otherOriginValues.isEmpty())) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + else + { + Map retrievedOtherOriginValues = repositoryHelper.getStringMapFromProperty(serviceName, + OpenMetadataAPIMapper.OTHER_ORIGIN_VALUES_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if ((retrievedOtherOriginValues != null) && (! retrievedOtherOriginValues.isEmpty())) + { + boolean match = true; + + for (String otherOrgValuePropertyName : otherOriginValues.keySet()) + { + if (otherOrgValuePropertyName != null) + { + if (otherOriginValues.get(otherOrgValuePropertyName) != null) + { + if (! otherOriginValues.get(otherOrgValuePropertyName).equals(retrievedOtherOriginValues.get(otherOrgValuePropertyName))) + { + match = false; + } + } + else if (retrievedOtherOriginValues.get(otherOrgValuePropertyName) != null) + { + match = false; + } + } + } + + if (match) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + } + } + } + } + } + catch (Exception notVisible) + { + // entity not visible + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + + /** * Update the zones for a specific asset to the list set up in publish zones. * diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommentHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommentHandler.java index dcd1767d4d6..e7d8a2afd2a 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommentHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/CommentHandler.java @@ -149,6 +149,70 @@ public String attachNewComment(String userId, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException + { + return attachNewComment(userId, + externalSourceGUID, + externalSourceName, + anchorGUID, + parentGUID, + parentGUIDParameterName, + null, + commentType, + commentText, + isPublic, + effectiveFrom, + effectiveTo, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Adds a comment and link it to the supplied parent entity. + * + * @param userId String - userId of user making request. + * @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 anchorGUID head of the comment chain + * @param parentGUID String - unique id for a referenceable entity that the comment is to be attached to. + * @param parentGUIDParameterName name of parameter that supplied the entity's unique identifier. + * @param suppliedQualifiedName unique identifier for the comment + * @param commentType ordinal of comment enum. + * @param commentText String - the text of the comment. + * @param isPublic should this be visible to all or private to the caller + * @param effectiveFrom the date when this element is active - null for active now + * @param effectiveTo the date when this element becomes inactive - null for active until deleted + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @return guid of new comment. + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException There is a problem adding the asset properties to + * the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public String attachNewComment(String userId, + String externalSourceGUID, + String externalSourceName, + String anchorGUID, + String parentGUID, + String parentGUIDParameterName, + String suppliedQualifiedName, + int commentType, + String commentText, + boolean isPublic, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { final String textParameter = "commentText"; final String commentGUIDParameter = "commentGUID"; @@ -157,11 +221,16 @@ public String attachNewComment(String userId, invalidParameterHandler.validateGUID(parentGUID, parentGUIDParameterName, methodName); invalidParameterHandler.validateText(commentText, textParameter, methodName); + String qualifiedName = suppliedQualifiedName; + if (qualifiedName == null) + { + qualifiedName = UUID.randomUUID().toString(); + } + /* * A comment is a referenceable. It needs a unique qualified name. There is no obvious value to use so * a UUID is used to create a unique string. */ - String qualifiedName = UUID.randomUUID().toString(); CommentBuilder builder = new CommentBuilder(qualifiedName, commentType, commentText, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java index a533fe106c5..3712020024a 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableBuilder.java @@ -420,8 +420,8 @@ InstanceProperties getTemplateProperties(String name, */ InstanceProperties getDataFieldValuesProperties(String defaultValue, List sampleValues, - String dataPattern, - String namePattern, + List dataPattern, + List namePattern, String methodName) { InstanceProperties properties; @@ -438,17 +438,17 @@ InstanceProperties getDataFieldValuesProperties(String defaultValue sampleValues, methodName); - properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DATA_PATTERN_PROPERTY_NAME, dataPattern, methodName); - properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataAPIMapper.NAME_PATTERN_PROPERTY_NAME, - namePattern, - methodName); + properties = repositoryHelper.addStringArrayPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.NAME_PATTERN_PROPERTY_NAME, + namePattern, + methodName); setEffectivityDates(properties); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java index 6f3c754c473..4377262c5b9 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java @@ -913,6 +913,108 @@ public void removeOwner(String userId, } + /** + * Returns the list of elements that are classified with a specific owner. + * + * @param userId String userId of user making request. + * @param ownerName String unique identifier for the owner. + * @param serviceSupportedZones supported zones for calling service + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of elements or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getOwnersElements(String userId, + String ownerName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "ownerEntity.getGUID"; + final String nameParameterName = "ownerName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(ownerName, nameParameterName, methodName); + + int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + List entities = repositoryHandler.getEntitiesForClassificationType(userId, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + OpenMetadataAPIMapper.OWNERSHIP_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + startFrom, + queryPageSize, + effectiveTime, + methodName); + + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + try + { + this.validateAnchorEntity(userId, + entity.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + entity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + Classification classification = repositoryHelper.getClassificationFromEntity(serviceName, + entity, + OpenMetadataAPIMapper.OWNERSHIP_CLASSIFICATION_TYPE_NAME, + methodName); + if (classification != null) + { + String name = repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.OWNER_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if ((ownerName == null) || (ownerName.equals(name))) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + } + catch (Exception notVisible) + { + // entity not visible + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + /** * Add or replace the security tags for a referenceable. @@ -1012,6 +1114,89 @@ public void removeSecurityTags(String userId, } + /** + * Returns the list of assets that are classified with a specific origin. + * + * @param userId userId of user making request + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of elements or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getSecurityTagsClassifiedElements(String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "taggedEntity.getGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + + int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + List entities = repositoryHandler.getEntitiesForClassificationType(userId, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.SECURITY_TAG_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + startFrom, + queryPageSize, + effectiveTime, + methodName); + + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + try + { + this.validateAnchorEntity(userId, + entity.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + entity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + catch (Exception notVisible) + { + // entity not visible + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + + /** * Add or replace the governance action classification on a referenceable. * @@ -1143,6 +1328,117 @@ public void removeGovernanceActionClassification(String userId, } + /** + * Returns the list of elements that are classified with a specific owner. + * + * @param userId String userId of user making request. + * @param classificationName unique name for the governance action classification + * @param returnSpecificLevel flag indicating whether to filter by levelIdentifier + * @param levelIdentifier filter value + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of elements or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getGovernanceActionClassifiedElements(String userId, + String classificationName, + boolean returnSpecificLevel, + int levelIdentifier, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "classifiedEntity.getGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + + int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + List entities = repositoryHandler.getEntitiesForClassificationType(userId, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + classificationName, + forLineage, + forDuplicateProcessing, + startFrom, + queryPageSize, + effectiveTime, + methodName); + + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + try + { + this.validateAnchorEntity(userId, + entity.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + entity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + Classification classification = repositoryHelper.getClassificationFromEntity(serviceName, + entity, + classificationName, + methodName); + if (classification != null) + { + if (returnSpecificLevel) + { + int storedLevelIdentifier = repositoryHelper.getIntProperty(serviceName, + OpenMetadataAPIMapper.LEVEL_IDENTIFIER_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if (levelIdentifier == storedLevelIdentifier) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + else + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + } + catch (Exception notVisible) + { + // entity not visible + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + + /** * Add or replace the governance action classification on a referenceable. * @@ -1208,6 +1504,9 @@ public void addRetentionClassification(String userId, properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.SOURCE_PROPERTY_NAME, source, methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.NOTES_PROPERTY_NAME, notes, methodName); properties = repositoryHelper.addIntPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.BASIS_IDENTIFIER_PROPERTY_NAME, basisIdentifier, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.RETENTION_ASSOCIATED_GUID_PROPERTY_NAME, associatedGUID, methodName); + properties = repositoryHelper.addDatePropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.RETENTION_ARCHIVE_AFTER_PROPERTY_NAME, archiveAfter, methodName); + properties = repositoryHelper.addDatePropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.RETENTION_DELETE_AFTER_PROPERTY_NAME, deleteAfter, methodName); this.setClassificationInRepository(userId, externalSourceGUID, @@ -1272,6 +1571,115 @@ public void removeRetentionClassification(String userId, } + /** + * Returns the list of elements that are classified with a specific owner. + * + * @param userId String userId of user making request. + * @param returnSpecificBasisLevel flag indicating whether to filter by levelIdentifier + * @param levelIdentifier filter value + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of elements or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getRetentionClassifiedElements(String userId, + boolean returnSpecificBasisLevel, + int levelIdentifier, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "classifiedEntity.getGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + + int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + List entities = repositoryHandler.getEntitiesForClassificationType(userId, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_GUID, + OpenMetadataAPIMapper.RETENTION_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + startFrom, + queryPageSize, + effectiveTime, + methodName); + + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + try + { + this.validateAnchorEntity(userId, + entity.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + entity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + Classification classification = repositoryHelper.getClassificationFromEntity(serviceName, + entity, + OpenMetadataAPIMapper.RETENTION_CLASSIFICATION_TYPE_NAME, + methodName); + if (classification != null) + { + if (returnSpecificBasisLevel) + { + int storedLevelIdentifier = repositoryHelper.getIntProperty(serviceName, + OpenMetadataAPIMapper.BASIS_IDENTIFIER_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if (levelIdentifier == storedLevelIdentifier) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + else + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + } + catch (Exception notVisible) + { + // entity not visible + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + + /** * Add or replace the governance expectations classification to a referenceable. * @@ -1591,8 +1999,6 @@ public void removeSubjectAreaClassification(String userId, } - - /** * Returns the list of elements that are classified with a subject area name. * @@ -1960,8 +2366,8 @@ public void addDataFieldValuesClassification(String userId, String beanGUIDTypeName, String defaultValue, List sampleValues, - String dataPattern, - String namePattern, + List dataPattern, + List namePattern, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, @@ -2033,6 +2439,157 @@ public void removeDataFieldValuesClassification(String userId, methodName); } + /** + * Returns the list of elements that are classified with a specific set of DataFieldValues properties. + * + * @param userId userId of user making request + * @param organizationGUID Unique identifier (GUID) of the organization where this asset originated from - or null + * @param businessCapabilityGUID Unique identifier (GUID) of the business capability where this asset originated from. + * @param otherOriginValues Descriptive labels describing origin of the asset + * @param serviceSupportedZones supported zones for calling service + * @param startFrom int starting position for fist returned element. + * @param pageSize int maximum number of elements to return on the call. + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName String calling method + * + * @return a list of elements or + * @throws InvalidParameterException - the GUID is not recognized or the paging values are invalid or + * @throws PropertyServerException - there is a problem retrieving the asset properties from the property server or + * @throws UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public List getDataFieldValuesClassifiedElement(String userId, + String organizationGUID, + String businessCapabilityGUID, + Map otherOriginValues, + List serviceSupportedZones, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String guidParameterName = "originEntity.getGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + + int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + List entities = repositoryHandler.getEntitiesForClassificationType(userId, + OpenMetadataAPIMapper.ASSET_TYPE_NAME, + OpenMetadataAPIMapper.ASSET_ORIGIN_CLASSIFICATION_NAME, + forLineage, + forDuplicateProcessing, + startFrom, + queryPageSize, + effectiveTime, + methodName); + + if (entities != null) + { + List beans = new ArrayList<>(); + + for (EntityDetail entity : entities) + { + if (entity != null) + { + try + { + this.validateAnchorEntity(userId, + entity.getGUID(), + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + entity, + guidParameterName, + false, + forLineage, + forDuplicateProcessing, + serviceSupportedZones, + effectiveTime, + methodName); + + Classification classification = repositoryHelper.getClassificationFromEntity(serviceName, + entity, + OpenMetadataAPIMapper.ASSET_ORIGIN_CLASSIFICATION_NAME, + methodName); + if (classification != null) + { + String orgGUID = repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.ORGANIZATION_PROPERTY_NAME, + classification.getProperties(), + methodName); + + String bcGUID = repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.BUSINESS_CAPABILITY_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if ((organizationGUID == null) || (organizationGUID.equals(orgGUID))) + { + if (((businessCapabilityGUID == null) || (businessCapabilityGUID.equals(bcGUID)))) + { + if ((otherOriginValues == null) || (otherOriginValues.isEmpty())) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + else + { + Map retrievedOtherOriginValues = repositoryHelper.getStringMapFromProperty(serviceName, + OpenMetadataAPIMapper.OTHER_ORIGIN_VALUES_PROPERTY_NAME, + classification.getProperties(), + methodName); + + if ((retrievedOtherOriginValues != null) && (! retrievedOtherOriginValues.isEmpty())) + { + boolean match = true; + + for (String otherOrgValuePropertyName : otherOriginValues.keySet()) + { + if (otherOrgValuePropertyName != null) + { + if (otherOriginValues.get(otherOrgValuePropertyName) != null) + { + if (! otherOriginValues.get(otherOrgValuePropertyName).equals(retrievedOtherOriginValues.get(otherOrgValuePropertyName))) + { + match = false; + } + } + else if (retrievedOtherOriginValues.get(otherOrgValuePropertyName) != null) + { + match = false; + } + } + } + + if (match) + { + beans.add(converter.getNewBean(beanClass, entity, methodName)); + } + } + } + } + } + } + } + catch (Exception notVisible) + { + // entity not visible + } + } + } + + if (! beans.isEmpty()) + { + return beans; + } + } + + return null; + } + /** * Page through the list of consumers for a valid value. diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java index cb13fca2d31..47f6656df8e 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java @@ -11,6 +11,8 @@ import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; +import java.io.Serial; +import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -34,12 +36,13 @@ * particular type of asset it supports. For example, a JDBC connector would add the standard JDBC SQL interface, the * OMRS Connectors add the metadata repository management APIs... */ -public abstract class ConnectorBase extends Connector +public abstract class ConnectorBase extends Connector implements SecureConnectorExtension { protected String connectorInstanceId = null; protected ConnectionProperties connectionProperties = null; protected Connection connectionBean = null; - protected ConnectedAssetProperties connectedAssetProperties = null; + protected ConnectedAssetProperties connectedAssetProperties = null; + protected Map secretsStoreConnectorMap = new HashMap<>(); private volatile boolean isActive = false; @@ -133,6 +136,27 @@ public void initializeConnectedAssetProperties(ConnectedAssetProperties connecte } + /** + * Set up information about an embedded connector that this connector can use to support secure access to its resources. + * + * @param displayName name of the secrets store + * @param secretsStoreConnector an embedded secrets store connector + */ + @Override + public void initializeSecretsStoreConnector(String displayName, + SecretsStoreConnector secretsStoreConnector) + { + if (displayName != null) + { + secretsStoreConnectorMap.put(displayName, secretsStoreConnector); + } + else + { + secretsStoreConnectorMap.put(String.valueOf(secretsStoreConnectorMap.size()), secretsStoreConnector); + } + } + + /** * Returns the properties that contain the metadata for the asset. The asset metadata is retrieved from the * metadata repository and cached in the ConnectedAssetProperties object each time the getConnectedAssetProperties @@ -183,8 +207,6 @@ public synchronized void disconnect() throws ConnectorCheckedException } - - /** * Return a flag indicating whether the connector is active. This means it has been started and not yet * disconnected. @@ -260,8 +282,14 @@ public String toString() */ protected static class ProtectedConnection extends ConnectionProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; + /** + * Copy/clone connector. + * + * @param templateConnection connection to copy + */ ProtectedConnection(ConnectionProperties templateConnection) { super(templateConnection); diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java index 28feb334add..fb458a08e3b 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBroker.java @@ -14,6 +14,7 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; import org.odpi.openmetadata.frameworks.connectors.properties.beans.VirtualConnection; +import java.io.Serial; import java.util.*; /** @@ -24,8 +25,10 @@ public class ConnectorBroker { private static final Logger log = LoggerFactory.getLogger(ConnectorBroker.class); - private final int hashCode = UUID.randomUUID().hashCode(); + private static final String userIdPropertyName = "userId"; + private static final String clearPasswordPropertyName = "clearPassword"; + private static final String encryptedPasswordPropertyName = "encryptedPassword"; private AuditLog auditLog = null; @@ -55,12 +58,12 @@ public ConnectorBroker(AuditLog auditLog) * are not null. * * @param connection connection properties - * @param methodName calling method * @throws ConnectionCheckedException null connection detected */ - private void validateConnectionNotNull(ConnectionProperties connection, - String methodName) throws ConnectionCheckedException + private void validateConnectionNotNull(ConnectionProperties connection) throws ConnectionCheckedException { + final String methodName = "validateConnectionNotNull"; + if (connection == null) { /* @@ -71,9 +74,8 @@ private void validateConnectionNotNull(ConnectionProperties connection, methodName); } - if (connection instanceof VirtualConnectionProperties) + if (connection instanceof VirtualConnectionProperties virtualConnection) { - VirtualConnectionProperties virtualConnection = (VirtualConnectionProperties)connection; List embeddedConnections = virtualConnection.getEmbeddedConnections(); if ((embeddedConnections == null) || (embeddedConnections.isEmpty())) @@ -135,7 +137,7 @@ private ConnectorProvider getConnectorProvider(ConnectorTypeProperties reques if (connectorProviderClassName == null) { /* - * The connector provider class name is blank so it is not possible to create the + * The connector provider class name is blank, so it is not possible to create the * connector provider. Throw an exception. */ throw new ConnectionCheckedException(OCFErrorCode.NULL_CONNECTOR_PROVIDER.getMessageDefinition(connectionName), @@ -217,8 +219,6 @@ private ConnectionProperties getConnection(EmbeddedConnectionProperties embe AccessibleConnection accessibleConnection = new AccessibleConnection(embeddedConnection.getConnectionProperties()); Connection connectionBean = accessibleConnection.getConnectionBean(); - int position = embeddedConnection.getPosition(); - String displayName = embeddedConnection.getDisplayName(); Map arguments = embeddedConnection.getArguments(); if (arguments != null) @@ -256,7 +256,7 @@ private ConnectionProperties getConnection(EmbeddedConnectionProperties embe * @param connection connection properties * @throws ConnectionCheckedException an error with the connection. */ - public void validateConnection(Connection connection) throws ConnectionCheckedException + public void validateConnection(Connection connection) throws ConnectionCheckedException { if (connection == null) { @@ -282,7 +282,7 @@ public void validateConnection(ConnectionProperties connection) throws Connec log.debug("==> ConnectorBroker." + methodName); - validateConnectionNotNull(connection, methodName); + validateConnectionNotNull(connection); ConnectorTypeProperties requestedConnectorType = this.getConnectorType(connection, methodName); @@ -365,7 +365,7 @@ public Connector getConnector(ConnectionProperties connection) throws Connection /* * At this point we hopefully have a valid connector provider so all that is left to do is call * it to get the connector instance. This is done in a different try ... catch block from the - * instantiation of the connector provider so we can separate errors in the Connection from + * instantiation of the connector provider, so we can separate errors in the Connection from * errors generated in the Connector Provider, since both classes are * potentially code from a source outside of Egeria. */ @@ -373,6 +373,9 @@ public Connector getConnector(ConnectionProperties connection) throws Connection try { + /* + * The connector is initialized status at this point. + */ connectorInstance = connectorProvider.getConnector(connection); } catch (ConnectionCheckedException | ConnectorCheckedException ocfError) @@ -417,11 +420,12 @@ public Connector getConnector(ConnectionProperties connection) throws Connection * should have created a VirtualConnector and (2) the connector broker needs to create * connectors for its embedded connections. */ - if (connection instanceof VirtualConnectionProperties) + if (connection instanceof VirtualConnectionProperties virtualConnectionProperties) { - if (connectorInstance instanceof VirtualConnectorExtension) + if (connectorInstance instanceof VirtualConnectorExtension virtualConnectorExtension) { - VirtualConnectorExtension virtualConnectorExtension = (VirtualConnectorExtension)connectorInstance; + AccessibleConnection accessibleConnection = new AccessibleConnection(connection); + Connection connectionBean = accessibleConnection.getConnectionBean(); /* * All ok so create the embedded connectors. Note: one of these connectors may itself be @@ -430,13 +434,64 @@ public Connector getConnector(ConnectionProperties connection) throws Connection */ log.debug("Creating embedded connectors for connection name: " + connectionName + "; connectorId: " + connectorInstance.getConnectorInstanceId()); - VirtualConnectionProperties virtualConnectionProperties = (VirtualConnectionProperties) connection; List embeddedConnections = virtualConnectionProperties.getEmbeddedConnections(); List embeddedConnectors = new ArrayList<>(); for (EmbeddedConnectionProperties embeddedConnection : embeddedConnections) { - embeddedConnectors.add(getConnector(this.getConnection(embeddedConnection))); + Connector embeddedConnector = getConnector(this.getConnection(embeddedConnection)); + + /* + * If the embedded connector is a secrets store connector, extract the standard secrets and add them to the new + * connector's connection. It first tries to retrieve the secrets directly from the store, or via any names specified in the + * securedProperties. + */ + if (embeddedConnector instanceof SecretsStoreConnector secretsStoreConnector) + { + if (connectionBean.getUserId() == null) + { + connectionBean.setUserId(secretsStoreConnector.getSecret(userIdPropertyName)); + + if (connectionBean.getUserId() == null) + { + if ((connection.getSecuredProperties() != null) && (connection.getSecuredProperties().get(userIdPropertyName) != null)) + { + connectionBean.setUserId(secretsStoreConnector.getSecret(connection.getSecuredProperties().get(userIdPropertyName))); + } + } + } + if (connection.getClearPassword() == null) + { + connectionBean.setClearPassword(secretsStoreConnector.getSecret(clearPasswordPropertyName)); + + if (connectionBean.getClearPassword() == null) + { + if ((connection.getSecuredProperties() != null) && (connection.getSecuredProperties().get(clearPasswordPropertyName) != null)) + { + connectionBean.setClearPassword(secretsStoreConnector.getSecret(connection.getSecuredProperties().get(clearPasswordPropertyName))); + } + } + } + if (connection.getEncryptedPassword() == null) + { + connectionBean.setEncryptedPassword(secretsStoreConnector.getSecret(encryptedPasswordPropertyName)); + + if (connectionBean.getEncryptedPassword() == null) + { + if ((connection.getSecuredProperties() != null) && (connection.getSecuredProperties().get(encryptedPasswordPropertyName) != null)) + { + connectionBean.setEncryptedPassword(secretsStoreConnector.getSecret(connection.getSecuredProperties().get(encryptedPasswordPropertyName))); + } + } + } + + if (connectorInstance instanceof SecureConnectorExtension secureConnectorExtension) + { + secureConnectorExtension.initializeSecretsStoreConnector(embeddedConnection.getDisplayName(), secretsStoreConnector); + } + } + + embeddedConnectors.add(embeddedConnector); } virtualConnectorExtension.initializeEmbeddedConnectors(embeddedConnectors); @@ -466,43 +521,6 @@ public Connector getConnector(ConnectionProperties connection) throws Connection } - /** - * Provide an implementation of hashCode for all OCF Connector Broker objects. The UUID is unique and - * is randomly assigned and so its hashCode is as good as anything to describe the hash code of the connector - * broker object. - */ - public int hashCode() - { - return hashCode; - } - - - /** - * Provide a common implementation of equals for all OCF Connector Broker objects. The UUID is unique and - * is randomly assigned and so its hashCode is as good as anything to evaluate the equality of the connector - * broker object. - * - * @param object object to test - * @return boolean flag - */ - @Override - public boolean equals(Object object) - { - if (this == object) - { - return true; - } - if (object == null || getClass() != object.getClass()) - { - return false; - } - - ConnectorBroker that = (ConnectorBroker) object; - - return hashCode == that.hashCode; - } - - /** * Standard toString method. * @@ -511,9 +529,7 @@ public boolean equals(Object object) @Override public String toString() { - return "ConnectorBroker{" + - "hashCode=" + hashCode + - '}'; + return "ConnectorBroker{}"; } @@ -523,7 +539,8 @@ public String toString() */ private static class AccessibleConnection extends ConnectionProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; AccessibleConnection(ConnectionProperties templateConnection) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecretsStoreConnector.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecretsStoreConnector.java new file mode 100644 index 00000000000..2e24d43c0f3 --- /dev/null +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecretsStoreConnector.java @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.connectors; + +/** + * SecretsStoreConnector is the interface for a connector that is able to retrieve secrets (passwords, certificates, ...) from a secure location. + * The secrets store connector is embedded in a connector that needs one or more secrets to perform its tasks. Both connectors are initialised + * together by the ConnectorBroker. The secrets store connector is called by the surrounding connector to extract the needed secrets. + * + * When the ConnectorBroker detects that there is a secrets store connector embedded in another connector, it attempts to retrieve the standard + * secrets for the corresponding connection object (if they are null): + * + *
    + *
  • userId
  • + *
  • clearPassword
  • + *
  • encryptedPassword
  • + *
+ * + * This means that even if the outer connector is written to expect these secrets in its connection object, they do not need to be stored + * in the connection object (ie in the configuration document or in the metadata store) but will be placed in the right fields by the + * ConnectorBroker. + * + * If the name(s) of the secret(s) needed by the connector must be configured, they can be stored in the secureProperties. + */ +public abstract class SecretsStoreConnector extends ConnectorBase +{ + /** + * Retrieve a secret from the secrets store. + * + * @param secretName name of the secret. + * @return secret + */ + abstract public String getSecret(String secretName); +} diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecureConnectorExtension.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecureConnectorExtension.java new file mode 100644 index 00000000000..90b6c6235cb --- /dev/null +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/SecureConnectorExtension.java @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.frameworks.connectors; + + +/** + * The SecureConnectorExtension is an optional interface for a virtual connector. A virtual connector is + * a connector that uses embedded connectors to access its data resources. The secure connector interface requests + * that the connector is informed of any secrets store connectors that are found in the embedded connectors. + */ +public interface SecureConnectorExtension +{ + /** + * Set up information about an embedded connector that this connector can use to support secure access to its resources. + * + * @param displayName name of the secrets store + * @param secretsStoreConnector an embedded secrets store connector + */ + void initializeSecretsStoreConnector(String displayName, + SecretsStoreConnector secretsStoreConnector); +} diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java index dfb98de068e..c140016bf89 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/ConnectionProperties.java @@ -6,6 +6,7 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.ConnectorType; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Endpoint; +import java.io.Serial; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -66,7 +67,8 @@ */ public class ConnectionProperties extends AssetReferenceable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; protected Connection connectionBean; @@ -279,7 +281,7 @@ public Map getConfigurationProperties() * * @return secured properties typically user credentials for the connection */ - protected Map getSecuredProperties() + public Map getSecuredProperties() { return connectionBean.getSecuredProperties(); } diff --git a/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/IntegrationContext.java b/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/IntegrationContext.java index 4886532fb20..8a2c550de1f 100644 --- a/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/IntegrationContext.java +++ b/open-metadata-implementation/frameworks/open-integration-framework/src/main/java/org/odpi/openmetadata/frameworks/integration/context/IntegrationContext.java @@ -6,6 +6,8 @@ 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.ElementClassification; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; import org.odpi.openmetadata.frameworks.governanceaction.client.OpenMetadataClient; import org.odpi.openmetadata.frameworks.integration.client.OpenIntegrationClient; import org.odpi.openmetadata.frameworks.integration.contextmanager.PermittedSynchronization; @@ -13,6 +15,7 @@ import org.odpi.openmetadata.frameworks.integration.reports.IntegrationReportWriter; import java.util.List; +import java.util.Map; /** * IntegrationContext is the base class for the integration context provided to the integration connector to provide access to open metadata @@ -94,7 +97,6 @@ public IntegrationContext(String connectorId, } - /** * Return a new integrationGovernanceContext for a specific connector. * @@ -313,4 +315,38 @@ public void publishReport() throws InvalidParameterException, integrationReportWriter.publishReport(); } } + + + + /** + * Retrieve the anchorGUID from the Anchors classification. + * + * @param elementHeader element header where the classifications reside + * @return anchorGUID or null + */ + public String getAnchorGUID(ElementHeader elementHeader) + { + if (elementHeader.getClassifications() != null) + { + for (ElementClassification classification : elementHeader.getClassifications()) + { + if (classification.getClassificationName().equals("Anchors")) + { + Map properties = classification.getClassificationProperties(); + + if (properties != null) + { + Object anchorGUID = properties.get("anchorGUID"); + + if (anchorGUID != null) + { + return anchorGUID.toString(); + } + } + } + } + } + + return null; + } } diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java index 7299969ce3a..590625764ad 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java @@ -269,13 +269,13 @@ private ClassificationDef getDataFieldValuesClassification() attribute2Description, attribute2DescriptionGUID); properties.add(property); - property = archiveHelper.getStringTypeDefAttribute(attribute3Name, - attribute3Description, - attribute3DescriptionGUID); + property = archiveHelper.getArrayStringTypeDefAttribute(attribute3Name, + attribute3Description, + attribute3DescriptionGUID); properties.add(property); - property = archiveHelper.getStringTypeDefAttribute(attribute4Name, - attribute4Description, - attribute4DescriptionGUID); + property = archiveHelper.getArrayStringTypeDefAttribute(attribute4Name, + attribute4Description, + attribute4DescriptionGUID); properties.add(property); classificationDef.setPropertiesDefinition(properties); diff --git a/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/README.md b/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/README.md index e287786e55b..5b03ea25abe 100644 --- a/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/README.md +++ b/open-metadata-resources/open-metadata-samples/open-metadata-security-samples/README.md @@ -22,9 +22,13 @@ a security service. The samples are based on the [Coco Pharmaceuticals persona](https://egeria-project.org/practices/coco-pharmaceuticals). +## Platform services + Gary Geeke (`garygeeke`) is the IT Infrastructure Administrator and the IT Infrastructure Governance Officer. He is the only person able to issue platform services requests, and work with assets in the **infrastructure** zone. +## Asset Management + Peter Profile (`peterprofile`), Information Analyst, and Erin Overview (`erinoverview`), their Information Architect and Deputy Chief Data Officer, are the only people permitted to onboard new assets through the **quarantine** zone using the @@ -46,7 +50,7 @@ The other zones defined in the sample are: * **manufacturing** zone - Assets used in the manufacturing process currently managed by Stew Faster (`stewfaster`). * **governance** zone - Assets used to govern the organization. These are effectively the governance leadership team of Jules Keeper (`juleskeeper`), Erin Overview (`erinoverview`), Gary Geeke (`garygeeke`), Polly Tasker (`pollytasker`), Faith Broker (`faithbroker`), Ivor Padlock (`ivorpadlock`) and Reggie Mint (`reggiemint`). -* **trash-can** zone - Assets that are waiting to be deleted or archived - this is handled by their archiver processes. All of the NPA accounts have access to this zone to +* **trash-can** zone - Assets that are waiting to be deleted or archived - this is handled by their archiver processes. All the NPA accounts have access to this zone to enable processes to retrieve files from the trash can and restore them to their original zones. An asset may be in multiple zones and a person is typically able to access the asset if any of its zones permit access to them. @@ -55,15 +59,57 @@ For example, the **quarantine** zone rules override any other zone's rules to allow the onboarding team to set up the zones as part of the onboarding process. Only when the **quarantine** zone is removed, do the other zones take effect. +## Controlling access to services + It is also possible to have special rules for particular services. Coco Pharmaceuticals have decided that the **assetDelete** method from Asset Owner OMAS is too powerful -to use and so they have disabled it using this connector. +to use, and so they have disabled it using this connector. Only non-personal accounts (NPA) can use this method. Coco Pharmaceutical's staff delete an asset by moving it to the "trash-can" zone where it is cleaned up by automated archiver processes the next day. -Finally Coco Pharmaceuticals only permit non-personal accounts (NPAs) +## Controlling access to glossaries + +The connector illustrates how the **SecurityTags** classification can be used to +guide its look up for a user/group in an external authorization service. + +This look up needs to know who the requesting user is, and which group/role to use +to look up whether the user is permitted to perform a specific action. + +The **SecurityTags** classification can be attached to an element to show which group +in the external authorization service controls the access to the element. + +In the server security connector, this style is illustrated in the glossary security interface. +There is no external authorization service so the access control lists are stored directly in the +**SecurityTags** classification properties - in the **accessGroups** properties to be precise. + +The **accessGroups** property is a map from name to string array. +The name can be one of the following, and it is mapped to a list of userIds. + +* glossaryCreate - who can create new glossaries +* glossaryDetailUpdate - who can change the properties of a glossary element +* glossaryMemberUpdate - who can create/update a glossary term or glossary category +* glossaryMemberStatusUpdate - who can change the status of a glossary term +* glossaryFeedback - who can add comments and other feedback to the glossary and its terms and categories. +* glossaryRead - who can read the terms and categories in the glossary +* glossaryDelete - who can delete a glossary and all of its contents + +Here is an example in JSON - used for setting the access groups on the REST API. + +```json + +accessGroups = { + "glossaryMemberUpdate" : [ erinsUserId , harrysUserId ], + "glossaryMemberStatusUpdate" : [ erinsUserId ], + "glossaryRead" : [ erinsUserId , harrysUserId ] +} +``` + + +## Connection security + +Finally, Coco Pharmaceuticals only permit non-personal accounts (NPAs) to access Connection object that have security information in it such as userIds and passwords. diff --git a/settings.gradle b/settings.gradle index 3e11ba341a5..1732389a17e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -53,6 +53,7 @@ include(':open-metadata-implementation:adapters:open-connectors:data-store-conne include(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:csv-file-connector') include(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:avro-file-connector') include(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:data-folder-connector') +include(':open-metadata-implementation:adapters:open-connectors:integration-connectors:atlas-integration-connector') include(':open-metadata-implementation:adapters:open-connectors:integration-connectors:files-integration-connectors') include(':open-metadata-implementation:adapters:open-connectors:integration-connectors:kafka-integration-connector') include(':open-metadata-implementation:adapters:open-connectors:integration-connectors:openapi-integration-connector') @@ -68,6 +69,7 @@ include(':open-metadata-implementation:adapters:open-connectors:configuration-st include(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:rest-client-connectors-api') include(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:rest-client-factory') include(':open-metadata-implementation:adapters:open-connectors:rest-client-connectors:spring-rest-client-connector') +include(':open-metadata-implementation:adapters:open-connectors:secrets-store-connectors:env-variable-secrets-store-connector') include(':open-metadata-implementation:adapters:open-connectors:connector-configuration-factory') include(':open-metadata-implementation:adapters:authentication-plugins:http-helper') include(':open-metadata-implementation:common-services:ffdc-services') From 31b69eb46d5fb22694eb415909640c7dffc5a36f Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Sun, 23 Apr 2023 23:31:48 +0300 Subject: [PATCH 2/2] Bug and build fixes Signed-off-by: Mandy Chessell --- .../metadataelements/NoteLogElement.java | 2 +- .../handlers/CommentExchangeHandler.java | 8 +-- .../ExternalReferenceExchangeHandler.java | 67 ++++++------------- .../server/AssetManagerRESTServices.java | 2 +- .../spring/CollaborationExchangeResource.java | 2 +- .../atlas-integration-connector/README.md | 2 +- .../ffdc/ApacheAtlasAuditCode.java | 9 ++- .../generichandlers/AssetHandler.java | 1 - .../generichandlers/ReferenceableHandler.java | 1 - .../frameworks/connectors/ConnectorBase.java | 21 ------ .../VirtualConnectionProperties.java | 6 +- .../MockRuntimeExceptionConnector.java | 2 +- 12 files changed, 38 insertions(+), 85 deletions(-) diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteLogElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteLogElement.java index f6f66f66c8f..23df317c8c2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteLogElement.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/NoteLogElement.java @@ -30,7 +30,7 @@ public class NoteLogElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private List correlationHeaders = null; - private NoteLogProperties properties = null; + private NoteLogProperties properties = null; private FeedbackTargetElement feedbackTargetElement = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java index 8b5e0ea901a..c7998de6cb2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java @@ -182,7 +182,7 @@ public String createComment(String userId, } String commentGUID = commentHandler.attachNewComment(userId, - correlationProperties.getAssetManagerGUID(), + getExternalSourceGUID(correlationProperties), getExternalSourceName(correlationProperties), guid, guid, @@ -330,8 +330,8 @@ public void removeComment(String userId, if (correlationProperties != null) { commentHandler.removeCommentFromElement(userId, - correlationProperties.getAssetManagerGUID(), - correlationProperties.getAssetManagerName(), + this.getExternalSourceGUID(correlationProperties), + this.getExternalSourceName(correlationProperties), commentGUID, commentGUIDParameterName, forLineage, @@ -567,7 +567,7 @@ public List getAttachedComments(String userId, List results = commentHandler.getComments(userId, elementGUID, elementGUIDParameterName, - OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, startFrom, pageSize, forLineage, diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExternalReferenceExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExternalReferenceExchangeHandler.java index 806bfd8daa3..928724eb802 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExternalReferenceExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ExternalReferenceExchangeHandler.java @@ -256,48 +256,23 @@ public String createExternalReference(String userId, invalidParameterHandler.validateObject(externalReferenceProperties, propertiesParameterName, methodName); invalidParameterHandler.validateName(externalReferenceProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - String externalReferenceGUID; - - if (assetManagerIsHome) - { - externalReferenceGUID = externalReferenceHandler.createExternalReference(userId, - correlationProperties.getAssetManagerGUID(), - correlationProperties.getAssetManagerName(), - anchorGUID, - externalReferenceProperties.getQualifiedName(), - externalReferenceProperties.getDisplayName(), - externalReferenceProperties.getDescription(), - externalReferenceProperties.getUrl(), - externalReferenceProperties.getVersion(), - externalReferenceProperties.getOrganization(), - externalReferenceProperties.getAdditionalProperties(), - externalReferenceProperties.getTypeName(), - externalReferenceProperties.getExtendedProperties(), - externalReferenceProperties.getEffectiveFrom(), - externalReferenceProperties.getEffectiveTo(), - new Date(), - methodName); - } - else - { - externalReferenceGUID = externalReferenceHandler.createExternalReference(userId, - null, - null, - anchorGUID, - externalReferenceProperties.getQualifiedName(), - externalReferenceProperties.getDisplayName(), - externalReferenceProperties.getDescription(), - externalReferenceProperties.getUrl(), - externalReferenceProperties.getVersion(), - externalReferenceProperties.getOrganization(), - externalReferenceProperties.getAdditionalProperties(), - externalReferenceProperties.getTypeName(), - externalReferenceProperties.getExtendedProperties(), - externalReferenceProperties.getEffectiveFrom(), - externalReferenceProperties.getEffectiveTo(), - new Date(), - methodName); - } + String externalReferenceGUID = externalReferenceHandler.createExternalReference(userId, + this.getExternalSourceGUID(correlationProperties, assetManagerIsHome), + this.getExternalSourceName(correlationProperties, assetManagerIsHome), + anchorGUID, + externalReferenceProperties.getQualifiedName(), + externalReferenceProperties.getDisplayName(), + externalReferenceProperties.getDescription(), + externalReferenceProperties.getUrl(), + externalReferenceProperties.getVersion(), + externalReferenceProperties.getOrganization(), + externalReferenceProperties.getAdditionalProperties(), + externalReferenceProperties.getTypeName(), + externalReferenceProperties.getExtendedProperties(), + externalReferenceProperties.getEffectiveFrom(), + externalReferenceProperties.getEffectiveTo(), + new Date(), + methodName); if (externalReferenceGUID != null) { @@ -368,8 +343,8 @@ public void updateExternalReference(String userId, methodName); externalReferenceHandler.updateExternalReference(userId, - correlationProperties.getAssetManagerGUID(), - correlationProperties.getAssetManagerName(), + this.getExternalSourceGUID(correlationProperties), + this.getExternalSourceName(correlationProperties), externalReferenceGUID, externalReferenceGUIDParameterName, externalReferenceProperties.getQualifiedName(), @@ -433,8 +408,8 @@ public void removeExternalReference(String userId, if (correlationProperties != null) { externalReferenceHandler.removeExternalReference(userId, - correlationProperties.getAssetManagerGUID(), - correlationProperties.getAssetManagerName(), + this.getExternalSourceGUID(correlationProperties), + this.getExternalSourceName(correlationProperties), externalReferenceGUID, externalReferenceGUIDParameterName, forLineage, diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java index 50ec0a4b2aa..3f7a8219c70 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/AssetManagerRESTServices.java @@ -711,7 +711,7 @@ public ElementHeadersResponse getElementsForExternalIdentifier(String { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if (requestBody != null) + if ((requestBody != null) && (requestBody.getMetadataCorrelationProperties() != null)) { ExternalIdentifierHandler handler = instanceHandler.getExternalIdentifierHandler(userId, serverName, diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java index 15efe2f9440..5aad09bee5f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/CollaborationExchangeResource.java @@ -1009,7 +1009,7 @@ public NoteLogElementsResponse getNoteLogsForElement(@PathVariable String @RequestParam (required = false, defaultValue = "false") boolean forDuplicateProcessing, @RequestBody (required = false) - EffectiveTimeQueryRequestBody requestBody) + EffectiveTimeQueryRequestBody requestBody) { return restAPI.getNoteLogsForElement(serverName, userId, elementGUID, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); } diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md index 4b261de90dc..9122bcd4df9 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/README.md @@ -7,7 +7,7 @@ The Apache Atlas integration connector publishes glossary terms to Apache Atlas. ## Deployment and configuration -The kafka monitor integration connector is included in the main Egeria assembly. +The Apache Atlas integration connector is included in the main Egeria assembly. It runs in the [Catalog Integrator OMIS](../../../../integration-services/catalog-integrator). ---- diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java index 23870c4a840..23b2f3f2473 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/atlas-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/apacheatlas/ffdc/ApacheAtlasAuditCode.java @@ -9,7 +9,6 @@ /** * The ApacheAtlasAuditCode is used to define the message content for the OMRS Audit Log. - * * The 5 fields in the enum are: *
    *
  • Log Message Id - to uniquely identify the message
  • @@ -34,7 +33,7 @@ public enum ApacheAtlasAuditCode implements AuditLogMessageSet "The connector is designed to publish changes to all active glossary terms from the name glossary to an equivalent glossary on Apache Atlas.", "No specific action is required. This message is to confirm the configuration for the integration connector limits which glossaries are to be published."), - BAD_CONFIGURATION("APACHE-ATLAS-INTEGRATION-CONNECTOR-0002", + BAD_CONFIGURATION("APACHE-ATLAS-INTEGRATION-CONNECTOR-0003", OMRSAuditLogRecordSeverity.EXCEPTION, "The {0} integration connector encountered an {1} exception when opening event broker {2} during the {3} method. The exception message included was {4}", "The exception is passed back to the Topic Integrator OMIS in the integration daemon that is hosting " + @@ -135,12 +134,12 @@ public enum ApacheAtlasAuditCode implements AuditLogMessageSet /** * The constructor for ApacheAtlasAuditCode expects to be passed one of the enumeration rows defined in * ApacheAtlasAuditCode above. For example: - * + *
    * ApacheAtlasAuditCode auditCode = ApacheAtlasAuditCode.SERVER_NOT_AVAILABLE; - * + *
    * This will expand out to the 4 parameters shown below. * - * @param messageId - unique Id for the message + * @param messageId - unique id for the message * @param severity - severity of the message * @param message - text for the message * @param systemAction - description of the action taken by the system when the condition happened diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java index 78efe4e5756..8274b10ee6f 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java @@ -1678,7 +1678,6 @@ public void removeAssetOrigin(String userId, * @param organizationGUID Unique identifier (GUID) of the organization where this asset originated from - or null * @param businessCapabilityGUID Unique identifier (GUID) of the business capability where this asset originated from. * @param otherOriginValues Descriptive labels describing origin of the asset - * @param serviceSupportedZones supported zones for calling service * @param startFrom int starting position for fist returned element. * @param pageSize int maximum number of elements to return on the call. * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java index 4377262c5b9..7c51220a56f 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ReferenceableHandler.java @@ -918,7 +918,6 @@ public void removeOwner(String userId, * * @param userId String userId of user making request. * @param ownerName String unique identifier for the owner. - * @param serviceSupportedZones supported zones for calling service * @param startFrom int starting position for fist returned element. * @param pageSize int maximum number of elements to return on the call. * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java index 47f6656df8e..ae744a90bc8 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/ConnectorBase.java @@ -46,12 +46,6 @@ public abstract class ConnectorBase extends Connector implements SecureConnector private volatile boolean isActive = false; - /* - * Secured properties are protected properties from the connection. They are retrieved as a protected - * variable to allow subclasses of ConnectorBase to access them. - */ - protected Map securedProperties = null; - private static final Logger log = LoggerFactory.getLogger(ConnectorBase.class); private final int hashCode = UUID.randomUUID().hashCode(); @@ -89,7 +83,6 @@ public void initialize(String connectorInstanceId, * Set up the secured properties and the connection bean */ ProtectedConnection protectedConnection = new ProtectedConnection(connectionProperties); - this.securedProperties = protectedConnection.getSecuredProperties(); this.connectionBean = protectedConnection.getConnectionBean(); log.debug("New Connector initialized: " + connectorInstanceId + ", " + connectionProperties.getQualifiedName() + "," + connectionProperties.getDisplayName()); @@ -295,20 +288,6 @@ protected static class ProtectedConnection extends ConnectionProperties super(templateConnection); } - /** - * Return a copy of the secured properties. Null means no secured properties are available. - * This method is protected so only OCF (or subclasses) can access them. When Connector is passed to calling - * OMAS, the secured properties are not available. - * - * @return secured properties typically user credentials for the connection - */ - @Override - protected Map getSecuredProperties() - { - return super.getConnectionBean().getSecuredProperties(); - } - - /** * Return a copy of the ConnectionBean. * diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java index cb350314621..591e17f9386 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/VirtualConnectionProperties.java @@ -7,6 +7,7 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Endpoint; import org.odpi.openmetadata.frameworks.connectors.properties.beans.VirtualConnection; +import java.io.Serial; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -22,7 +23,8 @@ */ public class VirtualConnectionProperties extends ConnectionProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; protected VirtualConnection connectionBean; @@ -209,7 +211,7 @@ public EndpointProperties getEndpoint() * * @return secured properties typically user credentials for the connection */ - protected Map getSecuredProperties() + public Map getSecuredProperties() { return connectionBean.getSecuredProperties(); } diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java index 88a008e62d8..5ef9d56e293 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/MockRuntimeExceptionConnector.java @@ -262,7 +262,7 @@ private ProtectedConnection(ConnectionProperties templateConnection) * @return secured properties typically user credentials for the connection */ @Override - protected Map getSecuredProperties() + public Map getSecuredProperties() { Map securedProperties = super.getConnectionBean().getSecuredProperties(); if (securedProperties == null)