From 96307814b3002134eafb3c821ad612e3f621febf Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Thu, 13 Apr 2023 19:37:37 +0100 Subject: [PATCH] Split API into exchange and management functions Signed-off-by: Mandy Chessell --- .../server/AssetConsumerRESTServices.java | 2 + .../api/CollaborationExchangeInterface.java | 447 ---- .../api/StewardshipExchangeInterface.java | 164 -- .../CollaborationExchangeInterface.java | 1143 +++++++++ .../ConnectionExchangeInterface.java | 2 +- .../DataAssetExchangeInterface.java | 2 +- .../ExternalAssetManagerInterface.java} | 6 +- .../ExternalReferencesInterface.java | 2 +- .../GlossaryExchangeInterface.java | 253 +- .../GovernanceExchangeInterface.java | 99 +- .../InfrastructureExchangeInterface.java | 2 +- .../LineageExchangeInterface.java | 113 +- .../SchemaExchangeInterface.java | 2 +- .../StewardshipExchangeInterface.java | 615 +++++ .../ValidValuesExchangeInterface.java | 2 +- .../api/exchange/package-info.java | 27 + .../CollaborationManagementInterface.java | 1001 ++++++++ .../GlossaryManagementInterface.java | 1741 +++++++++++++ .../StewardshipManagementInterface.java | 502 ++++ .../api/management/package-info.java | 7 + .../assetmanager/api/package-info.java | 21 +- .../metadataelements/CommentElement.java | 48 +- .../metadataelements/LikeElement.java | 2 +- .../metadataelements/RatingElement.java | 2 +- .../metadataelements/RelatedElement.java | 177 ++ .../properties/AssetConnectionProperties.java | 4 +- .../properties/AssetManagerProperties.java | 3 + .../properties/AssetOriginProperties.java | 170 ++ .../properties/AssetProperties.java | 4 +- .../CanonicalVocabularyProperties.java} | 55 +- .../CapabilityDeploymentProperties.java | 2 + .../properties/ClassificationProperties.java | 204 ++ .../properties/CommentProperties.java | 29 +- .../assetmanager/properties/CommentType.java | 29 +- .../ComplexSchemaTypeProperties.java | 4 +- .../properties/ConnectionProperties.java | 4 +- .../properties/ConnectorTypeProperties.java | 4 +- .../properties/ControlFlowProperties.java | 4 +- .../properties/CyberLocation.java | 4 +- .../properties/DataAssetProperties.java | 4 +- .../DataContentForDataSetProperties.java | 4 +- .../properties/DataFlowProperties.java | 4 +- .../properties/DataItemSortOrder.java | 22 +- .../properties/DataSetProperties.java | 4 +- .../properties/DataStoreProperties.java | 4 +- .../properties/DeploymentProperties.java | 2 + .../EmbeddedConnectionProperties.java | 4 +- .../properties/EndpointProperties.java | 4 +- .../properties/EnumSchemaTypeProperties.java | 4 +- ...ExternalGlossaryElementLinkProperties.java | 4 +- .../ExternalGlossaryLinkProperties.java | 5 +- .../ExternalIdentifierProperties.java | 4 +- .../ExternalReferenceLinkProperties.java | 4 +- .../ExternalReferenceProperties.java | 4 +- .../ExternalSchemaTypeProperties.java | 4 +- .../properties/FeedbackProperties.java | 41 +- .../properties/FixedLocation.java | 4 +- .../properties/ForeignKeyProperties.java | 4 +- .../GlossaryCategoryProperties.java | 5 +- .../properties/GlossaryTermActivityType.java | 25 +- .../GlossaryTermCategorization.java | 4 +- .../GlossaryTermContextDefinition.java | 17 +- .../properties/GlossaryTermRelationship.java | 4 +- .../GlossaryTermRelationshipStatus.java | 19 + .../properties/GlossaryTermStatus.java | 31 + .../GovernanceActionProcessProperties.java | 4 +- .../GovernanceActionProperties.java | 4 +- .../properties/GovernanceActionStatus.java | 41 +- .../GovernanceActionTypeProperties.java | 4 +- .../GovernanceClassificationBase.java | 295 +++ .../GovernanceClassificationProperties.java | 133 + .../GovernanceClassificationStatus.java | 172 ++ .../GovernanceDefinitionProperties.java | 4 +- .../GovernanceDefinitionStatus.java | 19 + .../assetmanager/properties/KeyPattern.java | 31 + .../properties/LikeProperties.java | 33 +- .../properties/LineageMappingProperties.java | 4 +- .../LiteralSchemaTypeProperties.java | 4 +- .../properties/LocationProperties.java | 4 +- .../properties/MapSchemaTypeProperties.java | 4 +- .../MetadataCorrelationProperties.java | 4 +- .../properties/OperationalStatus.java | 7 + .../properties/OwnerProperties.java | 168 ++ .../properties/PortProperties.java | 4 +- .../assetmanager/properties/PortType.java | 19 + .../properties/PrimaryKeyProperties.java | 4 +- .../PrimitiveSchemaTypeProperties.java | 5 +- .../properties/ProcessCallProperties.java | 4 +- .../ProcessContainmentProperties.java | 4 +- .../properties/ProcessContainmentType.java | 11 + .../properties/ProcessProperties.java | 4 +- .../properties/ProcessStatus.java | 23 +- .../properties/QueryTargetProperties.java | 4 +- .../properties/RatingProperties.java | 16 +- .../properties/ReferenceableProperties.java | 7 +- .../properties/RelationshipProperties.java | 5 +- .../RetentionClassificationProperties.java | 215 ++ .../properties/SchemaAttributeProperties.java | 4 +- .../properties/SchemaProperties.java | 4 +- .../SchemaTypeChoiceProperties.java | 4 +- .../properties/SchemaTypeProperties.java | 4 +- .../properties/SecureLocation.java | 4 +- .../properties/SecurityTagsProperties.java | 16 +- .../SemanticAssignmentProperties.java | 285 +++ .../properties/ServerAssetUseProperties.java | 2 + .../properties/ServerAssetUseType.java | 21 +- .../SimpleSchemaTypeProperties.java | 4 +- .../SoftwareCapabilitiesProperties.java | 2 + .../assetmanager/properties/StarRating.java | 23 + .../SubjectAreaMemberProperties.java | 121 + .../properties/SupplementaryProperties.java | 4 +- .../properties/SynchronizationDirection.java | 21 + .../TaxonomyProperties.java} | 57 +- .../properties/TemplateProperties.java | 4 +- .../properties/TermAssignmentStatus.java | 146 ++ .../properties/ValidValueProperties.java | 4 +- ...ava => ActivityDescriptionProperties.java} | 22 +- .../AssetManagerIdentifiersRequestBody.java | 4 +- .../rest/AssetManagerOMASAPIResponse.java | 4 +- ...culatedValueClassificationRequestBody.java | 4 +- ...alVocabularyClassificationRequestBody.java | 151 -- .../rest/ClassificationRequestBody.java | 178 ++ .../rest/ControlFlowElementsResponse.java | 6 +- .../ControlledGlossaryTermRequestBody.java | 31 +- .../rest/ReferenceableRequestBody.java | 178 ++ ...va => ReferenceableUpdateRequestBody.java} | 53 +- .../rest/RelatedElementsResponse.java | 152 ++ .../rest/RelationshipRequestBody.java | 4 +- .../rest/TemplateRequestBody.java | 34 +- .../client/AssetManagerBaseClient.java | 1514 ++++++++++++ .../client/CollaborationExchangeClient.java | 1010 -------- .../client/ExchangeClientBase.java | 532 ---- .../client/StewardshipExchangeClient.java | 303 --- .../exchange/CollaborationExchangeClient.java | 2177 +++++++++++++++++ .../ConnectionExchangeClient.java | 4 +- .../DataAssetExchangeClient.java | 4 +- .../client/exchange/ExchangeClientBase.java | 121 + .../ExternalAssetManagerClient.java | 6 +- .../ExternalReferenceExchangeClient.java | 4 +- .../GlossaryExchangeClient.java | 1363 +++++------ .../GovernanceExchangeClient.java | 116 +- .../InfrastructureExchangeClient.java | 4 +- .../{ => exchange}/LineageExchangeClient.java | 132 +- .../SchemaExchangeClientBase.java | 4 +- .../exchange/StewardshipExchangeClient.java | 1111 +++++++++ .../ValidValuesExchangeClient.java | 4 +- .../client/exchange/package-info.java | 7 + .../CollaborationManagementClient.java | 1280 ++++++++++ .../management/GlossaryManagementClient.java | 2167 ++++++++++++++++ .../StewardshipManagementClient.java | 685 ++++++ .../client/management/package-info.java | 7 + .../assetmanager/client/package-info.java | 3 +- .../client/rest/AssetManagerRESTClient.java | 71 +- .../converters/CommentConverter.java | 1 - .../converters/LikeConverter.java | 2 - .../converters/RatingConverter.java | 1 - .../handlers/CommentExchangeHandler.java | 636 +++++ .../handlers/DataAssetExchangeHandler.java | 88 +- .../handlers/GlossaryExchangeHandler.java | 388 ++- .../server/AssetManagerInstanceHandler.java | 11 +- .../server/AssetManagerServicesInstance.java | 29 +- .../CollaborationExchangeRESTServices.java | 506 ++-- .../server/GlossaryExchangeRESTServices.java | 832 ++++--- .../StewardshipExchangeRESTServices.java | 1726 ++++++++++++- .../spring/CollaborationExchangeResource.java | 180 +- .../spring/GlossaryExchangeResource.java | 501 ++-- .../spring/StewardshipExchangeResource.java | 616 ++++- .../assetowner/rest/OriginRequestBody.java | 4 +- .../assetowner/rest/OwnerRequestBody.java | 4 +- .../assetowner/client/AssetOwner.java | 1 + .../metadataelements/RelatedElement.java | 4 +- .../datamanager/rest/TemplateRequestBody.java | 4 +- .../generichandlers/CommentHandler.java | 267 +- .../GlossaryCategoryHandler.java | 106 +- .../generichandlers/GlossaryHandler.java | 181 +- .../generichandlers/GlossaryTermHandler.java | 58 +- .../generichandlers/ReferenceableHandler.java | 260 ++ .../metadatasecurity/properties/Asset.java | 2 + .../metadatasecurity/properties/Glossary.java | 2 + .../GovernanceClassificationBase.java | 94 +- .../GovernanceClassificationStatus.java | 27 + .../properties/Referenceable.java | 77 +- .../OpenMetadataServerSecurityVerifier.java | 126 +- .../converters/AssetConverter.java | 1 + .../connector/CatalogIntegratorContext.java | 35 +- .../CollaborationExchangeService.java | 2 +- .../connector/ConnectionExchangeService.java | 3 +- .../connector/DataAssetExchangeService.java | 2 +- .../ExternalReferenceExchangeService.java | 2 +- .../connector/GlossaryExchangeService.java | 213 +- .../connector/GovernanceExchangeService.java | 2 +- .../InfrastructureExchangeService.java | 2 +- .../connector/LineageExchangeService.java | 3 +- .../connector/SchemaExchangeService.java | 2 +- .../connector/StewardshipExchangeService.java | 2 +- .../connector/ValidValuesExchangeService.java | 2 +- .../CatalogIntegratorContextManager.java | 35 +- .../connector/LineageIntegratorContext.java | 99 +- .../LineageIntegratorContextManager.java | 11 +- .../fvt/AssetManagerOMASFVTSuite.java | 4 +- .../ClientConstructorTest.java | 4 +- .../fvt/common/AssetManagerTestBase.java | 330 ++- .../fvt/connections/CreateConnectionTest.java | 4 +- .../CreateDatabaseTest.java.inprogress | 4 +- .../errorhandling/InvalidParameterTest.java | 7 +- .../ManageExternalIdsTest.java | 44 +- ...t.java => CreateExchangeGlossaryTest.java} | 259 +- .../CreateManagementGlossaryTest.java | 740 ++++++ .../AssetManagerOMASCreateGlossaryIT.java | 19 +- 209 files changed, 25717 insertions(+), 5425 deletions(-) delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/CollaborationExchangeInterface.java delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/StewardshipExchangeInterface.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/ConnectionExchangeInterface.java (99%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/DataAssetExchangeInterface.java (99%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{AssetManagerInterface.java => exchange/ExternalAssetManagerInterface.java} (97%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/ExternalReferencesInterface.java (99%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/GlossaryExchangeInterface.java (90%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/GovernanceExchangeInterface.java (81%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/InfrastructureExchangeInterface.java (82%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/LineageExchangeInterface.java (93%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/SchemaExchangeInterface.java (99%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/StewardshipExchangeInterface.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/{ => exchange}/ValidValuesExchangeInterface.java (99%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/package-info.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/GlossaryManagementInterface.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/StewardshipManagementInterface.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/package-info.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RelatedElement.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetOriginProperties.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/{rest/ContextDefinitionClassificationRequestBody.java => properties/CanonicalVocabularyProperties.java} (50%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationBase.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationStatus.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OwnerProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RetentionClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SemanticAssignmentProperties.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SubjectAreaMemberProperties.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/{rest/TaxonomyClassificationRequestBody.java => properties/TaxonomyProperties.java} (57%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TermAssignmentStatus.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/{ActivityTermClassificationRequestBody.java => ActivityDescriptionProperties.java} (76%) delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CanonicalVocabularyClassificationRequestBody.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ClassificationRequestBody.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableRequestBody.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/{GlossaryTermRequestBody.java => ReferenceableUpdateRequestBody.java} (57%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelatedElementsResponse.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/CollaborationExchangeClient.java delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExchangeClientBase.java delete mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/StewardshipExchangeClient.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/ConnectionExchangeClient.java (99%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/DataAssetExchangeClient.java (99%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExchangeClientBase.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/ExternalAssetManagerClient.java (99%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/ExternalReferenceExchangeClient.java (99%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/GlossaryExchangeClient.java (81%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/GovernanceExchangeClient.java (88%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/InfrastructureExchangeClient.java (97%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/LineageExchangeClient.java (96%) rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/SchemaExchangeClientBase.java (99%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/StewardshipExchangeClient.java rename open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/{ => exchange}/ValidValuesExchangeClient.java (99%) create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/package-info.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/GlossaryManagementClient.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/StewardshipManagementClient.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/package-info.java create mode 100644 open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java rename open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/{CreateGlossaryTest.java => CreateExchangeGlossaryTest.java} (81%) create mode 100644 open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateManagementGlossaryTest.java diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerRESTServices.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerRESTServices.java index 834cbd79f3d..d5ec4faffc3 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerRESTServices.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/server/AssetConsumerRESTServices.java @@ -722,9 +722,11 @@ public VoidResponse updateComment(String serverName, null, commentGUID, guidParameterName, + null, commentType, requestBody.getCommentText(), requestBody.getIsPublic(), + true, null, null, false, diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/CollaborationExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/CollaborationExchangeInterface.java deleted file mode 100644 index d3c86102444..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/CollaborationExchangeInterface.java +++ /dev/null @@ -1,447 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; - -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; -import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; -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.CommentType; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.StarRating; - -import java.util.List; - -/** - * The CollaborationExchangeInterface supports the exchange of comments, likes, reviews/ratings and - * informal tags. - */ -public interface CollaborationExchangeInterface -{ - /** - * Adds a star rating and optional review text to the element. If the user has already attached - * a rating then the original one is over-ridden. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element. - * @param properties properties for the rating - * @return unique identifier of the rating - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - String addRatingToElement(String userId, - String elementGUID, - RatingProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes of a review that was added to the element by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element where the rating is attached. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void removeRatingFromElement(String userId, - String elementGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Adds a "LikeProperties" to the element. If the user has already attached a like then the original one - * is over-ridden. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element where the like is to be attached. - * @param properties indicates whether the feedback should be shared or only be visible to the originating user - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void addLikeToElement(String userId, - String elementGUID, - LikeProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a "LikeProperties" added to the element by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element where the like is attached. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void removeLikeFromElement(String userId, - String elementGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Adds a comment to the element. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element. - * @param properties properties of the comment - * - * @return guid of new comment. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - String addCommentToElement(String userId, - String elementGUID, - CommentProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Adds a comment to another comment. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element at the head of this comment chain. - * @param commentGUID unique identifier for an existing comment. Used to add a reply to a comment. - * @param properties properties of the comment - * - * @return guid of new comment. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - String addCommentReply(String userId, - String elementGUID, - String commentGUID, - CommentProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Update an existing comment. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element at the head of this comment chain. - * @param commentGUID unique identifier for the comment to change. - * @param properties properties of the comment - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void updateComment(String userId, - String elementGUID, - String commentGUID, - CommentProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a comment added to the element by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element at the head of this comment chain. - * @param commentGUID unique identifier for the comment object. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the user does not have permission to perform this request. - */ - void removeComment(String userId, - String elementGUID, - String commentGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the requested comment. - * - * @param userId userId of user making request. - * @param commentGUID unique identifier for the comment object. - * @return comment properties - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the user does not have permission to perform this request. - */ - CommentElement getComment(String userId, - String commentGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the comments attached to an element. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * @return list of comments - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the user does not have permission to perform this request. - */ - List getAttachedComments(String userId, - String elementGUID, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Creates a new public informal tag and returns the unique identifier for it. - * - * @param userId userId of user making request. - * @param tagName name of the tag. - * @param tagDescription (optional) description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @return GUID for new tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - String createPublicTag(String userId, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - /** - * Creates a new private informal tag and returns the unique identifier for it. - * - * @param userId userId of user making request. - * @param tagName name of the tag. - * @param tagDescription (optional) description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @return GUID for new tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - String createPrivateTag(String userId, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Updates the description of an existing tag (either private or public). - * - * @param userId userId of user making request. - * @param tagGUID unique identifier for the tag. - * @param tagDescription description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void updateTagDescription(String userId, - String tagGUID, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes an informal tag from the repository. All the tagging relationships to this informal tag are lost. - * A private tag can be deleted by its creator and all the references are lost; - * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. - * - * @param userId userId of user making request. - * @param tagGUID unique id for the tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void deleteTag(String userId, - String tagGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the tag for the supplied unique identifier (guid). - * - * @param userId userId of the user making the request. - * @param guid unique identifier of the tag. - * - * @return tag - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - InformalTagElement getTag(String userId, - String guid) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the list of tags exactly matching the supplied name. - * - * @param userId the name of the calling user. - * @param tag name of tag. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - List getTagsByName(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the list of the calling user's private tags exactly matching the supplied name. - * - * @param userId the name of the calling user. - * @param tag name of tag. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - List getMyTagsByName(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the list of tags containing the supplied string in either the name or description. - * - * @param userId the name of the calling user. - * @param tag name of tag. This may include wild card characters. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - List findTags(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - /** - * Return the list of the calling user's private tags containing the supplied string in either the name or description. - * - * @param userId the name of the calling user. - * @param tag name of tag. This may include wild card characters. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - List findMyTags(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - /** - * Adds a tag (either private of public) to an element. - * - * @param userId userId of user making request. - * @param elementGUID unique id for the element. - * @param tagGUID unique id of the tag. - * @param isPublic flag indicating whether the attachment of the tag is public or not - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void addTagToElement(String userId, - String elementGUID, - String tagGUID, - boolean isPublic) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Removes a tag from the element that was added by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique id for the element. - * @param tagGUID unique id for the tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - void removeTagFromElement(String userId, - String elementGUID, - String tagGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; - - - /** - * Return the list of unique identifiers for elements that are linked to a specific tag either directly, or via one - * of its schema elements. An Element's GUID may appear multiple times in the results if it is tagged multiple times - * with the requested tag. - * - * @param userId the name of the calling user. - * @param tagGUID unique identifier of tag. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return element guid list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - List getElementsByTag(String userId, - String tagGUID, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; -} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/StewardshipExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/StewardshipExchangeInterface.java deleted file mode 100644 index 76319ec17c7..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/StewardshipExchangeInterface.java +++ /dev/null @@ -1,164 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; - -import org.odpi.openmetadata.accessservices.assetmanager.properties.SecurityTagsProperties; -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 java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * The StewardshipExchangeInterface supports the exchange of relationships (such as SemanticAssignment) - * and classifications that are added by stewards (or automated stewardship processes) such as Confidentiality. - */ -public interface StewardshipExchangeInterface -{ - /** - * Classify the element with the Memento classification to indicate that it has been logically deleted for by lineage requests. - * - * @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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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) - */ - void addMementoClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Remove the memento designation from the 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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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) - */ - void clearMementoClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Classify the element with the Incomplete classification to indicate that it has more details to come. - * - * @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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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) - */ - void addIncompleteClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Remove the Incomplete designation from the 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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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) - */ - void clearIncompleteClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Add or replace the security tags for an element. - * - * @param userId calling user - * @param elementGUID element to link it to - its type must inherit from Referenceable. - * @param properties details of the security tags - * - * @throws InvalidParameterException element not known, null userId or guid - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - void addSecurityTags(String userId, - String elementGUID, - SecurityTagsProperties properties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Remove the security tags classification from an element. - * - * @param userId calling user - * @param elementGUID element where the security tags need to be removed. - * - * @throws InvalidParameterException asset or element not known, null userId or guid - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - void removeSecurityTags(String userId, - String elementGUID) 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/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 new file mode 100644 index 00000000000..79aba2a34ab --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/CollaborationExchangeInterface.java @@ -0,0 +1,1143 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; + +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.InformalTagProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +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 java.util.Date; +import java.util.List; + +/** + * The CollaborationExchangeInterface supports the exchange of comments, likes, reviews/ratings and + * informal tags. + */ +public interface CollaborationExchangeInterface +{ + /** + * Adds a star rating and optional review text to the element. If the user has already attached + * a rating then the original one is over-ridden. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element. + * @param isPublic is this visible to other people + * @param properties properties for the rating + * @return unique identifier of the rating + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String addRatingToElement(String userId, + String elementGUID, + boolean isPublic, + RatingProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes of a review that was added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element where the rating is attached. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void removeRatingFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Adds a "LikeProperties" to the element. If the user has already attached a like then the original one + * is over-ridden. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element where the like is to be attached. + * @param isPublic is this visible to other people + * @param properties indicates whether the feedback should be shared or only be visible to the originating user + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void addLikeToElement(String userId, + String elementGUID, + boolean isPublic, + LikeProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes a "LikeProperties" added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element where the like is attached. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void removeLikeFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Adds a comment to the element. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier for the element. + * @param externalIdentifierProperties optional properties used to define an external identifier for the comment. + * @param isPublic is this comment visible to other people. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String addCommentToElement(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String elementGUID, + ExternalIdentifierProperties externalIdentifierProperties, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Adds a comment to another comment. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param commentGUID unique identifier for an existing comment. Used to add a reply to a comment. + * @param externalIdentifierProperties optional properties used to define an external identifier for the comment. + * @param isPublic is this comment visible to other people. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String addCommentReply(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String commentGUID, + ExternalIdentifierProperties externalIdentifierProperties, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Update an existing comment. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param commentGUID unique identifier for the comment to change. + * @param externalIdentifier unique identifier of the comment in the external asset manager + * @param isPublic is this visible to other people + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties properties of the comment + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void updateComment(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + String externalIdentifier, + boolean isMergeUpdate, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @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 questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param properties is this visible to other people + * @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? + * + * @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) + */ + void setupAcceptedAnswer(String userId, + String assetManagerGUID, + String assetManagerName, + String questionCommentGUID, + String answerCommentGUID, + FeedbackProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @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 questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @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? + * + * @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) + */ + void clearAcceptedAnswer(String userId, + String assetManagerGUID, + String assetManagerName, + String questionCommentGUID, + String answerCommentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Removes a comment added to the element by this user. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param commentGUID unique identifier for the comment object. + * @param externalIdentifier unique identifier of the comment in the external asset manager + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + void removeComment(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the requested comment. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param commentGUID unique identifier for the comment object. + * @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 comment properties + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + CommentElement getComment(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the comments attached to an element. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). + * @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 comments + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + List getAttachedComments(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Retrieve the list of comment metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 searchString string to find in the properties + * @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 findComments(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Creates a new informal tag and returns the unique identifier for it. + * + * @param userId userId of user making request. + * @param properties name of the tag and (optional) description. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic note. + * + * @return GUID for new tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String createInformalTag(String userId, + InformalTagProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + + /** + * Updates the description of an existing tag (either private or public). + * + * @param userId userId of user making request. + * @param tagGUID unique identifier for the tag. + * @param tagDescription description of the tag. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic note. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void updateTagDescription(String userId, + String tagGUID, + String tagDescription) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes an informal tag from the repository. All the tagging relationships to this informal tag are lost. + * A private tag can be deleted by its creator and all the references are lost; + * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. + * + * @param userId userId of user making request. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void deleteTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the tag for the supplied unique identifier (guid). + * + * @param userId userId of the user making the request. + * @param tagGUID unique identifier of the tag. + * + * @return tag + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + InformalTagElement getTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List getTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of the calling user's private tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List getMyTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List findTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /** + * Return the list of the calling user's private tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List findMyTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /** + * Adds a tag (either private of public) to an element. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id of the tag. + * @param isPublic flag indicating whether the attachment of the tag is public or not + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void addTagToElement(String userId, + String elementGUID, + String tagGUID, + boolean isPublic) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes a tag from the element that was added by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void removeTagFromElement(String userId, + String elementGUID, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of unique identifiers for elements that are linked to a specific tag either directly, or via one + * of its schema elements. An Element's GUID may appear multiple times in the results if it is tagged multiple times + * with the requested tag. + * + * @param userId the name of the calling user. + * @param tagGUID unique identifier of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return element guid list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List getElementsByTag(String userId, + String tagGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /* ===================================================================================================================== + * A note log maintains an ordered list of notes. It can be used to support release note, blogs and similar + * broadcast information. Notelogs are typically maintained by the owners/stewards of an element. + */ + + /** + * Create a new metadata element to represent a note log and attach it to an element (if supplied). + * Any supplied element becomes the note log's anchor, causing the note log to be deleted if/when the element is deleted. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier of the element where the note log is located + * @param externalIdentifierProperties optional properties used to define an external identifier for the note log + * @param noteLogProperties properties about the note log to store + * @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 unique identifier of the new note log + * + * @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) + */ + String createNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String elementGUID, + ExternalIdentifierProperties externalIdentifierProperties, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a note log using an existing metadata element as a template. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier of the element where the note log is located + * @param templateGUID unique identifier of the metadata element to copy + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param templateProperties properties that override the template + * + * @return unique identifier of the new note log + * + * @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) + */ + String createNoteLogFromTemplate(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String elementGUID, + String templateGUID, + ExternalIdentifierProperties externalIdentifierProperties, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a note log. + * + * @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 noteLogGUID unique identifier of the metadata element to update + * @param noteLogExternalIdentifier unique identifier of the note log in the external asset manager + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param noteLogProperties new properties for the metadata element + * @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? + * + * @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) + */ + void updateNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + String noteLogExternalIdentifier, + boolean isMergeUpdate, + boolean isPublic, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a note log. + * + * @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 noteLogGUID unique identifier of the metadata element to remove + * @param noteLogExternalIdentifier unique identifier of the note log in the external asset manager + * @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? + * + * @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) + */ + void removeNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + String noteLogExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 searchString string to find in the properties + * @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 findNoteLogs(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @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 name name to search for + * @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 getNoteLogsByName(String userId, + String assetManagerGUID, + String assetManagerName, + String name, + 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. + * + * @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 noteLogGUID unique identifier of the requested metadata element + * @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 requested metadata element + * + * @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) + */ + NoteLogElement getNoteLogByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /* =============================================================================== + * A element typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogGUID unique identifier of the element where the note is located + * @param externalIdentifierProperties optional properties used to define an external identifier for the note + * @param noteProperties properties for the note + * @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 unique identifier of the new metadata element for the note + * + * @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) + */ + String createNote(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String noteLogGUID, + ExternalIdentifierProperties externalIdentifierProperties, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Create a new metadata element to represent a note using an existing metadata element as a template. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogGUID unique identifier of the element where the note is located + * @param templateGUID unique identifier of the metadata element to copy + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element for the note + * + * @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) + */ + String createNoteFromTemplate(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String noteLogGUID, + String templateGUID, + ExternalIdentifierProperties externalIdentifierProperties, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the properties of the metadata element representing a note. + * + * @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 noteGUID unique identifier of the note to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param noteProperties new properties for the note + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @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? + * + * @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) + */ + void updateNote(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + boolean isMergeUpdate, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Undo the last update to the note. + * + * @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 noteGUID unique identifier of the metadata element to update + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @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 recovered note + * + * @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) + */ + NoteElement undoNoteUpdate(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Archive the metadata element representing a note. This removes it from normal access. However, it is still available + * for lineage requests. + * + * @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 noteGUID unique identifier of the metadata element to archive + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @param archiveProperties option parameters about the archive process + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void archiveNote(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + ArchiveProperties archiveProperties, + Date effectiveTime, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a note. + * + * @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 noteGUID unique identifier of the metadata element to remove + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @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? + * + * @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) + */ + void removeNote(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 to query + * @param searchString string to find in the properties + * @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 findNotes(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of notes associated with a note log. + * + * @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 noteLogGUID unique identifier of the note log of interest + * @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 associated 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 getNotesForNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @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 to query + * @param name name to search for + * @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 getNotesByName(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @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 noteGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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) + */ + NoteElement getNoteByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + 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/ConnectionExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ConnectionExchangeInterface.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ConnectionExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ConnectionExchangeInterface.java index 3d4b0dad913..271d11ce138 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ConnectionExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ConnectionExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectionElement; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/DataAssetExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/DataAssetExchangeInterface.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/DataAssetExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/DataAssetExchangeInterface.java index c69541cbea4..9196035c111 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/DataAssetExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/DataAssetExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataAssetElement; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/AssetManagerInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ExternalAssetManagerInterface.java similarity index 97% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/AssetManagerInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ExternalAssetManagerInterface.java index 3bfdc9b3c9f..a609f616470 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/AssetManagerInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ExternalAssetManagerInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; @@ -12,10 +12,10 @@ import java.util.List; /** - * AssetManagerInterface provides the interface for retrieving the identity of an external asset manager. + * ExternalAssetManagerInterface provides the interface for retrieving the identity of an external asset manager. * The definition of the external asset manager may also be created using the IT Infrastructure OMAS. */ -public interface AssetManagerInterface +public interface ExternalAssetManagerInterface { /** * Create information about the external asset manager. This is represented as a software capability diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ExternalReferencesInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ExternalReferencesInterface.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ExternalReferencesInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ExternalReferencesInterface.java index d136c86f557..c6092150cee 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ExternalReferencesInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ExternalReferencesInterface.java @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceLinkElement; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/GlossaryExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/GlossaryExchangeInterface.java similarity index 90% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/GlossaryExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/GlossaryExchangeInterface.java index bea3b33392a..78dc9af58aa 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/GlossaryExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/GlossaryExchangeInterface.java @@ -1,9 +1,10 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ActivityDescriptionProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; @@ -37,6 +38,7 @@ public interface GlossaryExchangeInterface * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryProperties properties to store * @@ -49,6 +51,7 @@ public interface GlossaryExchangeInterface String createGlossary(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, GlossaryProperties glossaryProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -65,6 +68,7 @@ String createGlossary(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template @@ -78,6 +82,7 @@ String createGlossary(String userId, String createGlossaryFromTemplate(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, @@ -93,7 +98,11 @@ String createGlossaryFromTemplate(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to update * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param glossaryProperties new properties for this element + * @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? * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -104,9 +113,13 @@ void updateGlossary(String userId, String assetManagerName, String glossaryGUID, String glossaryExternalIdentifier, - GlossaryProperties glossaryProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + boolean isMergeUpdate, + GlossaryProperties glossaryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -122,20 +135,26 @@ void updateGlossary(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to classify * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager - * @param organizingPrinciple description of how the glossary is organized + * @param taxonomyProperties description of how the glossary is organized + * @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? * * @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) */ - void setGlossaryAsTaxonomy(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier, - String organizingPrinciple) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setGlossaryAsTaxonomy(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + TaxonomyProperties taxonomyProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -146,18 +165,24 @@ void setGlossaryAsTaxonomy(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to unclassify * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @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? * * @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) */ - void clearGlossaryAsTaxonomy(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void clearGlossaryAsTaxonomy(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -172,20 +197,26 @@ void clearGlossaryAsTaxonomy(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to classify * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager - * @param scope description of the situations where this glossary is relevant. + * @param properties description of the situations where this glossary is relevant. + * @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? * * @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) */ - void setGlossaryAsCanonical(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier, - String scope) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setGlossaryAsCanonical(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + CanonicalVocabularyProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -196,18 +227,24 @@ void setGlossaryAsCanonical(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to unclassify * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @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? * * @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) */ - void clearGlossaryAsCanonical(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void clearGlossaryAsCanonical(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -219,18 +256,24 @@ void clearGlossaryAsCanonical(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @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? * * @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) */ - void removeGlossary(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void removeGlossary(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -243,6 +286,9 @@ void removeGlossary(String userId, * @param searchString string to find in the properties * @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 * @@ -255,9 +301,12 @@ List findGlossaries(String userId, String assetManagerName, String searchString, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -270,6 +319,9 @@ List findGlossaries(String userId, * @param name name to search for * @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 * @@ -282,9 +334,12 @@ List getGlossariesByName(String userId, String assetManagerName, String name, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -295,7 +350,10 @@ List getGlossariesByName(String userId, * @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 matching metadata elements * * @throws InvalidParameterException one of the parameters is invalid @@ -306,9 +364,12 @@ List getGlossariesForAssetManager(String userId, String assetManagerGUID, String assetManagerName, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -318,6 +379,9 @@ List getGlossariesForAssetManager(String userId, * @param assetManagerGUID unique identifier of software capability representing the caller * @param assetManagerName unique name of software capability representing the caller * @param openMetadataGUID unique identifier of the requested metadata element + * @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 matching metadata element * @@ -328,9 +392,12 @@ List getGlossariesForAssetManager(String userId, GlossaryElement getGlossaryByGUID(String userId, String assetManagerGUID, String assetManagerName, - String openMetadataGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + String openMetadataGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /* ===================================================================================================================== @@ -343,9 +410,13 @@ GlossaryElement getGlossaryByGUID(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the category is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryCategoryProperties properties about the glossary category to store + * @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 unique identifier of the new glossary category * @@ -356,11 +427,15 @@ GlossaryElement getGlossaryByGUID(String userId, String createGlossaryCategory(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, - GlossaryCategoryProperties glossaryCategoryProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -369,6 +444,8 @@ String createGlossaryCategory(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the category is located * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -382,6 +459,8 @@ String createGlossaryCategory(String userId, String createGlossaryCategoryFromTemplate(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, + String glossaryGUID, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, @@ -705,9 +784,13 @@ List getGlossarySubCategories(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located - * @param externalIdentifierProperties optional properties used to define an external identifier + * @param externalIdentifierProperties optional properties used to define an external identifier for the term * @param glossaryTermProperties properties for the glossary term + * @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 unique identifier of the new metadata element for the glossary term * @@ -718,9 +801,13 @@ List getGlossarySubCategories(String userId, String createGlossaryTerm(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, - GlossaryTermProperties glossaryTermProperties) throws InvalidParameterException, + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -730,10 +817,14 @@ String createGlossaryTerm(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryTermProperties properties for the glossary term * @param initialStatus glossary term status to use when the object is created + * @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 unique identifier of the new metadata element for the glossary term * @@ -744,12 +835,16 @@ String createGlossaryTerm(String userId, String createControlledGlossaryTerm(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, GlossaryTermProperties glossaryTermProperties, - GlossaryTermStatus initialStatus) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + GlossaryTermStatus initialStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -758,6 +853,8 @@ String createControlledGlossaryTerm(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the term is located * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -771,6 +868,8 @@ String createControlledGlossaryTerm(String userId, String createGlossaryTermFromTemplate(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, + String glossaryGUID, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, @@ -1112,7 +1211,7 @@ void clearTermAsDataValue(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryTermGUID unique identifier of the metadata element to update * @param glossaryTermExternalIdentifier unique identifier of the glossary term in the external asset manager - * @param activityType type of activity + * @param properties type of activity * @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? @@ -1121,17 +1220,17 @@ void clearTermAsDataValue(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 setTermAsActivity(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryTermGUID, - String glossaryTermExternalIdentifier, - GlossaryTermActivityType activityType, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void setTermAsActivity(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryTermGUID, + String glossaryTermExternalIdentifier, + ActivityDescriptionProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** @@ -1647,6 +1746,8 @@ GlossaryTermElement getGlossaryTermByGUID(String userId, * Retrieve all the versions of a glossary term. * * @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 guid unique identifier of object to retrieve * @param fromTime the earliest point in time from which to retrieve historical versions of the entity (inclusive) * @param toTime the latest point in time from which to retrieve historical versions of the entity (exclusive) diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/GovernanceExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/GovernanceExchangeInterface.java similarity index 81% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/GovernanceExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/GovernanceExchangeInterface.java index b03405b1573..c906e7bc0b5 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/GovernanceExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/GovernanceExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionProcessElement; @@ -230,103 +230,6 @@ GovernanceDefinitionElement getGovernanceDefinitionByDocId(String userId, PropertyServerException; - /** - * Link a governance definition to an element using the GovernedBy relationship. - * - * @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 definitionGUID identifier of the governance definition to link - * @param elementGUID unique identifier of the metadata element to link - * @param methodName calling method - * - * @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) - */ - void addGovernanceDefinitionToElement(String userId, - String assetManagerGUID, - String assetManagerName, - String definitionGUID, - String elementGUID, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Remove the GovernedBy relationship between a governance definition and an 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 definitionGUID identifier of the governance definition to link - * @param elementGUID unique identifier of the metadata element to update - * @param methodName calling method - * - * @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) - */ - void removeGovernanceDefinitionFromElement(String userId, - String assetManagerGUID, - String assetManagerName, - String definitionGUID, - String elementGUID, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Classify the element to assert that it is part of a subject area 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 elementGUID unique identifier of the metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param subjectAreaName qualified name of subject area - * @param methodName calling method - * - * @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) - */ - void addElementToSubjectArea(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - String subjectAreaName, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - - - /** - * Remove the subject area designation from the identified 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 metadata element to update - * @param externalElementIdentifier unique identifier of the equivalent element in the external asset manager - * @param methodName calling method - * - * @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) - */ - void removeElementFromSubjectArea(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String externalElementIdentifier, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; - /** * Retrieve the list of governance action process metadata elements that contain the search string. diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/InfrastructureExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/InfrastructureExchangeInterface.java similarity index 82% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/InfrastructureExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/InfrastructureExchangeInterface.java index 2d1e6b319ca..791ce2588a9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/InfrastructureExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/InfrastructureExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; /** * The InfrastructureExchangeInterface supports the exchange of metadata about Hosts, SoftwareServerPlatforms, SoftwareServers diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/LineageExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/LineageExchangeInterface.java similarity index 93% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/LineageExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/LineageExchangeInterface.java index eb4b0fba591..75c2f923306 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/LineageExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/LineageExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; @@ -1721,4 +1721,115 @@ List getSourceLineageMappings(String userId, boolean forDuplicateProcessing) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; + + /** + * Classify the element with the Memento classification to indicate that it has been logically deleted for by lineage requests. + * + * @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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void addMementoClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the memento designation from the 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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void clearMementoClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the element with the Incomplete classification to indicate that it has more details to come. + * + * @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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void addIncompleteClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the Incomplete designation from the 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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void clearIncompleteClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + 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/SchemaExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/SchemaExchangeInterface.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/SchemaExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/SchemaExchangeInterface.java index e15a3d8f8b1..9cf1c5e9fcc 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/SchemaExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/SchemaExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaTypeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaAttributeElement; 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 new file mode 100644 index 00000000000..14b0b1cdf47 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/StewardshipExchangeInterface.java @@ -0,0 +1,615 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; + +import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +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.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.Date; + + +/** + * The StewardshipExchangeInterface supports the exchange of relationships (such as SemanticAssignment) + * and classifications that are added by stewards (or automated stewardship processes) such as Confidentiality. + */ +public interface StewardshipExchangeInterface +{ + /** + * Classify/reclassify the element (typically an asset) to indicate the level of confidence that the organization + * has that the data is complete, accurate and up-to-date. The level of confidence is expressed by the + * levelIdentifier property. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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) + */ + void setConfidenceClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidence to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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) + */ + void clearConfidenceClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + 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. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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) + */ + void setCriticalityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + GovernanceClassificationProperties properties, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the criticality classification from the element. This normally occurs when the organization has lost track of the level of + * criticality to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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) + */ + void clearCriticalityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + 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 + * of confidentiality is a suggestion for any element linked to the glossary term via the SemanticAssignment classification. + * The level of confidence is expressed by the levelIdentifier property. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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) + */ + void setConfidentialityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidentiality to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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) + */ + void clearConfidentialityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + 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 + * property. The dates after which the element/resource is archived and then deleted are specified in the archiveAfter and deleteAfter + * properties respectively. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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) + */ + void setRetentionClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + RetentionClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the retention classification from the element. This normally occurs when the organization has lost track of, or no longer needs to + * track the retention period to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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) + */ + void clearRetentionClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Add or replace the security tags for an 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 element to link it to - its type must inherit from Referenceable. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the security tags + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addSecurityTags(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + SecurityTagsProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the security tags classification from an 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 element where the security tags need to be removed. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearSecurityTags(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add or replace the ownership classification for an 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 element to link it to - its type must inherit from Referenceable. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the ownership + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addOwnership(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + OwnerProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the ownership classification from an 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 element where the classification needs to be removed. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearOwnership(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add or replace the origin classification for an asset. + * + * @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 assetGUID element to link it to - its type must inherit from Asset. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the origin + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addAssetOrigin(String userId, + String assetManagerGUID, + String assetManagerName, + String assetGUID, + String externalIdentifier, + AssetOriginProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the origin classification from an asset. + * + * @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 assetGUID element where the classification needs to be removed. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearAssetOrigin(String userId, + String assetManagerGUID, + String assetManagerName, + String assetGUID, + String externalIdentifier, + 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. + * + * @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 elementGUID unique identifier of the metadata element to update + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties qualified name of subject area + * @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? + * + * @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) + */ + void addElementToSubjectArea(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + SubjectAreaMemberProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the subject area designation from the identified 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 elementGUID unique identifier of the metadata element to update + * @param externalIdentifier unique identifier of the equivalent element in the external asset manager + * @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? + * + * @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) + */ + void removeElementFromSubjectArea(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + 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. + * + * @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 that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @param properties properties for the relationship + * @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? + * + * @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) + */ + void setupSemanticAssignment(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String glossaryTermGUID, + SemanticAssignmentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a semantic assignment relationship between an element and its 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 elementGUID unique identifier of the element that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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? + * + * @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) + */ + void clearSemanticAssignment(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Link a governance definition to an element using the GovernedBy relationship. + * + * @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 definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to link + * @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? + * + * @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) + */ + void addGovernanceDefinitionToElement(String userId, + String assetManagerGUID, + String assetManagerName, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Remove the GovernedBy relationship between a governance definition and an 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 definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void removeGovernanceDefinitionFromElement(String userId, + String assetManagerGUID, + String assetManagerName, + String definitionGUID, + String elementGUID, + 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/ValidValuesExchangeInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ValidValuesExchangeInterface.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ValidValuesExchangeInterface.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ValidValuesExchangeInterface.java index 1e8e466b4ce..8f943a17e43 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/ValidValuesExchangeInterface.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/ValidValuesExchangeInterface.java @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.api; +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ValidValueElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/package-info.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/package-info.java new file mode 100644 index 00000000000..4fd49a0d62e --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/exchange/package-info.java @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * This package contains the different interfaces of the asset manager when it is being used to exchange metadata with one or + * more external asset managers via the integration services (OMISs). + * + * Each interface is focused on the exchange of groups of related metadata elements between a third party + * asset manager and open metadata. + * + *
    + *
  • ExternalAssetManagerInterface - interface for managing external identifiers
  • + *
  • CollaborationExchangeInterface - for exchanging feedback information from users such as likes, ratings and comments. + * There is also support for informal tags.
  • + *
  • DataAssetExchange - for exchange of data related assets, their schemas, connections and lineage.
  • + *
  • GlossaryExchangeInterface - for exchange of Glossaries, GlossaryCategories, GlossaryTerms and + * their relationships and classifications.
  • + *
  • GovernanceExchangeInterface - for exchange of information about policies and rules.
  • + *
  • InfrastructureExchangeInterface - for exchanging metadata about hosts, containers, applications, + * servers and server capabilities.
  • + *
  • LineageExchangeInterface - for exchanging process definitions and lineage linkage.
  • + *
  • StewardshipExchangeInterface - for exchanging information about classifications, exceptions, requests for actions and + * resolutions.
  • + *
  • ValidValuesExchangeInterface - for exchanging information about reference data.
  • + *
+ */ +package org.odpi.openmetadata.accessservices.assetmanager.api.exchange; 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 new file mode 100644 index 00000000000..63ecbdbf932 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/CollaborationManagementInterface.java @@ -0,0 +1,1001 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.api.management; + +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.InformalTagProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +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 java.util.Date; +import java.util.List; + +/** + * The CollaborationManagementInterface supports the exchange of comments, likes, reviews/ratings and + * informal tags. + */ +public interface CollaborationManagementInterface +{ + /** + * Adds a star rating and optional review text to the element. If the user has already attached + * a rating then the original one is over-ridden. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element. + * @param isPublic is this visible to other people + * @param properties properties for the rating + * @return unique identifier of the rating + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String addRatingToElement(String userId, + String elementGUID, + boolean isPublic, + RatingProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes of a review that was added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element where the rating is attached. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void removeRatingFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Adds a "LikeProperties" to the element. If the user has already attached a like then the original one + * is over-ridden. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element where the like is to be attached. + * @param isPublic is this visible to other people + * @param properties indicates whether the feedback should be shared or only be visible to the originating user + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void addLikeToElement(String userId, + String elementGUID, + boolean isPublic, + LikeProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes a "LikeProperties" added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element where the like is attached. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void removeLikeFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Adds a comment to the element. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element. + * @param isPublic is this comment visible to other people. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String addCommentToElement(String userId, + String elementGUID, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Adds a comment to another comment. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for an existing comment. Used to add a reply to a comment. + * @param properties properties of the comment + * @param isPublic who can retrieve the relationship + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String addCommentReply(String userId, + String commentGUID, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Update an existing comment. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for the comment to change. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param properties properties of the comment + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void updateComment(String userId, + String commentGUID, + boolean isMergeUpdate, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param properties is this visible to other people + * @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? + * + * @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) + */ + void setupAcceptedAnswer(String userId, + String questionCommentGUID, + String answerCommentGUID, + FeedbackProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @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? + * + * @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) + */ + void clearAcceptedAnswer(String userId, + String questionCommentGUID, + String answerCommentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Removes a comment added to the element by this user. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for the comment object. + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + void removeComment(String userId, + String commentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the requested comment. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for the comment object. + * @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 comment properties + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + CommentElement getComment(String userId, + String commentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the comments attached to an element. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). + * @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 comments + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + List getAttachedComments(String userId, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Retrieve the list of comment metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @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 findComments(String userId, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Creates a new informal tag and returns the unique identifier for it. + * + * @param userId userId of user making request. + * @param properties name of the tag and (optional) description. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic note. + * + * @return GUID for new tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String createInformalTag(String userId, + InformalTagProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Updates the description of an existing tag (either private or public). + * + * @param userId userId of user making request. + * @param tagGUID unique identifier for the tag. + * @param tagDescription description of the tag. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic glossary term. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void updateTagDescription(String userId, + String tagGUID, + String tagDescription) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes an informal tag from the repository. All the tagging relationships to this informal tag are lost. + * A private tag can be deleted by its creator and all the references are lost; + * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. + * + * @param userId userId of user making request. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void deleteTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the tag for the supplied unique identifier (guid). + * + * @param userId userId of the user making the request. + * @param guid unique identifier of the tag. + * + * @return tag + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + InformalTagElement getTag(String userId, + String guid) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List getTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of the calling user's private tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List getMyTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List findTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /** + * Return the list of the calling user's private tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List findMyTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /** + * Adds a tag (either private of public) to an element. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id of the tag. + * @param isPublic flag indicating whether the attachment of the tag is public or not + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void addTagToElement(String userId, + String elementGUID, + String tagGUID, + boolean isPublic) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Removes a tag from the element that was added by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + void removeTagFromElement(String userId, + String elementGUID, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return the list of unique identifiers for elements that are linked to a specific tag either directly, or via one + * of its schema elements. An Element's GUID may appear multiple times in the results if it is tagged multiple times + * with the requested tag. + * + * @param userId the name of the calling user. + * @param tagGUID unique identifier of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return element guid list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + List getElementsByTag(String userId, + String tagGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /* ===================================================================================================================== + * A note log maintains an ordered list of notes. It can be used to support release note, blogs and similar + * broadcast information. Notelogs are typically maintained by the owners/stewards of an element. + */ + + /** + * Create a new metadata element to represent a note log and attach it to an element (if supplied). + * Any supplied element becomes the note log's anchor, causing the note log to be deleted if/when the element is deleted. + * + * @param userId calling user + * @param elementGUID unique identifier of the element where the note log is located + * @param noteLogProperties properties about the note log to store + * @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 unique identifier of the new note log + * + * @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) + */ + String createNoteLog(String userId, + String elementGUID, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a note log using an existing metadata element as a template. + * + * @param userId calling user + * @param elementGUID unique identifier of the element where the note log is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new note log + * + * @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) + */ + String createNoteLogFromTemplate(String userId, + String elementGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a note log. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param noteLogProperties new properties for the metadata element + * @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? + * + * @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) + */ + void updateNoteLog(String userId, + String noteLogGUID, + boolean isMergeUpdate, + boolean isPublic, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a note log. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to remove + * @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? + * + * @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) + */ + void removeNoteLog(String userId, + String noteLogGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @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 findNoteLogs(String userId, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @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 getNoteLogsByName(String userId, + String name, + 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. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the requested metadata element + * @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 requested metadata element + * + * @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) + */ + NoteLogElement getNoteLogByGUID(String userId, + String noteLogGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /* =============================================================================== + * A element typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the element where the note is located + * @param noteProperties properties for the note + * @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 unique identifier of the new metadata element for the note + * + * @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) + */ + String createNote(String userId, + String noteLogGUID, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Create a new metadata element to represent a note using an existing metadata element as a template. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the element where the note is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element for the note + * + * @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) + */ + String createNoteFromTemplate(String userId, + String noteLogGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the properties of the metadata element representing a note. + * + * @param userId calling user + * @param noteGUID unique identifier of the note to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param noteProperties new properties for the note + * @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? + * + * @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) + */ + void updateNote(String userId, + String noteGUID, + boolean isMergeUpdate, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Undo the last update to the note. + * + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to update + * @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 recovered note + * + * @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) + */ + NoteElement undoNoteUpdate(String userId, + String noteGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Archive the metadata element representing a note. This removes it from normal access. However, it is still available + * for lineage requests. + * + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to archive + * @param archiveProperties option parameters about the archive process + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void archiveNote(String userId, + String noteGUID, + ArchiveProperties archiveProperties, + Date effectiveTime, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a note. + * + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to remove + * @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? + * + * @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) + */ + void removeNote(String userId, + String noteGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param elementGUID unique identifier of the element to query + * @param searchString string to find in the properties + * @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 findNotes(String userId, + String elementGUID, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of notes associated with a note log. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the note log of interest + * @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 associated 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 getNotesForNoteLog(String userId, + String noteLogGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of note metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param elementGUID unique identifier of the element to query + * @param name name to search for + * @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 getNotesByName(String userId, + String elementGUID, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param noteGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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) + */ + NoteElement getNoteByGUID(String userId, + String noteGUID, + 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/GlossaryManagementInterface.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/GlossaryManagementInterface.java new file mode 100644 index 00000000000..c3916a4c7dc --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/GlossaryManagementInterface.java @@ -0,0 +1,1741 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.api.management; + +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalGlossaryLinkElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CanonicalVocabularyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryElementLinkProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryLinkProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryCategoryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermContextDefinition; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationship; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermStatus; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TaxonomyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ActivityDescriptionProperties; +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 java.util.Date; +import java.util.List; + +/** + * GlossaryManagementInterface defines the client side interface for the Asset Manager OMAS that is + * relevant for managing glossaries. It provides the ability to + * define and maintain the content of glossary as well as govern it. + * + * Glossaries have a top-level root object that describe the purpose, language and intended usage of its + * content. Linked to the glossary's root object are the terms, categories and relationships it contains. + * + * In addition to the content, the glossary can be augmented with classifications and linked to + * external glossary definitions. + */ +public interface GlossaryManagementInterface +{ + + /* + * The Glossary entity is the top level element in a glossary. + */ + + /** + * Create a new metadata element to represent the root of a glossary. All categories and terms are linked + * to a single glossary. They are owned by this glossary and if the glossary is deleted, any linked terms and + * categories are deleted as well. + * + * @param userId calling user + * @param glossaryProperties properties to store + * + * @return unique identifier of the new metadata element + * + * @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) + */ + String createGlossary(String userId, + GlossaryProperties glossaryProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a glossary using an existing metadata element as a template. + * The template defines additional classifications and relationships that should be added to the new glossary. + * + * All categories and terms are linked to a single glossary. They are owned by this glossary and if the + * glossary is deleted, any linked terms and categories are deleted as well. + * + * @param userId calling user + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element + * + * @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) + */ + String createGlossaryFromTemplate(String userId, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param glossaryProperties new properties for this element + * @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? + * + * @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) + */ + void updateGlossary(String userId, + String glossaryGUID, + boolean isMergeUpdate, + GlossaryProperties glossaryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the glossary to indicate that it can be used as a taxonomy. + * This means each term is attached to one, and only one category and the categories are organized as a hierarchy + * with a single root category. + * + * Taxonomies are used as a way of organizing assets and other related metadata. The terms in the taxonomy + * are linked to the assets etc. and as such they are logically categorized by the linked category. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to classify + * @param taxonomyProperties description of how the glossary is organized + * @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? + * + * @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) + */ + void setGlossaryAsTaxonomy(String userId, + String glossaryGUID, + TaxonomyProperties taxonomyProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the taxonomy designation from the glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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) + */ + void clearGlossaryAsTaxonomy(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify a glossary to declare that it has no two GlossaryTerm definitions with + * the same name. This means there is only one definition for each term. Typically, the terms are also of a similar + * level of granularity and are limited to a specific scope of use. + * + * Canonical vocabularies are used to semantically classify assets in an unambiguous way. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to classify + * @param properties description of the situations where this glossary is relevant. + * @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? + * + * @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) + */ + void setGlossaryAsCanonical(String userId, + String glossaryGUID, + CanonicalVocabularyProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the canonical designation from the glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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) + */ + void clearGlossaryAsCanonical(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a glossary. This will delete the glossary and all categories + * and terms. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to remove + * @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? + * + * @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) + */ + void removeGlossary(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @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 findGlossaries(String userId, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @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 getGlossariesByName(String userId, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the glossary metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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) + */ + GlossaryElement getGlossaryByGUID(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /* ===================================================================================================================== + * A glossary may host one or more glossary categories depending on its capability + */ + + /** + * Create a new metadata element to represent a glossary category. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param glossaryCategoryProperties properties about the glossary category to store + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * + * @return unique identifier of the new glossary category + * + * @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) + */ + String createGlossaryCategory(String userId, + String glossaryGUID, + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a glossary category using an existing metadata element as a template. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new glossary category + * + * @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) + */ + String createGlossaryCategoryFromTemplate(String userId, + String glossaryGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the metadata element representing a glossary category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param glossaryCategoryProperties new properties for the metadata element + * @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? + * + * @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) + */ + void updateGlossaryCategory(String userId, + String glossaryCategoryGUID, + boolean isMergeUpdate, + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a parent-child relationship between two categories. + * + * @param userId calling user + * @param glossaryParentCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the super-category + * @param glossaryChildCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the subcategory + * @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? + * + * @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) + */ + void setupCategoryParent(String userId, + String glossaryParentCategoryGUID, + String glossaryChildCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a parent-child relationship between two categories. + * + * @param userId calling user + * @param glossaryParentCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the super-category + * @param glossaryChildCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the subcategory + * @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? + * + * @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) + */ + void clearCategoryParent(String userId, + String glossaryParentCategoryGUID, + String glossaryChildCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a glossary category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the metadata element to remove + * @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? + * + * @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) + */ + void removeGlossaryCategory(String userId, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary category metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param glossaryGUID optional glossary unique identifier to scope the search to a glossary. + * @param searchString string to find in the properties + * @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 findGlossaryCategories(String userId, + String glossaryGUID, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the list of categories associated with a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary to query + * @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 metadata elements describing the categories associated with the requested glossary + * + * @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 getCategoriesForGlossary(String userId, + String glossaryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary category metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param glossaryGUID optional glossary unique identifier to scope the search to a glossary. + * @param name name to search for + * @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 getGlossaryCategoriesByName(String userId, + String glossaryGUID, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the glossary category metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the requested metadata element + * @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 requested metadata element + * + * @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) + */ + GlossaryCategoryElement getGlossaryCategoryByGUID(String userId, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the glossary category metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the requested metadata element + * @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 parent glossary category element + * + * @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) + */ + GlossaryCategoryElement getGlossaryCategoryParent(String userId, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the glossary category metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the requested metadata element + * @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 glossary category element + * + * @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 getGlossarySubCategories(String userId, + String glossaryCategoryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /* =============================================================================== + * A glossary typically contains many glossary terms, linked with relationships. + */ + + /** + * Create a new metadata element to represent a glossary term. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param glossaryTermProperties properties for the glossary term + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * + * @return unique identifier of the new metadata element for the glossary term + * + * @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) + */ + String createGlossaryTerm(String userId, + String glossaryGUID, + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Create a new metadata element to represent a glossary term whose lifecycle is managed through a controlled workflow. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param glossaryTermProperties properties for the glossary term + * @param initialStatus glossary term status to use when the object is created + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * + * @return unique identifier of the new metadata element for the glossary term + * + * @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) + */ + String createControlledGlossaryTerm(String userId, + String glossaryGUID, + GlossaryTermProperties glossaryTermProperties, + GlossaryTermStatus initialStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a new metadata element to represent a glossary term using an existing metadata element as a template. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element for the glossary term + * + * @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) + */ + String createGlossaryTermFromTemplate(String userId, + String glossaryGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the properties of the metadata element representing a glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param glossaryTermProperties new properties for the glossary term + * @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? + * + * @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) + */ + void updateGlossaryTerm(String userId, + String glossaryTermGUID, + boolean isMergeUpdate, + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the status of the metadata element representing a glossary term. This is only valid on + * a controlled glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term to update + * @param glossaryTermStatus new properties for the glossary term + * @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? + * + * @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) + */ + void updateGlossaryTermStatus(String userId, + String glossaryTermGUID, + GlossaryTermStatus glossaryTermStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Link a term to a category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the glossary category + * @param glossaryTermGUID unique identifier of the glossary term + * @param categorizationProperties properties for the categorization relationship + * @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? + * + * @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) + */ + void setupTermCategory(String userId, + String glossaryCategoryGUID, + String glossaryTermGUID, + GlossaryTermCategorization categorizationProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Unlink a term from a category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the glossary category + * @param glossaryTermGUID unique identifier of the glossary term + * @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? + * + * @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) + */ + void clearTermCategory(String userId, + String glossaryCategoryGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Link two terms together using a specialist relationship. + * + * @param userId calling user + * @param relationshipTypeName name of the type of relationship to create + * @param glossaryTermOneGUID unique identifier of the glossary term at end 1 + * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 + * @param relationshipsProperties properties related to the new relationship + * @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? + * + * @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) + */ + void setupTermRelationship(String userId, + String relationshipTypeName, + String glossaryTermOneGUID, + String glossaryTermTwoGUID, + GlossaryTermRelationship relationshipsProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Update the relationship properties for the two terms. + * + * @param userId calling user + * @param relationshipTypeName name of the type of relationship to create + * @param glossaryTermOneGUID unique identifier of the glossary term at end 1 + * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 + * @param relationshipsProperties properties for the relationship + * @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? + * + * @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) + */ + void updateTermRelationship(String userId, + String relationshipTypeName, + String glossaryTermOneGUID, + String glossaryTermTwoGUID, + GlossaryTermRelationship relationshipsProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the relationship between two terms. + * + * @param userId calling user + * @param relationshipTypeName name of the type of relationship to create + * @param glossaryTermOneGUID unique identifier of the glossary term at end 1 + * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 + * @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? + * + * @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) + */ + void clearTermRelationship(String userId, + String relationshipTypeName, + String glossaryTermOneGUID, + String glossaryTermTwoGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Classify the glossary term to indicate that it describes an abstract concept. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void setTermAsAbstractConcept(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the abstract concept designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsAbstractConcept(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the glossary term to indicate that it describes a data value. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void setTermAsDataValue(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the data value designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsDataValue(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the glossary term to indicate that it describes a data value. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @param properties type of activity + * @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? + * + * @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) + */ + void setTermAsActivity(String userId, + String glossaryTermGUID, + ActivityDescriptionProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the activity designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsActivity(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the glossary term to indicate that it describes a context. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @param contextDefinition more details of the context + * @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? + * + * @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) + */ + void setTermAsContext(String userId, + String glossaryTermGUID, + GlossaryTermContextDefinition contextDefinition, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the context definition designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsContext(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the glossary term to indicate that it describes a spine object. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void setTermAsSpineObject(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the spine object designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsSpineObject(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Classify the glossary term to indicate that it describes a spine attribute. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void setTermAsSpineAttribute(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the spine attribute designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsSpineAttribute(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + + /** + * Classify the glossary term to indicate that it describes an object identifier. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void setTermAsObjectIdentifier(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the object identifier designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void clearTermAsObjectIdentifier(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Undo the last update to the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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 recovered glossary term + * + * @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) + */ + GlossaryTermElement undoGlossaryTermUpdate(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Archive the metadata element representing a glossary term. This removes it from normal access. However, it is still available + * for lineage requests. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to archive + * @param archiveProperties option parameters about the archive process + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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) + */ + void archiveGlossaryTerm(String userId, + String glossaryTermGUID, + ArchiveProperties archiveProperties, + Date effectiveTime, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the metadata element representing a glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to remove + * @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? + * + * @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) + */ + void removeGlossaryTerm(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary term metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary to query + * @param searchString string to find in the properties + * @param limitResultsByStatus By default, terms in all statuses are returned. However, it is possible + * to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values. + * @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 findGlossaryTerms(String userId, + String glossaryGUID, + String searchString, + List limitResultsByStatus, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary terms associated with a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary of interest + * @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 associated 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 getTermsForGlossary(String userId, + String glossaryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary terms associated with a glossary category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the glossary category of interest + * @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 associated 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 getTermsForGlossaryCategory(String userId, + String glossaryCategoryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of glossary term metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary to query + * @param name name to search for + * @param limitResultsByStatus By default, terms in all statuses are returned. However, it is possible + * to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values. + * @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 getGlossaryTermsByName(String userId, + String glossaryGUID, + String name, + List limitResultsByStatus, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the glossary term metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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) + */ + GlossaryTermElement getGlossaryTermByGUID(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Retrieve all the versions of a glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of object to retrieve + * @param fromTime the earliest point in time from which to retrieve historical versions of the entity (inclusive) + * @param toTime the latest point in time from which to retrieve historical versions of the entity (exclusive) + * @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 oldestFirst defining how the results should be ordered. + * @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) + * @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. + */ + List getGlossaryTermHistory(String userId, + String glossaryTermGUID, + Date fromTime, + Date toTime, + int startFrom, + int pageSize, + boolean oldestFirst, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /* ========================================================================================= + * 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. + * It is possible that the external glossary resource may have been generated by the metadata + * representation or vice versa. + */ + + + /** + * Create a link to an external glossary resource. This is associated with a glossary to show that they have equivalent content. + * It is possible that this resource was generated from the glossary content or was the source for it. + * + * @param userId calling user + * @param linkProperties properties of the link + * + * @return unique identifier of the external reference + * + * @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) + */ + String createExternalGlossaryLink(String userId, + ExternalGlossaryLinkProperties linkProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Update the properties of a reference to an external glossary resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param linkProperties properties of the link + * @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? + * + * @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) + */ + void updateExternalGlossaryLink(String userId, + String externalLinkGUID, + boolean isMergeUpdate, + ExternalGlossaryLinkProperties linkProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove information about a link to an external glossary resource (and the relationships that attached it to the glossaries). + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @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? + * + * @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) + */ + void removeExternalGlossaryLink(String userId, + String externalLinkGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Connect a glossary to a reference to an external glossary resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryGUID unique identifier of the metadata element to attach + * @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? + * + * @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) + */ + void attachExternalLinkToGlossary(String userId, + String externalLinkGUID, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Disconnect a glossary from a reference to an external glossary resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryGUID unique identifier of the metadata element to remove + * @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? + * + * @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) + */ + void detachExternalLinkFromGlossary(String userId, + String externalLinkGUID, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve the list of links to external glossary resources attached to a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element for the glossary of interest + * @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 attached links to external glossary resources + * + * @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 getExternalLinksForGlossary(String userId, + String glossaryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return the glossaries connected to an external glossary source. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the metadata element for the external glossary link of interest + * @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 glossaries + * + * @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 getGlossariesForExternalLink(String userId, + String externalLinkGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a link to an external glossary category resource. This is associated with a category to show that they have equivalent content. + * It is possible that this resource was generated from the glossary content or was the source for it. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryCategoryGUID unique identifier for the glossary category + * @param linkProperties properties of the link + * @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? + * + * @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) + */ + void attachExternalCategoryLink(String userId, + String externalLinkGUID, + String glossaryCategoryGUID, + ExternalGlossaryElementLinkProperties linkProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the link to an external glossary category resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryCategoryGUID unique identifier for the glossary category + * @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? + * + * @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) + */ + void detachExternalCategoryLink(String userId, + String externalLinkGUID, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a link to an external glossary term resource. This is associated with a term to show that they have equivalent content. + * It is possible that this resource was generated from the glossary content or was the source for it. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryTermGUID unique identifier for the glossary category + * @param linkProperties properties of the link + * @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? + * + * @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) + */ + void attachExternalTermLink(String userId, + String externalLinkGUID, + String glossaryTermGUID, + ExternalGlossaryElementLinkProperties linkProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the link to an external glossary term resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryTermGUID unique identifier for the glossary category + * @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? + * + * @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) + */ + void detachExternalTermLink(String userId, + String externalLinkGUID, + String glossaryTermGUID, + 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/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 new file mode 100644 index 00000000000..9ca82c4ee72 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/StewardshipManagementInterface.java @@ -0,0 +1,502 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.api.management; + +import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +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.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.Date; + + +/** + * The StewardshipManagementInterface supports the exchange of relationships (such as SemanticAssignment) + * and classifications that are added by stewards (or automated stewardship processes) such as Confidentiality. + */ +public interface StewardshipManagementInterface +{ + /** + * Classify/reclassify the element (typically an asset) to indicate the level of confidence that the organization + * has that the data is complete, accurate and up-to-date. The level of confidence is expressed by the + * levelIdentifier property. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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) + */ + void setConfidenceClassification(String userId, + String elementGUID, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidence to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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) + */ + void clearConfidenceClassification(String userId, + String elementGUID, + 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. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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) + */ + void setCriticalityClassification(String userId, + String elementGUID, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the criticality classification from the element. This normally occurs when the organization has lost track of the level of + * criticality to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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) + */ + void clearCriticalityClassification(String userId, + String elementGUID, + 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 + * of confidentiality is a suggestion for any element linked to the glossary term via the SemanticAssignment classification. + * The level of confidence is expressed by the levelIdentifier property. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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) + */ + void setConfidentialityClassification(String userId, + String elementGUID, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidentiality to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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) + */ + void clearConfidentialityClassification(String userId, + String elementGUID, + 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 + * property. The dates after which the element/resource is archived and then deleted are specified in the archiveAfter and deleteAfter + * properties respectively. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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) + */ + void setRetentionClassification(String userId, + String elementGUID, + RetentionClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the retention classification from the element. This normally occurs when the organization has lost track of, or no longer needs to + * track the retention period to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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) + */ + void clearRetentionClassification(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + /** + * Add or replace the security tags for an element. + * + * @param userId calling user + * @param elementGUID element to link it to - its type must inherit from Referenceable. + * @param properties details of the security tags + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addSecurityTags(String userId, + String elementGUID, + SecurityTagsProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the security tags classification from an element. + * + * @param userId calling user + * @param elementGUID element where the security tags need to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearSecurityTags(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add or replace the ownership classification for an element. + * + * @param userId calling user + * @param elementGUID element to link it to - its type must inherit from Referenceable. + * @param properties details of the ownership + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addOwnership(String userId, + String elementGUID, + OwnerProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the ownership classification from an element. + * + * @param userId calling user + * @param elementGUID element where the classification needs to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearOwnership(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add or replace the origin classification for an asset. + * + * @param userId calling user + * @param assetGUID element to link it to - its type must inherit from Asset. + * @param properties details of the origin + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addAssetOrigin(String userId, + String assetGUID, + AssetOriginProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the origin classification from an asset. + * + * @param userId calling user + * @param assetGUID element where the classification needs to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearAssetOrigin(String userId, + String assetGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Classify the element to assert that it is part of a subject area definition. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @param properties qualified name of subject area + * @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? + * + * @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) + */ + void addElementToSubjectArea(String userId, + String elementGUID, + SubjectAreaMemberProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the subject area designation from the identified element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void removeElementFromSubjectArea(String userId, + String elementGUID, + 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. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @param properties properties for relationship + * @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? + * + * @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) + */ + void setupSemanticAssignment(String userId, + String elementGUID, + String glossaryTermGUID, + SemanticAssignmentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a semantic assignment relationship between an element and its glossary term. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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? + * + * @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) + */ + void clearSemanticAssignment(String userId, + String elementGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Link a governance definition to an element using the GovernedBy relationship. + * + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to link + * @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? + * + * @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) + */ + void addGovernanceDefinitionToElement(String userId, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the GovernedBy relationship between a governance definition and an element. + * + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to update + * @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? + * + * @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) + */ + void removeGovernanceDefinitionFromElement(String userId, + String definitionGUID, + String elementGUID, + 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/package-info.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/package-info.java new file mode 100644 index 00000000000..a0b39b00f30 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/management/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * This package provides interfaces for applications that wish to use Egeria as their metadata repository. + */ +package org.odpi.openmetadata.accessservices.assetmanager.api.management; \ 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/api/package-info.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/package-info.java index 54a0c16b301..71c288fb7c4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/package-info.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/api/package-info.java @@ -2,25 +2,6 @@ /* Copyright Contributors to the ODPi Egeria project. */ /** - * This package contains the different interfaces of the asset manager. - * - * Each interface is focused on the exchange of groups of related metadata elements between a third party - * asset manager and open metadata. - * - *
    - *
  • AssetManagerInterface - interface for managing external identifiers
  • - *
  • CollaborationExchangeInterface - for exchanging feedback information from users such as likes, ratings and comments. - * There is also support for informal tags.
  • - *
  • DataAssetExchange - for exchange of data related assets, their schemas, connections and lineage.
  • - *
  • GlossaryExchangeInterface - for exchange of Glossaries, GlossaryCategories, GlossaryTerms and - * their relationships and classifications.
  • - *
  • GovernanceExchangeInterface - for exchange of information about policies and rules.
  • - *
  • InfrastructureExchangeInterface - for exchanging metadata about hosts, containers, applications, - * servers and server capabilities.
  • - *
  • LineageExchangeInterface - for exchanging process definitions and lineage linkage.
  • - *
  • StewardshipExchangeInterface - for exchanging information about classifications, exceptions, requests for actions and - * resolutions.
  • - *
  • ValidValuesExchangeInterface - for exchanging information about reference data.
  • - *
+ * This package contains Asset Manager OMAS's event interfaces. */ package org.odpi.openmetadata.accessservices.assetmanager.api; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/CommentElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/CommentElement.java index 38ab63035ec..68f1c086496 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/CommentElement.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/CommentElement.java @@ -29,10 +29,12 @@ public class CommentElement implements MetadataElement, Serializable @Serial private static final long serialVersionUID = 1L; - private ElementHeader elementHeader = null; + private ElementHeader elementHeader = null; private List correlationHeaders = null; private CommentProperties properties = null; private FeedbackTargetElement feedbackTargetElement = null; + private List acceptedAnswers = null; + private List questionsAnswered = null; /** @@ -168,6 +170,50 @@ public void setFeedbackTargetElement(FeedbackTargetElement feedbackTargetElement } + /** + * Return details of any comment that provides an accepted answer to the question posed in this comment. + * + * @return list of comment headers + */ + public List getAcceptedAnswers() + { + return acceptedAnswers; + } + + + /** + * Set up details of any comment that provides an accepted answer to the question posed in this comment. + * + * @param acceptedAnswers list of comment headers + */ + public void setAcceptedAnswers(List acceptedAnswers) + { + this.acceptedAnswers = acceptedAnswers; + } + + + /** + * Return details of any comment that poses a question that this comment answers. + * + * @return list of comment headers + */ + public List getQuestionsAnswered() + { + return questionsAnswered; + } + + + /** + * Set up details of any comment that poses a question that this comment answers. + * + * @param questionsAnswered list of comment headers + */ + public void setQuestionsAnswered(List questionsAnswered) + { + this.questionsAnswered = questionsAnswered; + } + + /** * JSON-style toString * diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/LikeElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/LikeElement.java index ae23528303e..9e93208c106 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/LikeElement.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/LikeElement.java @@ -30,7 +30,7 @@ public class LikeElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private List correlationHeaders = null; - private LikeProperties properties = null; + private LikeProperties properties = null; private FeedbackTargetElement feedbackTargetElement = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RatingElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RatingElement.java index 6eacb7991e5..30ac6f4fa83 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RatingElement.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RatingElement.java @@ -30,7 +30,7 @@ public class RatingElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private List correlationHeaders = null; - private RatingProperties properties = null; + private RatingProperties properties = null; private FeedbackTargetElement feedbackTargetElement = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RelatedElement.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RelatedElement.java new file mode 100644 index 00000000000..6d3b78dba7d --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/metadataelements/RelatedElement.java @@ -0,0 +1,177 @@ +/* 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.RelationshipProperties; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; + +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; + +/** + * RelatedElement contains the properties and header for a relationship retrieved from the metadata repository along with the stub + * of the related element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElement implements Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementStub relatedElement = null; + + /** + * Default constructor + */ + public RelatedElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElement(RelatedElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element stub object + */ + public ElementStub getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param relatedElement element stub object + */ + public void setRelatedElement(ElementStub relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * 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; + } + RelatedElement that = (RelatedElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getRelatedElement(), that.getRelatedElement()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetConnectionProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetConnectionProperties.java index dc5ca4cb04c..43196d742aa 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetConnectionProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetConnectionProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.rest.AssetManagerIdentifiersRequestBody; +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 AssetConnectionProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String assetSummary = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetManagerProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetManagerProperties.java index f8eb9daa522..f26b912d8d4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetManagerProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetManagerProperties.java @@ -6,6 +6,8 @@ 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; @@ -17,6 +19,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class AssetManagerProperties extends SoftwareCapabilitiesProperties { + @Serial private static final long serialVersionUID = 1L; /** 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 new file mode 100644 index 00000000000..8a25f3812be --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetOriginProperties.java @@ -0,0 +1,170 @@ +/* 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 AssetOriginProperties extends ClassificationProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private String organizationGUID = null; + private String businessCapabilityGUID = null; + private Map otherOriginValues = null; + + + /** + * Default constructor + */ + public AssetOriginProperties() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AssetOriginProperties(AssetOriginProperties 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; + } + + + /** + * Equals method that returns true if containing properties are the same. + * + * @param objectToCompare object to compare + * @return boolean result of comparison + */ + /** + * JSON-style toString. + * + * @return list of properties and their values. + */ + @Override + public String toString() + { + return "AssetOriginProperties{" + + "organizationGUID='" + organizationGUID + '\'' + + ", businessCapabilityGUID='" + businessCapabilityGUID + '\'' + + ", otherOriginValues=" + otherOriginValues + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * 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/AssetProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetProperties.java index 6c4dadf9212..bd8970359d6 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/AssetProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.*; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -27,7 +28,8 @@ }) public class AssetProperties extends SupplementaryProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String technicalName = null; private String versionIdentifier = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ContextDefinitionClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CanonicalVocabularyProperties.java similarity index 50% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ContextDefinitionClassificationRequestBody.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CanonicalVocabularyProperties.java index b78697086c6..c23174a105f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ContextDefinitionClassificationRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CanonicalVocabularyProperties.java @@ -1,37 +1,40 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.rest; +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 org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermContextDefinition; -import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; -import java.io.Serializable; +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; /** - * ContextDefinitionClassificationRequestBody is used to classify a glossary term to say it described a context. + * CanonicalVocabularyProperties is used to classify a glossary that has no term definitions with + * the same name. This means there is only one definition for each term. Typically the terms are also of a similar + * level of granularity and are limited to a specific scope of use. + * + * Canonical vocabularies are typically used to semantically classify assets in an unambiguous way. */ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ContextDefinitionClassificationRequestBody extends UpdateRequestBody +public class CanonicalVocabularyProperties extends ClassificationProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; - private GlossaryTermContextDefinition contextDefinition = null; + private String scope = null; /** * Default constructor */ - public ContextDefinitionClassificationRequestBody() + public CanonicalVocabularyProperties() { super(); } @@ -42,36 +45,36 @@ public ContextDefinitionClassificationRequestBody() * * @param template template object to copy. */ - public ContextDefinitionClassificationRequestBody(ContextDefinitionClassificationRequestBody template) + public CanonicalVocabularyProperties(CanonicalVocabularyProperties template) { super(template); if (template != null) { - contextDefinition = template.getContextDefinition(); + scope = template.getScope(); } } /** - * Return the context definition for this term. + * Return the scope that the terms in the glossary covers. * * @return string description */ - public GlossaryTermContextDefinition getContextDefinition() + public String getScope() { - return contextDefinition; + return scope; } /** - * Set up the contextDefinition for this term. + * Set up the scope that the terms in the glossary covers. * - * @param contextDefinition string description + * @param scope string description */ - public void setContextDefinition(GlossaryTermContextDefinition contextDefinition) + public void setScope(String scope) { - this.contextDefinition = contextDefinition; + this.scope = scope; } @@ -83,10 +86,11 @@ public void setContextDefinition(GlossaryTermContextDefinition contextDefinition @Override public String toString() { - return "ContextDefinitionClassificationRequestBody{" + - "contextDefinition=" + contextDefinition + - ", metadataCorrelationProperties=" + getMetadataCorrelationProperties() + - ", effectiveTime=" + getEffectiveTime() + + return "CanonicalVocabularyProperties{" + + "scope='" + scope + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + '}'; } @@ -104,7 +108,7 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof CanonicalVocabularyProperties that)) { return false; } @@ -112,8 +116,7 @@ public boolean equals(Object objectToCompare) { return false; } - ContextDefinitionClassificationRequestBody that = (ContextDefinitionClassificationRequestBody) objectToCompare; - return Objects.equals(contextDefinition, that.contextDefinition); + return Objects.equals(scope, that.scope); } @@ -125,6 +128,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), contextDefinition); + return Objects.hash(super.hashCode(), scope); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CapabilityDeploymentProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CapabilityDeploymentProperties.java index c3baa8fc475..6e85c1496b9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CapabilityDeploymentProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CapabilityDeploymentProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -23,6 +24,7 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class CapabilityDeploymentProperties extends RelationshipProperties { + @Serial private static final long serialVersionUID = 1L; private static final String deploymentTimeProperty = "deploymentTime"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ClassificationProperties.java new file mode 100644 index 00000000000..37ec609c479 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ClassificationProperties.java @@ -0,0 +1,204 @@ +/* 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 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; + +/** + * ClassificationProperties provides the base class for classification items. This provides extended properties with the ability to + * set effectivity dates. + */ +@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 = AssetOriginProperties.class, name = "AssetOriginProperties"), + @JsonSubTypes.Type(value = CanonicalVocabularyProperties.class, name = "CanonicalVocabularyProperties"), + @JsonSubTypes.Type(value = GovernanceClassificationBase.class, name = "GovernanceClassificationBase"), + @JsonSubTypes.Type(value = OwnerProperties.class, name = "OwnerProperties"), + @JsonSubTypes.Type(value = SecurityTagsProperties.class, name = "SecurityTagsProperties"), + @JsonSubTypes.Type(value = TaxonomyProperties.class, name = "TaxonomyProperties"), + }) +public class ClassificationProperties implements Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public ClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public ClassificationProperties(ClassificationProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * 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; + } + ClassificationProperties that = (ClassificationProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ 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/CommentProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentProperties.java index f3cba972135..8ffb9b82d9f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentProperties.java @@ -32,7 +32,6 @@ public class CommentProperties extends ReferenceableProperties private CommentType commentType = null; private String commentText = null; private String user = null; - private boolean isPublic = false; /** * Default constructor @@ -60,7 +59,6 @@ public CommentProperties(CommentProperties template) commentType = template.getCommentType(); user = template.getUser(); commentText = template.getCommentText(); - isPublic = template.getIsPublic(); } } @@ -131,29 +129,6 @@ public void setUser(String user) } - - /** - * Return whether the feedback is private or not - * - * @return boolean - */ - public boolean getIsPublic() - { - return isPublic; - } - - - /** - * Set up the privacy flag. - * - * @param aPrivate boolean - */ - public void setIsPublic(boolean aPrivate) - { - isPublic = aPrivate; - } - - /** * Standard toString method. * @@ -166,7 +141,6 @@ public String toString() "commentType=" + commentType + ", commentText='" + commentText + '\'' + ", user='" + user + '\'' + - ", isPublic=" + isPublic + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + @@ -201,7 +175,6 @@ public boolean equals(Object objectToCompare) } CommentProperties that = (CommentProperties) objectToCompare; return commentType == that.commentType && - isPublic == that.isPublic && Objects.equals(commentText, that.commentText) && Objects.equals(user, that.user); } @@ -215,6 +188,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), commentType, commentText, user, isPublic); + return Objects.hash(super.hashCode(), commentType, commentText, user); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentType.java index d2a707fefb4..cd376c32a85 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CommentType.java @@ -20,11 +20,34 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum CommentType implements Serializable { - STANDARD_COMMENT (0, 0, "Comment", "General comment about the asset."), - QUESTION (1, 1, "Question", "Asks a question to the people owning, managing or using the asset."), + /** + * Comment - General comment about the element. + */ + STANDARD_COMMENT (0, 0, "Comment", "General comment about the element."), + + /** + * Question - Asks a question to the people owning, managing or using the element. + */ + QUESTION (1, 1, "Question", "Asks a question to the people owning, managing or using the element."), + + /** + * Answer - Answers a question (posted as a reply to the question). + */ ANSWER (2, 2, "Answer", "Answers a question (posted as a reply to the question)."), - SUGGESTION (3, 3, "Suggestion", "Provides a suggestion on how to improve the asset or its properties and description."), + + /** + * Suggestion - Provides a suggestion on how to improve the element or its properties and description. + */ + SUGGESTION (3, 3, "Suggestion", "Provides a suggestion on how to improve the element or its properties and description."), + + /** + * Experience - Describes situations where this asset has been used and related hints and tips. + */ USAGE_EXPERIENCE (4, 4, "Experience", "Describes situations where this asset has been used and related hints and tips."), + + /** + * Other - Unknown comment type. + */ OTHER (99, 99, "Other", "Unknown comment type."); private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ComplexSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ComplexSchemaTypeProperties.java index b036b443163..dba0b083eaa 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ComplexSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ComplexSchemaTypeProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +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 ComplexSchemaTypeProperties extends SchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int attributeCount = 0; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectionProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectionProperties.java index f0e64628f15..00e0b1d0e3e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectionProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectionProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -85,7 +86,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectionProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /* * Attributes of a connector diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectorTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectorTypeProperties.java index 10f9e89acba..cb951455ee7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectorTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ConnectorTypeProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.List; import java.util.Objects; @@ -90,7 +91,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ConnectorTypeProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /* * Attributes of a connector type diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ControlFlowProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ControlFlowProperties.java index 0bf6b5fe24b..556683e676f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ControlFlowProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ControlFlowProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ControlFlowProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String qualifiedName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CyberLocation.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CyberLocation.java index e292024c1b1..f6aaad6b43f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CyberLocation.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/CyberLocation.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class CyberLocation implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String address = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataAssetProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataAssetProperties.java index 3c64fe8b006..441dc184c06 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataAssetProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataAssetProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.*; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -27,7 +28,8 @@ }) public class DataAssetProperties extends AssetProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private boolean isReferenceAsset = false; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataContentForDataSetProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataContentForDataSetProperties.java index 6702d94e9d1..9a90a0a72ce 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataContentForDataSetProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataContentForDataSetProperties.java @@ -6,6 +6,7 @@ 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; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataContentForDataSetProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String queryId = null; private String query = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFlowProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFlowProperties.java index 8bac7b42690..059572912e0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFlowProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataFlowProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -18,7 +19,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataFlowProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String qualifiedName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java index 65356154920..3db5a1768f5 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataItemSortOrder.java @@ -19,13 +19,27 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum DataItemSortOrder implements Serializable { - UNKNOWN (0, 99, "", "The sort order is not specified."), - ASCENDING (1, 0, "Ascending", "The attribute instances are organized so that the " + - "smallest/lowest value is first and the rest of the instances follow in " + - "ascending order."), + /** + * Unknown - The sort order is not specified. + */ + UNKNOWN (0, 99, "Unknown", "The sort order is not specified."), + + /** + * Ascending - The attribute instances are organized so that the smallest/lowest values first and the rest of the instances follow in ascending order. + */ + ASCENDING (1, 0, "Ascending", "The attribute instances are organized so that the smallest/lowest value" + + " is first and the rest of the instances follow in ascending order."), + + /** + * Descending - The attribute instances are organized so that the largest/highest value is first and the rest of the instances follow in descending order. + */ DESCENDING (2, 1, "Descending", "The attribute instances are organized so that the " + "largest/highest value is first and the rest of the instances follow in " + "descending order."), + + /** + * Unsorted - The instances of the schema attribute may appear in any order. + */ UNSORTED (3, 99, "Unsorted", "The instances of the schema attribute may appear in any order."); diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataSetProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataSetProperties.java index 92c59c0e26c..6cc3761adf5 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataSetProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataSetProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -18,7 +19,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataSetProperties extends DataAssetProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String formula = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataStoreProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataStoreProperties.java index bdbb560cecd..b8aa7663230 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataStoreProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DataStoreProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.Date; import java.util.Map; import java.util.Objects; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DataStoreProperties extends DataAssetProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String pathName = null; private Date createTime = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DeploymentProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DeploymentProperties.java index b3d18c3947f..1c69d9d790a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DeploymentProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/DeploymentProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -23,6 +24,7 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class DeploymentProperties extends RelationshipProperties { + @Serial private static final long serialVersionUID = 1L; private static final String deploymentTimeProperty = "deploymentTime"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EmbeddedConnectionProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EmbeddedConnectionProperties.java index edc118782bb..03e5555a742 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EmbeddedConnectionProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EmbeddedConnectionProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.rest.AssetManagerIdentifiersRequestBody; +import java.io.Serial; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class EmbeddedConnectionProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /* * Attributes of an embedded connection diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EndpointProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EndpointProperties.java index 9ea59b3bbca..80f8decaf72 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EndpointProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EndpointProperties.java @@ -7,6 +7,7 @@ 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; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class EndpointProperties extends SupplementaryProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String technicalName = null; private String technicalDescription = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EnumSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EnumSchemaTypeProperties.java index 793c3cea439..dec7ea7d107 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EnumSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/EnumSchemaTypeProperties.java @@ -6,6 +6,7 @@ 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; @@ -20,7 +21,8 @@ public class EnumSchemaTypeProperties extends SimpleSchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String validValueSetGUID = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryElementLinkProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryElementLinkProperties.java index a002b617801..b53adece7e0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryElementLinkProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryElementLinkProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class ExternalGlossaryElementLinkProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String elementIdentifier = null; private String elementDescription = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryLinkProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryLinkProperties.java index 6c973942396..f3e2486ef9a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryLinkProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalGlossaryLinkProperties.java @@ -5,6 +5,8 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; + import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; @@ -16,7 +18,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class ExternalGlossaryLinkProperties extends ExternalReferenceProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalIdentifierProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalIdentifierProperties.java index 5d110d0419c..a9b8d5f6b69 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalIdentifierProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalIdentifierProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Map; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class ExternalIdentifierProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private SynchronizationDirection synchronizationDirection = null; private String synchronizationDescription = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceLinkProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceLinkProperties.java index f4766700e78..21f9c5fb26b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceLinkProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceLinkProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ExternalReferenceLinkProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String linkId = null; private String linkDescription = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceProperties.java index c398ae10423..0dcc52c4cca 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalReferenceProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -25,7 +26,8 @@ }) public class ExternalReferenceProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private String url = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalSchemaTypeProperties.java index 6b154caa198..ebfe94e23c9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ExternalSchemaTypeProperties.java @@ -6,6 +6,7 @@ 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; @@ -20,7 +21,8 @@ public class ExternalSchemaTypeProperties extends SimpleSchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String externalSchemaTypeGUID = null; private SchemaTypeProperties externalSchemaType = null; 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 757b4b76519..423d3bbbd1c 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 @@ -19,7 +19,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class FeedbackProperties implements Serializable +public class FeedbackProperties extends RelationshipProperties { @Serial private static final long serialVersionUID = 1L; @@ -81,43 +81,6 @@ public void setIsPublic(boolean aPrivate) @Override public String toString() { - return "FeedbackProperties{" + - ", isPublic=" + isPublic + - '}'; - } - - - /** - * 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 == null || getClass() != objectToCompare.getClass()) - { - return false; - } - FeedbackProperties that = (FeedbackProperties) objectToCompare; - return getIsPublic() == that.getIsPublic(); - } - - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(getIsPublic()); + return "FeedbackProperties{" + '}'; } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FixedLocation.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FixedLocation.java index d1ecd1872ea..16f17561357 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FixedLocation.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/FixedLocation.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class FixedLocation implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String coordinates = null; private String mapProjection = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ForeignKeyProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ForeignKeyProperties.java index 68fa999d386..58ba9b751e3 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ForeignKeyProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ForeignKeyProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class ForeignKeyProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String name = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryCategoryProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryCategoryProperties.java index 57413126653..de401a5fb5b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryCategoryProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryCategoryProperties.java @@ -7,6 +7,8 @@ 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; @@ -18,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GlossaryCategoryProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java index cda5f775abe..895fc02ff2b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermActivityType.java @@ -19,11 +19,34 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum GlossaryTermActivityType implements Serializable { - OPERATION (0, 0, "Operation","Normal processing."), + /** + * Operation - A small, well defined processing operation. + */ + OPERATION (0, 0, "Operation","A small, well defined processing operation."), + + /** + * Action - A requested or required change. + */ ACTION (1, 1, "Action", "A requested or required change."), + + /** + * Task - A piece of work for a person, organization or engine. + */ TASK (2, 2, "Task", "A piece of work for a person, organization or engine."), + + /** + * Process - A sequence of tasks. + */ PROCESS (3, 3, "Process", "A sequence of tasks."), + + /** + * Project - An organized activity to achieve a specific goal. + */ PROJECT (4, 4, "Project", "An organized activity to achieve a specific goal."), + + /** + * Other - An organized activity to achieve a specific goal. + */ OTHER (99, 99, "Other", "Another type of activity."); public static final String ENUM_TYPE_GUID = "af7e403d-9865-4ebb-8c1a-1fd57b4f4bca"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermCategorization.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermCategorization.java index e54baba195f..071669ff037 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermCategorization.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermCategorization.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class GlossaryTermCategorization extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String description = null; private GlossaryTermRelationshipStatus status = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermContextDefinition.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermContextDefinition.java index d4462ea9203..a8ea6ce34fd 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermContextDefinition.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermContextDefinition.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -19,9 +20,10 @@ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class GlossaryTermContextDefinition implements Serializable +public class GlossaryTermContextDefinition extends ClassificationProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String description = null; private String scope = null; @@ -43,6 +45,8 @@ public GlossaryTermContextDefinition() */ public GlossaryTermContextDefinition(GlossaryTermContextDefinition template) { + super (template); + if (template != null) { description = template.getDescription(); @@ -106,6 +110,9 @@ public String toString() return "GlossaryTermContextDefinition{" + "description='" + description + '\'' + ", scope='" + scope + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + '}'; } @@ -127,6 +134,10 @@ public boolean equals(Object objectToCompare) { return false; } + if (!super.equals(objectToCompare)) + { + return false; + } GlossaryTermContextDefinition that = (GlossaryTermContextDefinition) objectToCompare; return Objects.equals(description, that.description) && Objects.equals(scope, that.scope); @@ -141,6 +152,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(description, scope); + return Objects.hash(super.hashCode(), description, scope); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationship.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationship.java index d899d24bd0b..d12948106b9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationship.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationship.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class GlossaryTermRelationship extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String expression = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java index 5b6dd465af4..c1fb77af680 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermRelationshipStatus.java @@ -19,10 +19,29 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum GlossaryTermRelationshipStatus implements Serializable { + /** + * Draft - The term relationship is in development. + */ DRAFT (0, 0, "Draft", "The term relationship is in development."), + + /** + * Active - The term relationship is approved and in use. + */ ACTIVE (1, 1, "Active", "The term relationship is approved and in use."), + + /** + * Deprecated - The term relationship should no longer be used. + */ DEPRECATED (2, 2, "Deprecated", "The term relationship should no longer be used."), + + /** + * Obsolete - The term relationship must no longer be used. + */ OBSOLETE (3, 3, "Obsolete", "The term relationship must no longer be used."), + + /** + * Other - Another term relationship status. + */ OTHER (99, 99, "Other", "Another term relationship status."); public static final String ENUM_TYPE_GUID = "42282652-7d60-435e-ad3e-7cfe5291bcc7"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java index 0d49c05efc0..4f89c844133 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryTermStatus.java @@ -29,13 +29,44 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum GlossaryTermStatus implements Serializable { + /** + * Draft - The term is incomplete. + */ DRAFT (1,1, "Draft", "The term is incomplete."), + + /** + * Prepared - The term is ready for review. + */ PREPARED (2,2, "Prepared", "The term is ready for review."), + + /** + * Proposed - The term is in review. + */ PROPOSED (3,3, "Proposed", "The term is in review."), + + /** + * Approved - The term is approved and ready to be activated. + */ APPROVED (4,4, "Approved", "The term is approved and ready to be activated."), + + /** + * Rejected - The term is rejected and should not be used. + */ REJECTED (5,5, "Rejected", "The term is rejected and should not be used."), + + /** + * Active - The term is approved and in use. + */ ACTIVE (6,15, "Active", "The term is approved and in use."), + + /** + * Deprecated - The term is out of date and should not be used. + */ DEPRECATED(7,30, "Deprecated","The term is out of date and should not be used."), + + /** + * Other - The term is in a locally defined state. + */ OTHER (8,50, "Other", "The term is in a locally defined state."), ; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProcessProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProcessProperties.java index 380a625d7c6..4f59bd56c87 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProcessProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProcessProperties.java @@ -6,6 +6,7 @@ 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; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionProcessProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private String summary = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProperties.java index c0236ec7524..86ab77967e0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.Date; import java.util.List; import java.util.Map; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int domainIdentifier = 0; private String displayName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java index 0b26bd0470a..f0b391982fe 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionStatus.java @@ -19,15 +19,54 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum GovernanceActionStatus implements Serializable { + /** + * Requested - The governance action has been created and is pending. + */ REQUESTED (0, 0, "Requested", "The governance action has been created and is pending"), + + /** + * Approved - The governance action is approved to run. + */ APPROVED (1, 1, "Approved", "The governance action is approved to run"), + + /** + * Waiting - The governance action is waiting for its start time or the right conditions to run. + */ WAITING (2, 2, "Waiting", "The governance action is waiting for its start time or the right conditions to run"), + + /** + * Activating - The governance action service for the governance action is being initialized in the governance engine. + */ ACTIVATING (3, 3, "Activating", "The governance action service for the governance action is being initialized in the governance engine"), + + /** + * In Progress - The governance engine is running the associated governance action service for the governance action. + */ IN_PROGRESS (4, 4, "In Progress","The governance engine is running the associated governance action service for the governance action"), + + /** + * Actioned - The governance action service for the governance action has successfully completed processing. + */ ACTIONED (5, 10, "Actioned", "The governance action service for the governance action has successfully completed processing"), + + /** + * Invalid - The governance action has not been run because it is not appropriate (for example, a false positive). + */ INVALID (6, 11, "Invalid", "The governance action has not been run because it is not appropriate (for example, a false positive)"), + + /** + * Ignored - The governance action has not been run because a different governance action was chosen. + */ IGNORED (7, 12, "Ignored", "The governance action has not been run because a different governance action was chosen"), + + /** + * Failed - The governance action service for the governance action failed to execute. + */ FAILED (8, 13, "Failed", "The governance action service for the governance action failed to execute"), + + /** + * Other - Undefined or unknown governance action status. + */ OTHER (99, 99, "Other", "Undefined or unknown governance action status"); private static final long serialVersionUID = 1L; @@ -39,7 +78,7 @@ public enum GovernanceActionStatus implements Serializable private final String statusDescription; private final int statusCode; - private int openTypeOrdinal; + private final int openTypeOrdinal; /** * Typical Constructor diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionTypeProperties.java index 7981f610ca3..669105b9d29 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceActionTypeProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.List; import java.util.Map; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceActionTypeProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int domainIdentifier = 0; private String displayName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationBase.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationBase.java new file mode 100644 index 00000000000..e01509ac06e --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationBase.java @@ -0,0 +1,295 @@ +/* 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 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; + + +/** + * GovernanceClassificationBase defines the common properties for the governance action classifications. + */ +@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 = GovernanceClassificationProperties.class, name = "GovernanceClassificationProperties"), + @JsonSubTypes.Type(value = RetentionClassificationProperties.class, name = "RetentionClassificationProperties"), + }) +public class GovernanceClassificationBase extends ClassificationProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private int status = 0; + private int confidence = 0; + private String steward = null; + private String stewardTypeName = null; + private String stewardPropertyName = null; + private String source = null; + private String notes = null; + + + /** + * Default constructor + */ + public GovernanceClassificationBase() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template element to copy + */ + public GovernanceClassificationBase(GovernanceClassificationBase template) + { + super(template); + + if (template != null) + { + status = template.getStatus(); + confidence = template.getConfidence(); + steward = template.getSteward(); + source = template.getSource(); + notes = template.getNotes(); + } + } + + + /** + * Return the status of this classification. + * + * @return enum + */ + public int getStatus() + { + return status; + } + + + /** + * Set up the status of the classification. + * + * @param status enum + */ + public void setStatus(int status) + { + this.status = status; + } + + + /** + * Return the level of confidence in the classification (0=none to 100=excellent). + * + * @return int + */ + public int getConfidence() + { + return confidence; + } + + + /** + * Set up the level of confidence in the classification (0=none to 100=excellent). + * + * @param confidence int + */ + public void setConfidence(int confidence) + { + this.confidence = confidence; + } + + + /** + * Return the identifier for the person responsible for maintaining this classification. + * + * @return string user identifier + */ + public String getSteward() + { + return steward; + } + + + /** + * Set up the identifier for the person responsible for maintaining this classification. + * + * @param steward string user identifier + */ + public void setSteward(String steward) + { + this.steward = steward; + } + + + /** + * Return the type name of the element used to describe the steward. + * + * @return name + */ + public String getStewardTypeName() + { + return stewardTypeName; + } + + + /** + * Set up the type name of the element used to describe the steward. + * + * @param stewardTypeName name + */ + public void setStewardTypeName(String stewardTypeName) + { + this.stewardTypeName = stewardTypeName; + } + + + /** + * Return the name of the property used to identify the steward. + * + * @return name + */ + public String getStewardPropertyName() + { + return stewardPropertyName; + } + + + /** + * Set up the name of the property used to identify the steward. + * + * @param stewardPropertyName name + */ + public void setStewardPropertyName(String stewardPropertyName) + { + this.stewardPropertyName = stewardPropertyName; + } + + + /** + * Return the source of this classification. + * + * @return string identifier + */ + public String getSource() + { + return source; + } + + + /** + * Set up the source of this classification. + * + * @param source string identifier + */ + public void setSource(String source) + { + this.source = source; + } + + + /** + * Return additional information relating to this classification. + * + * @return text from the steward(s) + */ + public String getNotes() + { + return notes; + } + + + /** + * Set up additional information relating to this classification. + * + * @param notes text from the steward(s) + */ + public void setNotes(String notes) + { + this.notes = notes; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "GovernanceClassificationBase{" + + "status=" + status + + ", confidence=" + confidence + + ", steward='" + steward + '\'' + + ", stewardTypeName='" + stewardTypeName + '\'' + + ", stewardPropertyName='" + stewardPropertyName + '\'' + + ", source='" + source + '\'' + + ", notes='" + notes + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * 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; + } + GovernanceClassificationBase that = (GovernanceClassificationBase) objectToCompare; + return confidence == that.confidence && + status == that.status && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(stewardPropertyName, that.stewardPropertyName) && + Objects.equals(source, that.source) && + Objects.equals(notes, that.notes); + } + + + /** + * Return code value representing the contents of this object. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), status, confidence, steward, stewardTypeName, stewardPropertyName, source, notes); + } +} \ 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/GovernanceClassificationProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationProperties.java new file mode 100644 index 00000000000..bcb96de8b97 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationProperties.java @@ -0,0 +1,133 @@ +/* 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; + +/** + * GovernanceClassificationProperties defines the properties for a Confidentiality, Confidence, Criticality + * Governance Action Classifications. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class GovernanceClassificationProperties extends GovernanceClassificationBase +{ + @Serial + private static final long serialVersionUID = 1L; + + private int levelIdentifier = 0; + + /** + * Default constructor + */ + public GovernanceClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public GovernanceClassificationProperties(GovernanceClassificationProperties template) + { + super(template); + + if (template != null) + { + levelIdentifier = template.getLevelIdentifier(); + } + } + + + /** + * Return the level assigned to this element for this classification. + * + * @return int + */ + public int getLevelIdentifier() + { + return levelIdentifier; + } + + + /** + * Set up the level assigned to this element for this classification. + * + * @param levelIdentifier int + */ + public void setLevelIdentifier(int levelIdentifier) + { + this.levelIdentifier = levelIdentifier; + } + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "GovernanceClassificationProperties{" + + "levelIdentifier=" + levelIdentifier + + ", status=" + getStatus() + + ", confidence=" + getConfidence() + + ", steward='" + getSteward() + '\'' + + ", stewardTypeName='" + getStewardTypeName() + '\'' + + ", stewardPropertyName='" + getStewardPropertyName() + '\'' + + ", source='" + getSource() + '\'' + + ", notes='" + getNotes() + '\'' + + '}'; + } + + + /** + * 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; + } + GovernanceClassificationProperties that = (GovernanceClassificationProperties) objectToCompare; + return levelIdentifier == that.levelIdentifier; + } + + + /** + * Return code value representing the contents of this object. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), levelIdentifier); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationStatus.java new file mode 100644 index 00000000000..fb4f7e07868 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceClassificationStatus.java @@ -0,0 +1,172 @@ +/* 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.Serializable; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * GovernanceClassificationStatus identifies the status of one of the governance action classification. + * It provides some provenance on the process that assigned the value. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum GovernanceClassificationStatus implements Serializable +{ + /** + * Discovered - The classification assignment was discovered by an automated process. + */ + DISCOVERED (0, 0,"Discovered", + "The classification assignment was discovered by an automated process."), + + /** + * Proposed - The classification assignment was proposed by a subject matter expert. + */ + PROPOSED (1, 1,"Proposed", + "The classification assignment was proposed by a subject matter expert."), + + /** + * Imported - The classification assignment was imported from another metadata system. + */ + IMPORTED (2, 2,"Imported", + "The classification assignment was imported from another metadata system."), + + /** + * Validated - The classification assignment has been validated and approved by a subject matter expert. + */ + VALIDATED (3, 3,"Validated", + "The classification assignment has been validated and approved by a subject matter expert."), + + /** + * Deprecated - The classification assignment should no longer be used. + */ + DEPRECATED (4, 4,"Deprecated", + "The classification assignment should no longer be used."), + + /** + * Obsolete - The classification assignment must no longer be used. + */ + OBSOLETE (5, 5,"Obsolete", + "The classification assignment must no longer be used."), + + /** + * Other - Another classification assignment status. + */ + OTHER (99, 99, "Other", + "Another classification assignment status."); + + public static final String ENUM_TYPE_GUID = "cc540586-ac7c-41ba-8cc1-4da694a6a8e4"; + public static final String ENUM_TYPE_NAME = "GovernanceClassificationStatus"; + + private final int openTypeOrdinal; + + private final int ordinal; + private final String name; + private final String description; + + private static final long serialVersionUID = 1L; + + + /** + * Constructor to set up the instance of this enum. + * + * @param ordinal code number + * @param openTypeOrdinal code number from the equivalent Enum Type + * @param name default name + * @param description default description + */ + GovernanceClassificationStatus(int ordinal, + int openTypeOrdinal, + String name, + String description) + { + this.ordinal = ordinal; + this.openTypeOrdinal = openTypeOrdinal; + this.name = name; + this.description = description; + } + + + + /** + * Return the code for this enum used for indexing based on the enum value. + * + * @return int code number + */ + public int getOrdinal() + { + return ordinal; + } + + + /** + * Return the default name for this enum type. + * + * @return String name + */ + public String getName() + { + return name; + } + + + /** + * Return the default description for this enum. + * + * @return String description + */ + public String getDescription() + { + return description; + } + + + /** + * Return the code for this enum that comes from the Open Metadata Type that this enum represents. + * + * @return int code number + */ + public int getOpenTypeOrdinal() + { + return openTypeOrdinal; + } + + + /** + * Return the unique identifier for the open metadata enum type that this enum class represents. + * + * @return string guid + */ + public String getOpenTypeGUID() { return ENUM_TYPE_GUID; } + + + /** + * Return the unique name for the open metadata enum type that this enum class represents. + * + * @return string name + */ + public String getOpenTypeName() { return ENUM_TYPE_NAME; } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "GovernanceClassificationStatus{" + + "ordinal=" + ordinal + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + '}'; + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionProperties.java index fab2cc8f52f..88f7acc8988 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.io.Serializable; import java.util.HashMap; import java.util.List; @@ -38,7 +39,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceDefinitionProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String documentIdentifier = null; private Map additionalProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java index a68473cb226..41892f69ed4 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GovernanceDefinitionStatus.java @@ -28,10 +28,29 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum GovernanceDefinitionStatus implements Serializable { + /** + * Draft - The governance definition is still in development. + */ DRAFT (0, "Draft", "The governance definition is still in development."), + + /** + * Proposed - The governance definition is in review and not yet active. + */ PROPOSED (1, "Proposed", "The governance definition is in review and not yet active."), + + /** + * Active - The governance definition is approved and in use. + */ ACTIVE (2, "Active", "The governance definition is approved and in use."), + + /** + * Deprecated - The governance definition has been superseded. + */ DEPRECATED (3, "Deprecated", "The governance definition has been superseded."), + + /** + * Other - The governance definition in a locally defined state. + */ OTHER (99, "Other", "The governance definition in a locally defined state."); private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java index c25a01baf58..e7179bc817e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/KeyPattern.java @@ -20,14 +20,45 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum KeyPattern implements Serializable { + /** + * Local Key - Unique key allocated and used within the scope of a single system. + */ LOCAL_KEY (0, 0, "Local Key", "Unique key allocated and used within the scope of a single system."), + + /** + * Recycled Key - Key allocated and used within the scope of a single system that is periodically reused for different records. + */ RECYCLED_KEY (1, 1, "Recycled Key", "Key allocated and used within the scope of a single system that " + "is periodically reused for different records."), + + /** + * Natural Key - Key derived from an attribute of the entity, such as email address, passport number. + */ NATURAL_KEY (2, 2, "Natural Key", "Key derived from an attribute of the entity, such as email address, passport number."), + + /** + * Mirror Key - Key value copied from another system. + */ MIRROR_KEY (3, 3, "Mirror Key", "Key value copied from another system."), + + /** + * Aggregate Key - Key formed by combining keys from multiple systems. + */ AGGREGATE_KEY (4, 4, "Aggregate Key", "Key formed by combining keys from multiple systems."), + + /** + * Caller's Key - Key from another system can bey used if system name provided. + */ CALLERS_KEY (5, 5, "Caller's Key", "Key from another system can bey used if system name provided."), + + /** + * Stable Key - Key value will remain active even if records are merged. + */ STABLE_KEY (6, 6, "Stable Key", "Key value will remain active even if records are merged."), + + /** + * Other - Another key pattern. + */ OTHER (99, 99, "Other", "Another key pattern."); public static final String ENUM_TYPE_GUID = "8904df8f-1aca-4de8-9abd-1ef2aadba300"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LikeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LikeProperties.java index fe6fdc25a0e..c866cc0932e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LikeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LikeProperties.java @@ -25,8 +25,7 @@ public class LikeProperties implements Serializable @Serial private static final long serialVersionUID = 1L; - protected String user = null; - protected boolean isPublic = false; + private String user = null; /** @@ -48,7 +47,6 @@ public LikeProperties(LikeProperties template) if (template != null) { user = template.getUser(); - isPublic = template.isPublic; } } @@ -73,29 +71,6 @@ public void setUser(String user) this.user = user; } - - /** - * Return if this like is private to the creating user. - * - * @return boolean - */ - public boolean getIsPublic() - { - return isPublic; - } - - - /** - * Set up whether the like is private to the creating user or not. - * - * @param aPublic boolean - */ - public void setIsPublic(boolean aPublic) - { - isPublic = aPublic; - } - - /** * Standard toString method. * @@ -106,7 +81,6 @@ public String toString() { return "LikeProperties{" + "user='" + user + '\'' + - ", isPublic=" + isPublic + '}'; } @@ -129,8 +103,7 @@ public boolean equals(Object objectToCompare) return false; } LikeProperties like = (LikeProperties) objectToCompare; - return isPublic == like.isPublic && - Objects.equals(getUser(), like.getUser()); + return Objects.equals(getUser(), like.getUser()); } @@ -142,6 +115,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(getUser(), isPublic); + return Objects.hash(user); } } \ 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/LineageMappingProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LineageMappingProperties.java index 50a421e0975..ae4aaeccafe 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LineageMappingProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LineageMappingProperties.java @@ -6,6 +6,7 @@ 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; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class LineageMappingProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String qualifiedName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LiteralSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LiteralSchemaTypeProperties.java index 8e97f594d3b..121d2fd1818 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LiteralSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LiteralSchemaTypeProperties.java @@ -6,6 +6,7 @@ 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; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class LiteralSchemaTypeProperties extends SchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String dataType = null; private String fixedValue = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LocationProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LocationProperties.java index 43ff2843cee..acd3a6dcc41 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LocationProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/LocationProperties.java @@ -7,6 +7,7 @@ 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; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class LocationProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MapSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MapSchemaTypeProperties.java index 036729d70fb..b56eff6dab6 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MapSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MapSchemaTypeProperties.java @@ -6,6 +6,7 @@ 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; @@ -21,7 +22,8 @@ public class MapSchemaTypeProperties extends SchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private SchemaTypeProperties mapFromElement = null; private SchemaTypeProperties mapToElement = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MetadataCorrelationProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MetadataCorrelationProperties.java index 6980bf2bf7b..f69792f10fa 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MetadataCorrelationProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/MetadataCorrelationProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.io.Serializable; import java.util.Map; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MetadataCorrelationProperties extends ExternalIdentifierProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String assetManagerGUID = null; private String assetManagerName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OperationalStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OperationalStatus.java index 13564ad9c51..40cc308f626 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OperationalStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OperationalStatus.java @@ -19,7 +19,14 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum OperationalStatus implements Serializable { + /** + * Disabled - The component is deployed but not operational. + */ DISABLED (0, 0, "Disabled", "The component is deployed but not operational."), + + /** + * Enabled - The component is operational. + */ ENABLED (1, 1, "Enabled", "The component is operational."); public static final String ENUM_TYPE_GUID = "24e1e33e-9250-4a6c-8b07-05c7adec3a1d"; 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 new file mode 100644 index 00000000000..7ee73c64eb2 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/OwnerProperties.java @@ -0,0 +1,168 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.properties; + +import java.io.Serial; +import java.util.Objects; + +/** + * OwnerProperties describes the properties that identifies the owner of an attached element (or the resource it represents). + */ +public class OwnerProperties extends ClassificationProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + + private String owner = null; + private String ownerTypeName = null; + private String ownerPropertyName = null; + + + + /** + * Default constructor + */ + public OwnerProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public OwnerProperties(OwnerProperties template) + { + super(template); + if (template != null) + { + owner = template.getOwner(); + ownerTypeName = template.getOwnerTypeName(); + ownerPropertyName = template.getOwnerPropertyName(); + } + } + + + /** + * Returns the name of the owner for this asset. + * + * @return owner String + */ + public String getOwner() { + return owner; + } + + + /** + * Set up the name of the owner for this asset. + * + * @param owner String name + */ + public void setOwner(String owner) + { + this.owner = owner; + } + + + /** + * Return the type name of the element representing the owner. + * + * @return name + */ + public String getOwnerTypeName() + { + return ownerTypeName; + } + + + /** + * Set up the type name of the element representing the owner. + * + * @param ownerTypeName name + */ + public void setOwnerTypeName(String ownerTypeName) + { + this.ownerTypeName = ownerTypeName; + } + + + /** + * Return the property name of the identifier that is representing the owner. + * + * @return name + */ + public String getOwnerPropertyName() + { + return ownerPropertyName; + } + + + /** + * Set up the property name of the identifier that is representing the owner. + * + * @param ownerPropertyName name + */ + public void setOwnerPropertyName(String ownerPropertyName) + { + this.ownerPropertyName = ownerPropertyName; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "OwnerProperties{" + + "owner='" + owner + '\'' + + ", ownerTypeName='" + ownerTypeName + '\'' + + ", ownerPropertyName='" + ownerPropertyName + '\'' + + '}'; + } + + + /** + * 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 instanceof OwnerProperties that)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + return Objects.equals(owner, that.owner) && + Objects.equals(ownerTypeName, that.ownerTypeName) && + Objects.equals(ownerPropertyName, that.ownerPropertyName); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), owner, ownerTypeName, ownerPropertyName); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortProperties.java index f775b4f8be3..d48f016ab91 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortProperties.java @@ -7,6 +7,7 @@ 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; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class PortProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private PortType portType = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java index 3192525ecce..f23d2a6bea5 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PortType.java @@ -26,10 +26,29 @@ @JsonIgnoreProperties(ignoreUnknown = true) public enum PortType implements Serializable { + /** + * Input Port - Data is passed into the process. + */ INPUT_PORT (0, 0, "Input Port", "Data is passed into the process."), + + /** + * Output Port - Data is produced by the process. + */ OUTPUT_PORT (1, 1, "Output Port", "Data is produced by the process."), + + /** + * Input-Output Port - A request-response interface is provided by the process. + */ INOUT_PORT (2, 2, "Input-Output Port", "A request response interface is provided by the process."), + + /** + * Output-Input Port - A request-response call is made by the process. + */ OUTIN_PORT (3, 3, "Output-Input Port", "A request response call is made by the process."), + + /** + * Other - None of the above. + */ OTHER (99, 99, "Other", "None of the above."); private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimaryKeyProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimaryKeyProperties.java index b6b1fe1a957..5b6f5c95400 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimaryKeyProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimaryKeyProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class PrimaryKeyProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String name = null; private KeyPattern keyPattern = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimitiveSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimitiveSchemaTypeProperties.java index 641e7f98532..ee2ab77751e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimitiveSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/PrimitiveSchemaTypeProperties.java @@ -5,6 +5,8 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; + import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; @@ -16,7 +18,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class PrimitiveSchemaTypeProperties extends SimpleSchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /** * Default constructor diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessCallProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessCallProperties.java index 368bc30da73..d581635951a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessCallProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessCallProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessCallProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String qualifiedName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentProperties.java index 417d529c37e..b44c212759d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentProperties.java @@ -6,6 +6,7 @@ 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; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessContainmentProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ProcessContainmentType processContainmentType = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java index 8490f79e445..bee50623014 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessContainmentType.java @@ -26,8 +26,19 @@ @JsonIgnoreProperties(ignoreUnknown = true) public enum ProcessContainmentType implements Serializable { + /** + * Owned - The parent process owns the child process in the relationship, such that if the parent is removed the child should also be removed. A child can have at most one such parent. + */ OWNED (0, 0, "Owned", "The parent process owns the child process in the relationship, such that if the parent is removed the child should also be removed. A child can have at most one such parent."), + + /** + * Used - The child process is simply used by the parent. A child process can have many such relationships to parents. + */ USED (1, 1, "Used", "The child process is simply used by the parent. A child process can have many such relationships to parents."), + + /** + * Other - None of the above. + */ OTHER (99, 99, "Other", "None of the above."); private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessProperties.java index e65bcbe193d..b3a82b0e0df 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ProcessProperties extends AssetProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String formula = null; private String formulaType = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java index 3cef8201e29..4d10df7ca85 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ProcessStatus.java @@ -28,10 +28,29 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum ProcessStatus implements Serializable { - UNKNOWN (0,0, "","Unknown process status."), + /** + * Unknown- Unknown process status. + */ + UNKNOWN (0,0, "Unknown", "Unknown process status."), + + /** + * Draft - The process is incomplete. + */ DRAFT (1,1, "Draft", "The process is incomplete."), + + /** + * Proposed - The process is in review. + */ PROPOSED (2,3, "Proposed", "The process is in review."), + + /** + * Approved - The process is approved. + */ APPROVED (3,4, "Approved", "The process is approved."), + + /** + * Active - The process is approved and in use. + */ ACTIVE (4,15, "Active", "The process is approved and in use."); @@ -40,7 +59,7 @@ public enum ProcessStatus implements Serializable private final String name; private final String description; - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/QueryTargetProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/QueryTargetProperties.java index 0e60ef7b442..47673fb77be 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/QueryTargetProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/QueryTargetProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class QueryTargetProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String queryId = null; private String query = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RatingProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RatingProperties.java index 917946f660f..7dacb2dad23 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RatingProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RatingProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import java.io.Serial; +import java.io.Serializable; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -25,7 +26,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class RatingProperties extends FeedbackProperties +public class RatingProperties implements Serializable { @Serial private static final long serialVersionUID = 1L; @@ -50,8 +51,6 @@ public RatingProperties() */ public RatingProperties(RatingProperties template) { - super(template); - if (template != null) { user = template.getUser(); @@ -137,7 +136,6 @@ public String toString() "starRating=" + starRating + ", review='" + review + '\'' + ", user='" + user + '\'' + - ", isPublic='" + getIsPublic() + '\'' + '}'; } @@ -159,10 +157,6 @@ public boolean equals(Object objectToCompare) { return false; } - if (!super.equals(objectToCompare)) - { - return false; - } RatingProperties rating = (RatingProperties) objectToCompare; return getStarRating() == rating.getStarRating() && Objects.equals(getReview(), rating.getReview()) && @@ -178,10 +172,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (starRating != null ? starRating.hashCode() : 0); - result = 31 * result + (review != null ? review.hashCode() : 0); - result = 31 * result + (user != null ? user.hashCode() : 0); - return result; + return Objects.hash(starRating, review, user); } } \ 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/ReferenceableProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ReferenceableProperties.java index b13637b11a3..4abe4c6c9c0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ReferenceableProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ReferenceableProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.io.Serializable; import java.util.*; @@ -22,19 +23,23 @@ property = "class") @JsonSubTypes( { + @JsonSubTypes.Type(value = CommentProperties.class, name = "CommentProperties"), @JsonSubTypes.Type(value = GlossaryProperties.class, name = "GlossaryProperties"), @JsonSubTypes.Type(value = GlossaryCategoryProperties.class, name = "GlossaryCategoryProperties"), @JsonSubTypes.Type(value = GlossaryTermProperties.class, name = "GlossaryTermProperties"), @JsonSubTypes.Type(value = GovernanceActionProperties.class, name = "GovernanceActionProperties"), @JsonSubTypes.Type(value = GovernanceActionTypeProperties.class, name = "GovernanceActionTypeProperties"), @JsonSubTypes.Type(value = GovernanceActionProcessProperties.class, name = "GovernanceActionProcessProperties"), + @JsonSubTypes.Type(value = NoteLogProperties.class, name = "NoteLogProperties"), + @JsonSubTypes.Type(value = NoteProperties.class, name = "NoteProperties"), @JsonSubTypes.Type(value = PortProperties.class, name = "PortProperties"), @JsonSubTypes.Type(value = SupplementaryProperties.class, name = "SupplementaryProperties"), @JsonSubTypes.Type(value = ValidValueProperties.class, name = "ValidValueProperties"), }) public class ReferenceableProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String qualifiedName = null; private Map additionalProperties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RelationshipProperties.java index b0205a2a9ed..4dc9a143b41 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RelationshipProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RelationshipProperties.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.io.Serial; import java.io.Serializable; import java.util.Date; import java.util.HashMap; @@ -40,11 +41,13 @@ @JsonSubTypes.Type(value = ProcessCallProperties.class, name = "ProcessCallProperties"), @JsonSubTypes.Type(value = LineageMappingProperties.class, name = "LineageMappingProperties"), @JsonSubTypes.Type(value = GlossaryTermCategorization.class, name = "GlossaryTermCategorization"), + @JsonSubTypes.Type(value = GlossaryTermRelationship.class, name = "GlossaryTermRelationship"), @JsonSubTypes.Type(value = ForeignKeyProperties.class, name = "ForeignKeyProperties"), }) public class RelationshipProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private Date effectiveFrom = null; private Date effectiveTo = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RetentionClassificationProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RetentionClassificationProperties.java new file mode 100644 index 00000000000..39879c65587 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/RetentionClassificationProperties.java @@ -0,0 +1,215 @@ +/* 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.Date; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RetentionClassificationProperties defines the retention requirements for related data items. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RetentionClassificationProperties extends GovernanceClassificationBase +{ + @Serial + private static final long serialVersionUID = 1L; + + private int retentionBasis = 0; + private String associatedGUID = null; + private Date archiveAfter = null; + private Date deleteAfter = null; + + + /** + * Default constructor + */ + public RetentionClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public RetentionClassificationProperties(RetentionClassificationProperties template) + { + super(template); + + if (template != null) + { + retentionBasis = template.getRetentionBasis(); + associatedGUID = template.getAssociatedGUID(); + archiveAfter = template.getArchiveAfter(); + deleteAfter = template.getDeleteAfter(); + } + } + + + /** + * Return a description of the factor used to set the archiveAfter and deleteAfter dates. + * + * @return int + */ + public int getRetentionBasis() + { + return retentionBasis; + } + + + /** + * Set up a description of the factor used to set the archiveAfter and deleteAfter dates. + * + * @param retentionBasis int + */ + public void setRetentionBasis(int retentionBasis) + { + this.retentionBasis = retentionBasis; + } + + + /** + * Return the unique identifier of the element used in deciding the archiveAfter and deleteAfter dates. + * For example if the retention basis is determined by the project lifetime, this identifier is the + * identifier of the associated project. + * + * @return string guid + */ + public String getAssociatedGUID() + { + return associatedGUID; + } + + + /** + * Set up the unique identifier of the element used in deciding the archiveAfter and deleteAfter dates. + * For example if the retention basis is determined by the project lifetime, this identifier is the + * identifier of the associated project. + * + * @param associatedGUID string guid + */ + public void setAssociatedGUID(String associatedGUID) + { + this.associatedGUID = associatedGUID; + } + + + /** + * Return the date that this asset will be archived. + * + * @return date/timestamp + */ + public Date getArchiveAfter() + { + return archiveAfter; + } + + + /** + * Set up the date that this asset will be archived. + * + * @param archiveAfter date/timestamp + */ + public void setArchiveAfter(Date archiveAfter) + { + this.archiveAfter = archiveAfter; + } + + + /** + * Return the date that this asset will be permanently deleted. + * + * @return date/timestamp + */ + public Date getDeleteAfter() + { + return deleteAfter; + } + + + /** + * Set up the date that this asset will be permanently deleted. + * + * @param deleteAfter date/timestamp + */ + public void setDeleteAfter(Date deleteAfter) + { + this.deleteAfter = deleteAfter; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RetentionClassificationProperties{" + + "retentionBasis=" + retentionBasis + + ", associatedGUID='" + associatedGUID + '\'' + + ", archiveAfter=" + archiveAfter + + ", deleteAfter=" + deleteAfter + + ", status=" + getStatus() + + ", confidence=" + getConfidence() + + ", steward='" + getSteward() + '\'' + + ", source='" + getSource() + '\'' + + ", notes='" + getNotes() + + '}'; + } + + + /** + * 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; + } + RetentionClassificationProperties that = (RetentionClassificationProperties) objectToCompare; + return retentionBasis == that.retentionBasis && + Objects.equals(associatedGUID, that.associatedGUID) && + Objects.equals(archiveAfter, that.archiveAfter) && + Objects.equals(deleteAfter, that.deleteAfter); + } + + + /** + * Return code value representing the contents of this object. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), retentionBasis, associatedGUID, archiveAfter, deleteAfter); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaAttributeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaAttributeProperties.java index ec2c9c4f80b..f755a5ba51e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaAttributeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaAttributeProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class SchemaAttributeProperties extends SchemaProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int elementPosition = 0; private int minCardinality = 0; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaProperties.java index 037d43bc615..ae618dac747 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -26,7 +27,8 @@ }) public class SchemaProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private boolean isDeprecated = false; private String displayName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeChoiceProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeChoiceProperties.java index 7b902023e29..0f3aae6220c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeChoiceProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeChoiceProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.util.List; import java.util.Objects; @@ -20,7 +21,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class SchemaTypeChoiceProperties extends SchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private List schemaOptions = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeProperties.java index 73b587a95e8..3259daf057b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SchemaTypeProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -30,7 +31,8 @@ }) public class SchemaTypeProperties extends SchemaProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String versionNumber = null; private String author = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecureLocation.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecureLocation.java index d3c354eecd4..b55f746579d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecureLocation.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecureLocation.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class SecureLocation implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String description = null; private String level = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecurityTagsProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecurityTagsProperties.java index f4180ffd9d9..023676375b8 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecurityTagsProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SecurityTagsProperties.java @@ -25,7 +25,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class SecurityTagsProperties implements Serializable +public class SecurityTagsProperties extends ClassificationProperties { @Serial private static final long serialVersionUID = 1L; @@ -40,6 +40,7 @@ public class SecurityTagsProperties implements Serializable */ public SecurityTagsProperties() { + super(); } @@ -50,6 +51,8 @@ public SecurityTagsProperties() */ public SecurityTagsProperties(SecurityTagsProperties template) { + super(template); + if (template != null) { this.securityLabels = template.getSecurityLabels(); @@ -144,7 +147,7 @@ public Map> getAccessGroups() /** - * Setup the map from operation to list of security groups. + * Set up the map from operation to list of security groups. * * @param accessGroups map */ @@ -166,6 +169,9 @@ public String toString() "securityLabels=" + securityLabels + ", securityProperties=" + securityProperties + ", accessGroups=" + accessGroups + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + '}'; } @@ -187,6 +193,10 @@ public boolean equals(Object objectToCompare) { return false; } + if (! super.equals(objectToCompare)) + { + return false; + } return Objects.equals(securityLabels, that.securityLabels) && Objects.equals(securityProperties, that.securityProperties) && Objects.equals(accessGroups, that.accessGroups); @@ -201,6 +211,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(securityLabels, securityProperties, accessGroups); + return Objects.hash(super.hashCode(), securityLabels, securityProperties, accessGroups); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SemanticAssignmentProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SemanticAssignmentProperties.java new file mode 100644 index 00000000000..0b1c7d691f6 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SemanticAssignmentProperties.java @@ -0,0 +1,285 @@ +/* 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; + +/** + * GlossaryTermRelationship describes a type of relationship between two glossary terms in a glossary. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class SemanticAssignmentProperties extends RelationshipProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private String expression = null; + private String description = null; + private TermAssignmentStatus status = null; + private int confidence = 0; + private String createdBy = null; + private String steward = null; + private String source = null; + + + /** + * Default constructor + */ + public SemanticAssignmentProperties() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template template object to copy. + */ + public SemanticAssignmentProperties(SemanticAssignmentProperties template) + { + super(template); + + if (template != null) + { + expression = template.getExpression(); + description = template.getDescription(); + status = template.getStatus(); + steward = template.getSteward(); + source = template.getSource(); + } + } + + + /** + * Set up the expression that describes the relationship. + * + * @param expression String name + */ + public void setExpression(String expression) + { + this.expression = expression; + } + + + /** + * Returns the expression that describes the relationship. + * + * @return String name + */ + public String getExpression() + { + return expression; + } + + + /** + * Set up description of the relationship. + * + * @param description String + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the description for the relationship. + * + * @return String description + */ + public String getDescription() + { + return description; + } + + + /** + * Set up whether this relationship should be used. + * + * @param status status enum + */ + public void setStatus(TermAssignmentStatus status) + { + this.status = status; + } + + + /** + * Returns whether this relationship should be used. + * + * @return status enum + */ + public TermAssignmentStatus getStatus() + { + return status; + } + + + /** + * Return the level of confidence that the relationship is correct. 0 means unassigned. Typical assigned values are usually between 1-100 + * as a percentage scale. + * + * @return int + */ + public int getConfidence() + { + return confidence; + } + + + /** + * Set up the level of confidence that the relationship is correct. 0 means unassigned. Typical assigned values are usually between 1-100 + * as a percentage scale. + * + * @param confidence int + */ + public void setConfidence(int confidence) + { + this.confidence = confidence; + } + + + /** + * Return the name/description of the creator of the relationship. The relationship includes the userId of the creator, so this field is for + * a more business friendly name. + * + * @return string name + */ + public String getCreatedBy() + { + return createdBy; + } + + + /** + * Set up the name/description of the creator of the relationship. The relationship includes the userId of the creator, so this field is for + * a more business friendly name. + * + * @param createdBy string name + */ + public void setCreatedBy(String createdBy) + { + this.createdBy = createdBy; + } + + + /** + * Set up the id of the steward who assigned the relationship (or approved the discovered value). + * + * @param steward user id or name of steward + */ + public void setSteward(String steward) + { + this.steward = steward; + } + + + /** + * Returns the id of the steward who assigned the relationship (or approved the discovered value). + * + * @return user id or name of steward + */ + public String getSteward() + { + return steward; + } + + + /** + * Set up the id of the source of the knowledge of the relationship. + * + * @param source String id + */ + public void setSource(String source) + { + this.source = source; + } + + + /** + * Returns the id of the source of the knowledge of the relationship. + * + * @return String id + */ + public String getSource() + { + return source; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "GlossaryTermRelationship{" + + "expression='" + expression + '\'' + + ", description='" + description + '\'' + + ", status=" + status + + ", steward='" + steward + '\'' + + ", source='" + source + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + '}'; + } + + + /** + * 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 instanceof SemanticAssignmentProperties that)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + return confidence == that.confidence && + Objects.equals(expression, that.expression) && + Objects.equals(description, that.description) && + status == that.status && + Objects.equals(createdBy, that.createdBy) && + Objects.equals(steward, that.steward) && + Objects.equals(source, that.source); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), expression, description, status, confidence, createdBy, steward, source); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseProperties.java index 75e6098d081..efa5a5dc695 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseProperties.java @@ -6,6 +6,7 @@ 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; @@ -20,6 +21,7 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ServerAssetUseProperties extends RelationshipProperties { + @Serial private static final long serialVersionUID = 1L; private ServerAssetUseType useType = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java index c5af386bdea..cc7b0dd5cc1 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ServerAssetUseType.java @@ -26,10 +26,29 @@ @JsonIgnoreProperties(ignoreUnknown = true) public enum ServerAssetUseType implements Serializable { - OWNS (0, 0, "Owns", "The asset is managed and updated via this relationship"), + /** + * Owns - The asset is managed and updated via this relationship. + */ + OWNS (0, 0, "Owns", "The asset is managed and updated via this relationship."), + + /** + * Governs - The asset is governed through this relationship. + */ GOVERNS (1, 1, "Governs", "The asset is governed through this relationship."), + + /** + * Maintains - The asset is maintained through this relationship. + */ MAINTAINS (2, 2, "Maintains","The asset is maintained through this relationship."), + + /** + * Uses - The asset is used through this relationship. + */ USES (3, 3, "Uses", "The asset is used through this relationship."), + + /** + * Other - None of the above. + */ OTHER (99, 99, "Other", "None of the above."); private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SimpleSchemaTypeProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SimpleSchemaTypeProperties.java index 3a44879821b..31325584037 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SimpleSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SimpleSchemaTypeProperties.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.*; import org.odpi.openmetadata.frameworks.connectors.properties.beans.SimpleSchemaType; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -28,7 +29,8 @@ }) public class SimpleSchemaTypeProperties extends SchemaTypeProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String dataType = null; private String defaultValue = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SoftwareCapabilitiesProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SoftwareCapabilitiesProperties.java index 13fc7dd8fa8..3c600e630a0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SoftwareCapabilitiesProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SoftwareCapabilitiesProperties.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -26,6 +27,7 @@ }) public class SoftwareCapabilitiesProperties extends SupplementaryProperties { + @Serial private static final long serialVersionUID = 1L; private String technicalName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/StarRating.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/StarRating.java index 9a3983d10b1..8aca20d27e2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/StarRating.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/StarRating.java @@ -20,11 +20,34 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum StarRating implements Serializable { + /** + * No recommendation. + */ NO_RECOMMENDATION (0, 0, "X", "No recommendation"), + + /** + * Poor + */ ONE_STAR (1, 1, "*", "Poor"), + + /** + * Usable + */ TWO_STARS (2, 2, "**", "Usable"), + + /** + * Good + */ THREE_STARS (3, 3, "***", "Good"), + + /** + * Very good + */ FOUR_STARS (4, 4, "****", "Very Good"), + + /** + * Excellent + */ FIVE_STARS (5, 5, "*****", "Excellent"); public static final String ENUM_TYPE_GUID = "77fea3ef-6ec1-4223-8408-38567e9d3c93"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SubjectAreaMemberProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SubjectAreaMemberProperties.java new file mode 100644 index 00000000000..161023c21b2 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SubjectAreaMemberProperties.java @@ -0,0 +1,121 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.properties; + +import java.io.Serial; +import java.util.Objects; + +/** + * A subject area defines a group of definitions for governing assets related to a specific topic. The subject area definition defines + * how the assets related to the topic should be managed. This classification associates an element as one of the materials used to + * implement the subject area. + */ +public class SubjectAreaMemberProperties extends ClassificationProperties +{ + @Serial + private static final long serialVersionUID = 1L; + + private String subjectAreaName = null; + + + /** + * Default constructor + */ + public SubjectAreaMemberProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SubjectAreaMemberProperties(SubjectAreaMemberProperties template) + { + super(template); + + if (template != null) + { + this.subjectAreaName = template.getSubjectAreaName(); + } + } + + + /** + * Return the name of the subject area - this is added to the SubjectArea classification. + * + * @return string name + */ + public String getSubjectAreaName() + { + return subjectAreaName; + } + + + /** + * Set up the name of the subject area - this is added to the SubjectArea classification. + * + * @param subjectAreaName string name + */ + public void setSubjectAreaName(String subjectAreaName) + { + this.subjectAreaName = subjectAreaName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SubjectAreaMemberProperties{" + + "effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + + ", subjectAreaName='" + subjectAreaName + '\'' + + '}'; + } + + + /** + * 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 instanceof SubjectAreaMemberProperties)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + SubjectAreaMemberProperties that = (SubjectAreaMemberProperties) objectToCompare; + return Objects.equals(subjectAreaName, that.subjectAreaName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), getSubjectAreaName()); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SupplementaryProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SupplementaryProperties.java index 89976c0a879..048f32b287a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SupplementaryProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SupplementaryProperties.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.util.*; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -28,7 +29,8 @@ }) public class SupplementaryProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private String summary = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java index 37036dc1d97..0766a21fed1 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/SynchronizationDirection.java @@ -21,18 +21,39 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum SynchronizationDirection implements Serializable { + /** + * Both Directions - Metadata exchange is permitted in both directions. Synchronization is halted on a specific + * element if potentially clashing updates have occurred both in the third party technology and + * open metadata. Such conflicts are logged on the audit log and resolved through manual stewardship. + */ BOTH_DIRECTIONS (0, 0,"Both Directions", "Metadata exchange is permitted in both directions. Synchronization is halted on a specific " + "element if potentially clashing updates have occurred both in the third party technology and " + "open metadata. Such conflicts are logged on the audit log and resolved through manual stewardship."), + + /** + * To Third Party - The third party technology is logically downstream of open metadata. This means the open metadata + * ecosystem is the originator and owner of the metadata being synchronized. Any updates detected + * in the third technology are overridden by the latest open metadata values. + */ TO_THIRD_PARTY (1, 1,"To Third Party", "The third party technology is logically downstream of open metadata. This means the open metadata " + "ecosystem is the originator and owner of the metadata being synchronized. Any updates detected " + "in the third technology are overridden by the latest open metadata values."), + + /** + * From Third Party - The third party technology is logically upstream (the originator and owner of the metadata). + * Any updates made in open metadata are not passed to the third party technology and the + * third party technology is requested to refresh the open metadata version. + */ FROM_THIRD_PARTY (2, 2,"From Third Party", "The third party technology is logically upstream (the originator and owner of the metadata). " + "Any updates made in open metadata are not passed to the third party technology and the " + "third party technology is requested to refresh the open metadata version."), + + /** + * Other - Another type of synchronization rule - see description property. + */ OTHER (99, 99,"Other", "Another type of synchronization rule - see description property."), ; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TaxonomyClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TaxonomyProperties.java similarity index 57% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TaxonomyClassificationRequestBody.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TaxonomyProperties.java index 5cd6306fd06..09c3e6c7b8d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TaxonomyClassificationRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TaxonomyProperties.java @@ -1,12 +1,11 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.rest; +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 org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; import java.io.Serial; import java.io.Serializable; @@ -16,7 +15,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * TaxonomyClassificationRequestBody is used to classify a glossary that has the terms organized in a taxonomy. + * TaxonomyProperties is used to classify a glossary that has the terms organized in a taxonomy. * This means each term is attached to one, and only one category and the categories are organized as a hierarchy * with a single root category. * @@ -26,19 +25,18 @@ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TaxonomyClassificationRequestBody implements Serializable +public class TaxonomyProperties extends ClassificationProperties { @Serial private static final long serialVersionUID = 1L; - private MetadataCorrelationProperties metadataCorrelationProperties = null; private String organizingPrinciple = null; /** * Default constructor */ - public TaxonomyClassificationRequestBody() + public TaxonomyProperties() { super(); } @@ -49,38 +47,17 @@ public TaxonomyClassificationRequestBody() * * @param template template object to copy. */ - public TaxonomyClassificationRequestBody(TaxonomyClassificationRequestBody template) + public TaxonomyProperties(TaxonomyProperties template) { + super(template); + if (template != null) { - metadataCorrelationProperties = template.getMetadataCorrelationProperties(); organizingPrinciple = template.getOrganizingPrinciple(); } } - /** - * 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 organizing principle used to create the taxonomy in the glossary. * @@ -111,9 +88,11 @@ public void setOrganizingPrinciple(String organizingPrinciple) @Override public String toString() { - return "TaxonomyClassificationRequestBody{" + - "metadataCorrelationProperties=" + metadataCorrelationProperties + - ", organizingPrinciple='" + organizingPrinciple + '\'' + + return "TaxonomyProperties{" + + "organizingPrinciple='" + organizingPrinciple + '\'' + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + '}'; } @@ -131,13 +110,15 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TaxonomyProperties that)) + { + return false; + } + if (! super.equals(objectToCompare)) { return false; } - TaxonomyClassificationRequestBody that = (TaxonomyClassificationRequestBody) objectToCompare; - return Objects.equals(getMetadataCorrelationProperties(), that.getMetadataCorrelationProperties()) && - Objects.equals(getOrganizingPrinciple(), that.getOrganizingPrinciple()); + return Objects.equals(organizingPrinciple, that.organizingPrinciple); } @@ -149,6 +130,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getMetadataCorrelationProperties(), getOrganizingPrinciple()); + return Objects.hash(super.hashCode(), organizingPrinciple); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TemplateProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TemplateProperties.java index 29a1ef17667..610edfd74d7 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TemplateProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TemplateProperties.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -22,7 +23,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class TemplateProperties implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String qualifiedName = null; private String displayName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TermAssignmentStatus.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TermAssignmentStatus.java new file mode 100644 index 00000000000..251f5c1d456 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/TermAssignmentStatus.java @@ -0,0 +1,146 @@ +/* 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.Serializable; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * The TermAssignmentStatus defines the status of the relationship between a glossary term and an element that represents data. + * It indicates how much trust a steward or process should give to the relationship based on its source. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public enum TermAssignmentStatus implements Serializable +{ + /** + * Discovered - The term assignment was discovered by an automated process. + */ + DISCOVERED (0,0, "Discovered","The term assignment was discovered by an automated process."), + + /** + * Proposed - The term assignment was proposed by a subject-matter expert. + */ + PROPOSED (1,1, "Proposed", "The term assignment was proposed by a subject-matter expert."), + + /** + * Imported - The term assignment was imported from another metadata system. + */ + IMPORTED (2,2, "Imported", "The term assignment was imported from another metadata system."), + + /** + * Validated - The term assignment has been validated and approved by a subject-matter expert. + */ + VALIDATED (3,3, "Validated", "The term assignment has been validated and approved by a subject-matter expert."), + + /** + * Deprecated - The term assignment is out of date and should not be used. + */ + DEPRECATED(4,4, "Deprecated","The term assignment should no longer be used."), + + /** + * Obsolete - The term assignment must no longer be used. + */ + OBSOLETE(5,5, "Obsolete","The term assignment must no longer be used."), + + /** + * Other - The term assignment is in a locally defined state. + */ + OTHER (99,99, "Other", "The term assignment is in a locally defined state."), + ; + + + private final int ordinal; + private final int openTypeOrdinal; + private final String name; + private final String description; + + private static final long serialVersionUID = 1L; + + + /** + * Constructor to set up the instance of this enum. + * + * @param ordinal code number + * @param openTypeOrdinal code number from the equivalent Enum Type + * @param name default name + * @param description default description + */ + TermAssignmentStatus(int ordinal, + int openTypeOrdinal, + String name, + String description) + { + this.ordinal = ordinal; + this.openTypeOrdinal = openTypeOrdinal; + this.name = name; + this.description = description; + } + + /** + * Return the code for this enum instance + * + * @return int key pattern code + */ + public int getOrdinal() + { + return ordinal; + } + + + /** + * Return the code for this enum that comes from the Open Metadata Type that this enum represents. + * + * @return int code number + */ + public int getOpenTypeOrdinal() + { + return openTypeOrdinal; + } + + + + /** + * Return the default name for this enum instance. + * + * @return String default name + */ + public String getName() + { + return name; + } + + + /** + * Return the default description for the key pattern for this enum instance. + * + * @return String default description + */ + public String getDescription() + { + return description; + } + + + /** + * toString() JSON-style + * + * @return string description + */ + @Override + public String toString() + { + return "TermAssignmentStatus{" + + "ordinal=" + ordinal + + ", openTypeOrdinal=" + openTypeOrdinal + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + '}'; + }} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ValidValueProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ValidValueProperties.java index 893a6228a48..6acafabf122 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ValidValueProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/ValidValueProperties.java @@ -6,6 +6,7 @@ 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; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ValidValueProperties extends ReferenceableProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String displayName = null; private String description = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ActivityTermClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ActivityDescriptionProperties.java similarity index 76% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ActivityTermClassificationRequestBody.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ActivityDescriptionProperties.java index e10113b2d10..4a58266735d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ActivityTermClassificationRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ActivityDescriptionProperties.java @@ -6,23 +6,26 @@ 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.ClassificationProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermActivityType; +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; /** - * ActivityTermClassificationRequestBody is used to classify a glossary that describes an activity. This request body includes + * ActivityDescriptionProperties is used to classify a glossary that describes an activity. This request body includes * an enum that describes the type of activity. */ @JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ActivityTermClassificationRequestBody extends UpdateRequestBody +public class ActivityDescriptionProperties extends ClassificationProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private GlossaryTermActivityType activityType = null; @@ -30,7 +33,7 @@ public class ActivityTermClassificationRequestBody extends UpdateRequestBody /** * Default constructor */ - public ActivityTermClassificationRequestBody() + public ActivityDescriptionProperties() { super(); } @@ -41,7 +44,7 @@ public ActivityTermClassificationRequestBody() * * @param template template object to copy. */ - public ActivityTermClassificationRequestBody(ActivityTermClassificationRequestBody template) + public ActivityDescriptionProperties(ActivityDescriptionProperties template) { super(template); @@ -82,10 +85,11 @@ public void setActivityType(GlossaryTermActivityType activityType) @Override public String toString() { - return "ActivityTermClassificationRequestBody{" + + return "ActivityDescriptionProperties{" + "activityType=" + activityType + - ", metadataCorrelationProperties=" + getMetadataCorrelationProperties() + - ", effectiveTime=" + getEffectiveTime() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", extendedProperties=" + getExtendedProperties() + '}'; } @@ -111,7 +115,7 @@ public boolean equals(Object objectToCompare) { return false; } - ActivityTermClassificationRequestBody that = (ActivityTermClassificationRequestBody) objectToCompare; + ActivityDescriptionProperties that = (ActivityDescriptionProperties) objectToCompare; return activityType == that.activityType; } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerIdentifiersRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerIdentifiersRequestBody.java index 08e527b2992..fb5acacc275 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerIdentifiersRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerIdentifiersRequestBody.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -19,7 +20,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class AssetManagerIdentifiersRequestBody implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String assetManagerGUID = null; private String assetManagerName = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerOMASAPIResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerOMASAPIResponse.java index e341a62310b..60f575e6fcc 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerOMASAPIResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/AssetManagerOMASAPIResponse.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.*; import org.odpi.openmetadata.commonservices.ffdc.rest.FFDCResponseBase; +import java.io.Serial; import java.util.Arrays; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -31,7 +32,8 @@ }) public abstract class AssetManagerOMASAPIResponse extends FFDCResponseBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; /** * Default constructor diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CalculatedValueClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CalculatedValueClassificationRequestBody.java index aa1077d6e76..dc719ec6b0d 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CalculatedValueClassificationRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CalculatedValueClassificationRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class CalculatedValueClassificationRequestBody extends UpdateRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String formula = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CanonicalVocabularyClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CanonicalVocabularyClassificationRequestBody.java deleted file mode 100644 index 753dba04c57..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/CanonicalVocabularyClassificationRequestBody.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.MetadataCorrelationProperties; - -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; - -/** - * CanonicalVocabularyClassificationRequestBody is used to classify a glossary that has no term definitions with - * the same name. This means there is only one definition for each term. Typically the terms are also of a similar - * level of granularity and are limited to a specific scope of use. - * - * Canonical vocabularies are used to semantically classify assets in an unambiguous way. - */ -@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class CanonicalVocabularyClassificationRequestBody implements Serializable -{ - private static final long serialVersionUID = 1L; - - private MetadataCorrelationProperties metadataCorrelationProperties = null; - private String scope = null; - - - /** - * Default constructor - */ - public CanonicalVocabularyClassificationRequestBody() - { - super(); - } - - - /** - * Copy/clone constructor for a primary key. - * - * @param template template object to copy. - */ - public CanonicalVocabularyClassificationRequestBody(CanonicalVocabularyClassificationRequestBody template) - { - if (template != null) - { - metadataCorrelationProperties = template.getMetadataCorrelationProperties(); - scope = template.getScope(); - } - } - - - /** - * 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 scope that the terms in the glossary covers. - * - * @return string description - */ - public String getScope() - { - return scope; - } - - - /** - * Set up the scope that the terms in the glossary covers. - * - * @param scope string description - */ - public void setScope(String scope) - { - this.scope = scope; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "CanonicalVocabularyClassificationRequestBody{" + - "metadataCorrelationProperties=" + metadataCorrelationProperties + - ", scope='" + scope + '\'' + - '}'; - } - - - /** - * 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; - } - CanonicalVocabularyClassificationRequestBody that = (CanonicalVocabularyClassificationRequestBody) objectToCompare; - return Objects.equals(getMetadataCorrelationProperties(), that.getMetadataCorrelationProperties()) && - Objects.equals(getScope(), that.getScope()); - } - - - /** - * Return hash code based on properties. - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), getMetadataCorrelationProperties(), getScope()); - } -} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ClassificationRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ClassificationRequestBody.java new file mode 100644 index 00000000000..e65981951e6 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ClassificationRequestBody.java @@ -0,0 +1,178 @@ +/* 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.ClassificationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ClassificationRequestBody describes the request body used when classifying/reclassifying elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ClassificationRequestBody implements Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + private MetadataCorrelationProperties metadataCorrelationProperties = null; + private ClassificationProperties properties = null; + private Date effectiveTime = null; + + + + /** + * Default constructor + */ + public ClassificationRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ClassificationRequestBody(ClassificationRequestBody template) + { + if (template != null) + { + metadataCorrelationProperties = template.getMetadataCorrelationProperties(); + properties = template.getProperties(); + effectiveTime = template.getEffectiveTime(); + } + } + + + /** + * 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 classification. + * + * @return properties object + */ + public ClassificationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the classification. + * + * @param properties properties object + */ + public void setProperties(ClassificationProperties properties) + { + this.properties = properties; + } + + + /** + * Return the date/time to use for the query. + * + * @return date object + */ + public Date getEffectiveTime() + { + return effectiveTime; + } + + + /** + * Set up the date/time to use for the query. + * + * @param effectiveTime date object + */ + public void setEffectiveTime(Date effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ClassificationRequestBody{" + + "metadataCorrelationProperties=" + metadataCorrelationProperties + + ", properties=" + properties + + ", effectiveTime=" + effectiveTime + + '}'; + } + + + /** + * 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 instanceof ClassificationRequestBody that)) + { + return false; + } + return Objects.equals(metadataCorrelationProperties, that.metadataCorrelationProperties) && + Objects.equals(properties, that.properties) && + Objects.equals(effectiveTime, that.effectiveTime); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(metadataCorrelationProperties, properties, effectiveTime); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementsResponse.java index 94fb1dcad84..2bdb232b80e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementsResponse.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlFlowElementsResponse.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.ArrayList; import java.util.Arrays; import java.util.List; @@ -17,7 +18,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** - * ControlFlowElementsResponse is a response object for passing back a a list of control flow relationships + * ControlFlowElementsResponse is a response object for passing back a list of control flow relationships * 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 ControlFlowElementsResponse 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/ControlledGlossaryTermRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlledGlossaryTermRequestBody.java index 1b702ba558d..d1ae42b9b99 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlledGlossaryTermRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ControlledGlossaryTermRequestBody.java @@ -12,6 +12,7 @@ import java.io.Serial; import java.io.Serializable; +import java.util.Date; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; @@ -32,6 +33,7 @@ public class ControlledGlossaryTermRequestBody implements Serializable private MetadataCorrelationProperties metadataCorrelationProperties = null; private GlossaryTermProperties elementProperties = null; private GlossaryTermStatus initialStatus = null; + private Date effectiveTime = null; /** * Default constructor @@ -54,6 +56,7 @@ public ControlledGlossaryTermRequestBody(ControlledGlossaryTermRequestBody templ metadataCorrelationProperties = template.getMetadataCorrelationProperties(); elementProperties = template.getElementProperties(); initialStatus = template.getInitialStatus(); + effectiveTime = template.getEffectiveTime(); } } @@ -124,6 +127,28 @@ public void setInitialStatus(GlossaryTermStatus initialStatus) } + /** + * Return the date/time to use for the query. + * + * @return date object + */ + public Date getEffectiveTime() + { + return effectiveTime; + } + + + /** + * Set up the date/time to use for the query. + * + * @param effectiveTime date object + */ + public void setEffectiveTime(Date effectiveTime) + { + this.effectiveTime = effectiveTime; + } + + /** * JSON-style toString * @@ -136,6 +161,7 @@ public String toString() "metadataCorrelationProperties=" + metadataCorrelationProperties + ", elementProperties=" + elementProperties + ", initialStatus=" + initialStatus + + ", effectiveTime=" + effectiveTime + '}'; } @@ -159,7 +185,8 @@ public boolean equals(Object objectToCompare) } ControlledGlossaryTermRequestBody that = (ControlledGlossaryTermRequestBody) objectToCompare; return Objects.equals(getMetadataCorrelationProperties(), that.getMetadataCorrelationProperties()) && - Objects.equals(getElementProperties(), that.getElementProperties()); + Objects.equals(getElementProperties(), that.getElementProperties()) && + Objects.equals(effectiveTime, that.effectiveTime); } @@ -172,6 +199,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), metadataCorrelationProperties, elementProperties, initialStatus); + return Objects.hash(super.hashCode(), metadataCorrelationProperties, elementProperties, initialStatus, effectiveTime); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableRequestBody.java new file mode 100644 index 00000000000..21d8d5b41d9 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableRequestBody.java @@ -0,0 +1,178 @@ +/* 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.ReferenceableProperties; +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; + + +/** + * ReferenceableRequestBody describes the request body used to create/update properties in referenceables. The properties + * of the specific element must inherit from ReferenceableProperties and be included in the subtype list of the ReferenceableProperties class + * to make it possible for the server to correctly unpack this bean. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceableRequestBody implements Serializable +{ + @Serial + private static final long serialVersionUID = 1L; + + private MetadataCorrelationProperties metadataCorrelationProperties = null; + private ReferenceableProperties elementProperties = null; + private String parentGUID = null; + + + /** + * Default constructor + */ + public ReferenceableRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ReferenceableRequestBody(ReferenceableRequestBody template) + { + if (template != null) + { + metadataCorrelationProperties = template.getMetadataCorrelationProperties(); + elementProperties = template.getElementProperties(); + parentGUID = template.getParentGUID(); + } + } + + + /** + * 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 ReferenceableProperties getElementProperties() + { + return elementProperties; + } + + + /** + * Set up the properties for the element. + * + * @param elementProperties properties object + */ + public void setElementProperties(ReferenceableProperties elementProperties) + { + this.elementProperties = elementProperties; + } + + + /** + * Return an optional parent GUID to attach the new element to. + * + * @return guid + */ + public String getParentGUID() + { + return parentGUID; + } + + + /** + * Set up an optional parent GUID to attach the new element to. + * + * @param parentGUID guid + */ + public void setParentGUID(String parentGUID) + { + this.parentGUID = parentGUID; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ReferenceableRequestBody{" + + "metadataCorrelationProperties=" + metadataCorrelationProperties + + ", elementProperties=" + elementProperties + + ", parentGUID='" + parentGUID + '\'' + + '}'; + } + + + /** + * 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 instanceof ReferenceableRequestBody that)) + { + return false; + } + return Objects.equals(metadataCorrelationProperties, that.metadataCorrelationProperties) && + Objects.equals(elementProperties, that.elementProperties) && + Objects.equals(parentGUID, that.parentGUID); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), metadataCorrelationProperties, elementProperties, parentGUID); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableUpdateRequestBody.java similarity index 57% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermRequestBody.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableUpdateRequestBody.java index 63ad4ca9ab0..f37dcaff853 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/GlossaryTermRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/ReferenceableUpdateRequestBody.java @@ -2,75 +2,75 @@ /* 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.GlossaryTermProperties; +import java.io.Serial; +import java.util.Date; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - /** - * GlossaryTermRequestBody describes the request body used to create/update glossary term properties. + * ReferenceableUpdateRequestBody carries the correlation properties, readVersionIdentifier and effective time for a create (with parent), + * update or delete requests. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class GlossaryTermRequestBody extends UpdateRequestBody +public class ReferenceableUpdateRequestBody extends ReferenceableRequestBody { - private static final long serialVersionUID = 1L; - - private GlossaryTermProperties elementProperties = null; + @Serial + private static final long serialVersionUID = 1L; + private Date effectiveTime = null; /** * Default constructor */ - public GlossaryTermRequestBody() + public ReferenceableUpdateRequestBody() { super(); } /** - * Copy/clone constructor. + * Copy/clone constructor * * @param template object to copy */ - public GlossaryTermRequestBody(GlossaryTermRequestBody template) + public ReferenceableUpdateRequestBody(ReferenceableUpdateRequestBody template) { super(template); if (template != null) { - elementProperties = template.getElementProperties(); + effectiveTime = template.getEffectiveTime(); } } /** - * Return the properties for the element. + * Return the date/time to use for the query. * - * @return properties object + * @return date object */ - public GlossaryTermProperties getElementProperties() + public Date getEffectiveTime() { - return elementProperties; + return effectiveTime; } /** - * Set up the properties for the element. + * Set up the date/time to use for the query. * - * @param elementProperties properties object + * @param effectiveTime date object */ - public void setElementProperties(GlossaryTermProperties elementProperties) + public void setEffectiveTime(Date effectiveTime) { - this.elementProperties = elementProperties; + this.effectiveTime = effectiveTime; } @@ -82,10 +82,10 @@ public void setElementProperties(GlossaryTermProperties elementProperties) @Override public String toString() { - return "GlossaryTermRequestBody{" + - "elementProperties=" + elementProperties + + return "ReferenceableUpdateRequestBody{" + + "effectiveTime=" + effectiveTime + ", metadataCorrelationProperties=" + getMetadataCorrelationProperties() + - ", effectiveTime=" + getEffectiveTime() + + ", elementProperties=" + getElementProperties() + '}'; } @@ -103,7 +103,7 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof ReferenceableUpdateRequestBody that)) { return false; } @@ -111,8 +111,7 @@ public boolean equals(Object objectToCompare) { return false; } - GlossaryTermRequestBody that = (GlossaryTermRequestBody) objectToCompare; - return Objects.equals(elementProperties, that.elementProperties); + return Objects.equals(effectiveTime, that.effectiveTime); } @@ -124,6 +123,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementProperties); + return Objects.hash(super.hashCode(), effectiveTime); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelatedElementsResponse.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelatedElementsResponse.java new file mode 100644 index 00000000000..ab89014d945 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelatedElementsResponse.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.accessservices.assetmanager.metadataelements.ControlFlowElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelatedElement; + +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; + +/** + * RelatedElementElementsResponse is a response object for passing back a list of relationships + * 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 RelatedElementsResponse extends AssetManagerOMASAPIResponse +{ + @Serial + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public RelatedElementsResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElementsResponse(RelatedElementsResponse 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 "RelatedElementElementsResponse{" + + "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; + } + RelatedElementsResponse that = (RelatedElementsResponse) 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/RelationshipRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipRequestBody.java index d6883eb6c88..8923cab2447 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/RelationshipRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.assetmanager.properties.RelationshipProperties; +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 RelationshipRequestBody extends EffectiveTimeQueryRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private RelationshipProperties properties = null; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TemplateRequestBody.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TemplateRequestBody.java index 6cce32f9ef4..894399300de 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TemplateRequestBody.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/rest/TemplateRequestBody.java @@ -28,7 +28,8 @@ public class TemplateRequestBody extends UpdateRequestBody @Serial private static final long serialVersionUID = 1L; - private TemplateProperties elementProperties = null; + private TemplateProperties elementProperties = null; + private String parentGUID = null; /** @@ -52,6 +53,7 @@ public TemplateRequestBody(TemplateRequestBody template) if (template != null) { elementProperties = template.getElementProperties(); + parentGUID = template.getParentGUID(); } } @@ -78,6 +80,28 @@ public void setElementProperties(TemplateProperties elementProperties) } + /** + * Return an optional parent GUID to attach the new element to. + * + * @return guid + */ + public String getParentGUID() + { + return parentGUID; + } + + + /** + * Set up an optional parent GUID to attach the new element to. + * + * @param parentGUID guid + */ + public void setParentGUID(String parentGUID) + { + this.parentGUID = parentGUID; + } + + /** * JSON-style toString * @@ -88,6 +112,7 @@ public String toString() { return "TemplateRequestBody{" + "elementProperties=" + elementProperties + + ", parentGUID='" + parentGUID + '\'' + ", metadataCorrelationProperties=" + getMetadataCorrelationProperties() + ", effectiveTime=" + getEffectiveTime() + '}'; @@ -107,7 +132,7 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TemplateRequestBody that)) { return false; } @@ -115,8 +140,7 @@ public boolean equals(Object objectToCompare) { return false; } - TemplateRequestBody that = (TemplateRequestBody) objectToCompare; - return Objects.equals(elementProperties, that.elementProperties); + return Objects.equals(elementProperties, that.elementProperties) && Objects.equals(parentGUID, that.parentGUID); } @@ -128,6 +152,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementProperties); + return Objects.hash(super.hashCode(), elementProperties, parentGUID); } } 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 new file mode 100644 index 00000000000..5deb6c3d956 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerBaseClient.java @@ -0,0 +1,1514 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.client; + +import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.ffdc.AssetManagerErrorCode; +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.KeyPattern; +import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ReferenceableProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +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.NameRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableUpdateRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.RelatedElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.SearchStringRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.UpdateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; +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 java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * AssetManagerBaseClient supports the common properties and functions for the Asset Manager OMAS. + */ +public class AssetManagerBaseClient +{ + final protected String serverName; /* Initialized in constructor */ + final protected String serverPlatformURLRoot; /* Initialized in constructor */ + + final protected InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + final protected AssetManagerRESTClient restClient; /* Initialized in constructor */ + final protected NullRequestBody nullRequestBody = new NullRequestBody(); + + final protected String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}"; + AuditLog auditLog = null; + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public AssetManagerBaseClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.auditLog = auditLog; + this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public AssetManagerBaseClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public AssetManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public AssetManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor (with security)"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.auditLog = auditLog; + this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public AssetManagerBaseClient(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor (with REST client)"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + invalidParameterHandler.setMaxPagingSize(maxPageSize); + + this.auditLog = auditLog; + this.restClient = restClient; + } + + /* ======================================================== + * Metadata correlation setup. + */ + + + /** + * Throw an exception because the asset manager's GUID has not been passed with an external identifier. + * + * @param externalIdentifier external identifier + * @param methodName calling method + * @throws InvalidParameterException resulting exception + */ + protected void handleMissingScope(String externalIdentifier, + String methodName) throws InvalidParameterException + { + final String externalIdentifierParameterName = "externalIdentifier"; + + throw new InvalidParameterException(AssetManagerErrorCode.NO_SCOPE_FOR_EXTERNAL_ID.getMessageDefinition(externalIdentifier, + methodName), + this.getClass().getName(), + methodName, + externalIdentifierParameterName); + } + + + /** + * Set up the correlation properties for update. + * + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param externalIdentifier unique identifier of the glossary in the external asset manager + * @param methodName calling method + * @return filled out correlation properties + * @throws InvalidParameterException missing external identifier + */ + protected MetadataCorrelationProperties getCorrelationProperties(String assetManagerGUID, + String assetManagerName, + String externalIdentifier, + String methodName) throws InvalidParameterException + { + MetadataCorrelationProperties correlationProperties = new MetadataCorrelationProperties(); + + if (assetManagerGUID != null) + { + correlationProperties.setAssetManagerGUID(assetManagerGUID); + correlationProperties.setAssetManagerName(assetManagerName); + correlationProperties.setExternalIdentifier(externalIdentifier); + + return correlationProperties; + } + else if (externalIdentifier != null) + { + handleMissingScope(externalIdentifier, methodName); + } + + return correlationProperties; + } + + + /** + * Set up the correlation properties for update. + * + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param externalIdentifier unique identifier of the glossary in the external asset manager + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName calling method + * @return filled out correlation properties + * @throws InvalidParameterException missing external identifier + */ + protected UpdateRequestBody getUpdateRequestBody(String assetManagerGUID, + String assetManagerName, + String externalIdentifier, + Date effectiveTime, + String methodName) throws InvalidParameterException + { + UpdateRequestBody requestBody = new UpdateRequestBody(); + + requestBody.setMetadataCorrelationProperties(getCorrelationProperties(assetManagerGUID, assetManagerName, externalIdentifier, methodName)); + requestBody.setEffectiveTime(effectiveTime); + + return requestBody; + } + + + /** + * Set up the correlation properties for request. + * + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param externalIdentifierName name of property for the external identifier in the external asset manager + * @param externalIdentifierUsage optional usage description for the external identifier when calling the external asset manager + * @param externalIdentifierSource component that issuing this request. + * @param externalIdentifierKeyPattern pattern for the external identifier within the external asset manager (default is LOCAL_KEY) + * @param mappingProperties additional properties to help with the mapping of the elements in the external asset manager and open metadata + * @param methodName calling method + * @return filled out correlation properties + * @throws InvalidParameterException missing external identifier + */ + protected MetadataCorrelationProperties getCorrelationProperties(String assetManagerGUID, + String assetManagerName, + String externalIdentifier, + String externalIdentifierName, + String externalIdentifierUsage, + String externalIdentifierSource, + KeyPattern externalIdentifierKeyPattern, + Map mappingProperties, + String methodName) throws InvalidParameterException + { + MetadataCorrelationProperties correlationProperties = new MetadataCorrelationProperties(); + + if (assetManagerGUID != null) + { + correlationProperties.setAssetManagerGUID(assetManagerGUID); + correlationProperties.setAssetManagerName(assetManagerName); + + if (externalIdentifier != null) + { + correlationProperties.setKeyPattern(KeyPattern.LOCAL_KEY); + correlationProperties.setExternalIdentifier(externalIdentifier); + correlationProperties.setExternalIdentifierName(externalIdentifierName); + correlationProperties.setExternalIdentifierUsage(externalIdentifierUsage); + correlationProperties.setExternalIdentifierSource(externalIdentifierSource); + correlationProperties.setKeyPattern(externalIdentifierKeyPattern); + correlationProperties.setMappingProperties(mappingProperties); + } + } + else if (externalIdentifier != null) + { + handleMissingScope(externalIdentifier, methodName); + } + + return correlationProperties; + } + + + + /** + * Set up the correlation properties for request. + * + * @param assetManagerGUID unique identifier of software server capability representing the caller + * @param assetManagerName unique name of software server capability representing the caller + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param methodName calling method + * @return filled out correlation properties + * @throws InvalidParameterException missing external identifier + */ + protected MetadataCorrelationProperties getCorrelationProperties(String assetManagerGUID, + String assetManagerName, + ExternalIdentifierProperties externalIdentifierProperties, + String methodName) throws InvalidParameterException + { + MetadataCorrelationProperties correlationProperties = new MetadataCorrelationProperties(externalIdentifierProperties); + + if (assetManagerGUID != null) + { + correlationProperties.setAssetManagerGUID(assetManagerGUID); + correlationProperties.setAssetManagerName(assetManagerName); + } + else if ((externalIdentifierProperties != null) && (externalIdentifierProperties.getExternalIdentifier() != null)) + { + handleMissingScope(externalIdentifierProperties.getExternalIdentifier(), methodName); + } + + return correlationProperties; + } + + + /** + * Return the asset manager identifiers packaged in an appropriate request body (or null if assetManagerGUID is null). + * + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique name for the asset manager + * @return request body + */ + protected AssetManagerIdentifiersRequestBody getAssetManagerIdentifiersRequestBody(String assetManagerGUID, + String assetManagerName) + { + AssetManagerIdentifiersRequestBody requestBody = new AssetManagerIdentifiersRequestBody(); + + if (assetManagerGUID != null) + { + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + } + + return requestBody; + } + + + + /** + * Return the asset manager identifiers packaged in an appropriate request body. + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique name for the asset manager + * @param effectiveTime the time that the retrieved elements must be effective for + * @return request body + */ + protected EffectiveTimeQueryRequestBody getEffectiveTimeQueryRequestBody(String assetManagerGUID, + String assetManagerName, + Date effectiveTime) + { + EffectiveTimeQueryRequestBody requestBody = new EffectiveTimeQueryRequestBody(); + + if (assetManagerGUID != null) + { + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + } + + requestBody.setEffectiveTime(effectiveTime); + + return requestBody; + } + + + + /** + * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. + * + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique name for the asset manager + * @param effectiveTime the time that the retrieved elements must be effective for + * @param relationshipProperties relationship properties + * @return request body + */ + protected RelationshipRequestBody getRelationshipRequestBody(String assetManagerGUID, + String assetManagerName, + Date effectiveTime, + RelationshipProperties relationshipProperties) + { + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + if (assetManagerGUID != null) + { + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + } + + requestBody.setEffectiveTime(effectiveTime); + requestBody.setProperties(relationshipProperties); + + return requestBody; + } + + + /** + * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. + * + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique name for the asset manager + * @param name name to search for + * @param nameParameterName parameter name + * @param effectiveTime the time that the retrieved elements must be effective for + * @return request body + */ + protected NameRequestBody getNameRequestBody(String assetManagerGUID, + String assetManagerName, + String name, + String nameParameterName, + Date effectiveTime) + { + NameRequestBody requestBody = new NameRequestBody(); + + if (assetManagerGUID != null) + { + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + } + + requestBody.setName(name); + requestBody.setNameParameterName(nameParameterName); + requestBody.setEffectiveTime(effectiveTime); + + return requestBody; + } + + + /** + * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. + * + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique name for the asset manager + * @param name name to search for + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName calling method + * @return request body + * @throws InvalidParameterException blank name + */ + protected NameRequestBody getNameRequestBody(String assetManagerGUID, + String assetManagerName, + String name, + Date effectiveTime, + String methodName) throws InvalidParameterException + { + final String nameParameterName = "name"; + + invalidParameterHandler.validateName(name, nameParameterName, methodName); + + return getNameRequestBody(assetManagerGUID, assetManagerName, name, nameParameterName, effectiveTime); + } + + + /** + * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. + * + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique qualifiedName for the asset manager + * @param qualifiedName qualifiedName to search for + * @param effectiveTime the time that the retrieved elements must be effective for + * @return request body + */ + protected NameRequestBody getQualifiedNameRequestBody(String assetManagerGUID, + String assetManagerName, + String qualifiedName, + Date effectiveTime) + { + final String nameParameterName = "qualifiedName"; + + return getNameRequestBody(assetManagerGUID, assetManagerName, qualifiedName, nameParameterName, effectiveTime); + } + + + /** + * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. + * + * @param assetManagerGUID unique identifier for the asset manager + * @param assetManagerName unique name for the asset manager + * @param searchString string to find in the properties + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName calling method + * @return request body + * @throws InvalidParameterException blank name + */ + protected SearchStringRequestBody getSearchStringRequestBody(String assetManagerGUID, + String assetManagerName, + String searchString, + Date effectiveTime, + String methodName) throws InvalidParameterException + { + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + if (assetManagerGUID != null) + { + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + } + + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + requestBody.setEffectiveTime(effectiveTime); + + return requestBody; + } + + /* ===================================================================================================================== + * Basic client methods + */ + + + /** + * Create a new metadata element that does not link to another element on create. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @return unique identifier of the new element + * + * @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 String createReferenceable(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + ExternalIdentifierProperties externalIdentifierProperties, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + final String requestParamsURLTemplate = "?assetManagerIsHome={2}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierProperties, + methodName)); + requestBody.setElementProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + assetManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param urlTemplate URL to call (with placeholders) + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @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 String createReferenceableFromTemplate(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String templateGUID, + TemplateProperties templateProperties, + ExternalIdentifierProperties externalIdentifierProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "templateProperties.qualifiedName"; + final String requestParamsURLTemplate = "?assetManagerIsHome={3}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(); + + requestBody.setElementProperties(templateProperties); + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierProperties, + methodName)); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + templateGUID, + assetManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param parentGUID unique identifier of the parent element + * @param parentGUIDParameterName name of parameter passing the parentGUID + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param urlTemplate URL to call (with placeholders) + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @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 String createReferenceableFromTemplateWithParent(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String parentGUID, + String parentGUIDParameterName, + String templateGUID, + TemplateProperties templateProperties, + ExternalIdentifierProperties externalIdentifierProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + final String requestParamsURLTemplate = "?assetManagerIsHome={4}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(parentGUID, parentGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierProperties, + methodName)); + requestBody.setParentGUID(parentGUID); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + parentGUID, + templateGUID, + assetManagerIsHome); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element that is attached to the parent. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param parentGUID unique identifier of the parent element + * @param parentGUIDParameterName name of parameter passing the parentGUID + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param urlTemplate URL to call (no expected placeholders) + * @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 unique identifier of the new element + * + * @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 String createReferenceableWithParent(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String parentGUID, + String parentGUIDParameterName, + ReferenceableProperties properties, + String propertiesParameterName, + ExternalIdentifierProperties externalIdentifierProperties, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + final String requestParamsURLTemplate = "?assetManagerIsHome={3}&forLineage={4}&forDuplicateProcessing={5}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(parentGUID, parentGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableUpdateRequestBody requestBody = new ReferenceableUpdateRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierProperties, + methodName)); + requestBody.setParentGUID(parentGUID); + requestBody.setElementProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + parentGUID, + assetManagerIsHome, + forLineage, + forDuplicateProcessing); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element that is attached to the parent. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param parentGUID unique identifier of the parent element + * @param parentGUIDParameterName name of parameter passing the parentGUID + * @param isPublic is this comment visible to other people. + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param urlTemplate URL to call (no expected placeholders) + * @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 unique identifier of the new element + * + * @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 String createFeedbackWithParent(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String parentGUID, + String parentGUIDParameterName, + boolean isPublic, + ReferenceableProperties properties, + String propertiesParameterName, + ExternalIdentifierProperties externalIdentifierProperties, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + 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(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierProperties, + methodName)); + requestBody.setParentGUID(parentGUID); + requestBody.setElementProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + parentGUID, + assetManagerIsHome, + isPublic, + forLineage, + forDuplicateProcessing); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @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 metadata element to update + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param externalIdentifierName optional external identifier + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties new properties for the metadata element + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @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 + * + * @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 void updateReferenceable(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementGUIDParameterName, + String externalIdentifierName, + boolean isMergeUpdate, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + final String requestParamsURLTemplate = "?isMergeUpdate={3}&forLineage={4}&forDuplicateProcessing={5}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableUpdateRequestBody requestBody = new ReferenceableUpdateRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierName, + methodName)); + requestBody.setElementProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate, + forLineage, + forDuplicateProcessing); + } + + + /** + * Update the metadata element. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @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 metadata element to update + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param externalIdentifierName optional external identifier + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this element visible to other people. + * @param properties new properties for the metadata element + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @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 + * + * @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 void updateFeedback(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementGUIDParameterName, + String externalIdentifierName, + boolean isMergeUpdate, + boolean isPublic, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + final String requestParamsURLTemplate = "?isMergeUpdate={3}&isPublic={4}forLineage={5}&forDuplicateProcessing={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableUpdateRequestBody requestBody = new ReferenceableUpdateRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierName, + methodName)); + requestBody.setElementProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate, + isPublic, + forLineage, + forDuplicateProcessing); + } + + + /** + * Add or update classification on referenceable. + * + * @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 metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param externalIdentifierName optional name used to define an external identifier + * @param properties properties of security at the site + * @param urlTemplate URL to call with placeholder for guid + * @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 + * + * @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 void setReferenceableClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementGUIDParameter, + String externalIdentifierName, + ClassificationProperties properties, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + final String requestParamsURLTemplate = "?forLineage={3}&forDuplicateProcessing={4}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierName, + methodName)); + requestBody.setProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + elementGUID, + forLineage, + forDuplicateProcessing); + } + + + /** + * Remove classification from the referenceable. + * + * @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 metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param externalIdentifierName optional name used to define an external identifier + * @param urlTemplate URL to call with placeholder for guid + * @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 + * @param methodName calling method + * + * @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 void removeReferenceableClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementGUIDParameter, + String externalIdentifierName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + final String requestParamsURLTemplate = "?forLineage={3}&forDuplicateProcessing={4}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierName, + methodName)); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + elementGUID, + forLineage, + forDuplicateProcessing); + } + + + /** + * Create a relationship between a primary element and a secondary 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 primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @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 + * + * @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 void setupRelationship(String userId, + String assetManagerGUID, + String assetManagerName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?forLineage={4}&forDuplicateProcessing={5}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID, + forLineage, + forDuplicateProcessing); + } + + + /** + * Create a relationship between a primary element and a secondary 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 primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param relationshipTypeName type of relationship to create + * @param relationshipTypeNameParameterName name of the parameter passing relationshipTypeName + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @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 + * + * @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 void setupRelationship(String userId, + String assetManagerGUID, + String assetManagerName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String relationshipTypeName, + String relationshipTypeNameParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?forLineage={5}&forDuplicateProcessing={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateName(relationshipTypeName, relationshipTypeNameParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setProperties(properties); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + relationshipTypeName, + secondaryElementGUID, + forLineage, + forDuplicateProcessing); + } + + + /** + * Remove a relationship. + * + * @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 primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @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 + * + * @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 void clearRelationship(String userId, + String assetManagerGUID, + String assetManagerName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?forLineage={4}&forDuplicateProcessing={5}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), + serverName, + userId, + primaryElementGUID, + secondaryElementGUID, + forLineage, + forDuplicateProcessing); + } + + + /** + * Remove a relationship. + * + * @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 primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param relationshipTypeName type of relationship to create + * @param relationshipTypeNameParameterName name of the parameter passing relationshipTypeName + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @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 + * + * @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 void clearRelationship(String userId, + String assetManagerGUID, + String assetManagerName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String relationshipTypeName, + String relationshipTypeNameParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?forLineage={5}&forDuplicateProcessing={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateName(relationshipTypeName, relationshipTypeNameParameterName, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), + serverName, + userId, + primaryElementGUID, + relationshipTypeName, + secondaryElementGUID, + forLineage, + forDuplicateProcessing); + } + + + /** + * Retrieve a relationship. + * + * @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 startingElementGUID unique identifier of the primary element + * @param startingElementGUIDParameterName name of parameter passing the startingElementGUID + * @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 getRelatedElements(String userId, + String assetManagerGUID, + String assetManagerName, + String startingElementGUID, + String startingElementGUIDParameterName, + String urlTemplate, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?startFrom={3}&pageSize={4}&forLineage={5}&forDuplicateProcessing={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + + RelatedElementsResponse restResult = restClient.callRelatedElementsPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, + assetManagerName, + effectiveTime), + serverName, + userId, + startingElementGUID, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Remove the metadata 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 metadata element to remove + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param externalIdentifierName unique identifier of the element in the external asset manager + * @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 + * + * @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 void removeReferenceable(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementGUIDParameterName, + String externalIdentifierName, + String urlTemplate, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String requestParamsURLTemplate = "?forLineage={3}&forDuplicateProcessing={4}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + + + ReferenceableUpdateRequestBody requestBody = new ReferenceableUpdateRequestBody(); + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + externalIdentifierName, + methodName)); + requestBody.setEffectiveTime(effectiveTime); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate + requestParamsURLTemplate, + requestBody, + serverName, + userId, + elementGUID, + forLineage, + forDuplicateProcessing); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/CollaborationExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/CollaborationExchangeClient.java deleted file mode 100644 index dc1a9320e6d..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/CollaborationExchangeClient.java +++ /dev/null @@ -1,1010 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.assetmanager.client; - -import org.odpi.openmetadata.accessservices.assetmanager.api.CollaborationExchangeInterface; -import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; -import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.TagProperties; -import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementResponse; -import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementsResponse; -import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagResponse; -import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; -import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagsResponse; -import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDListResponse; -import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; -import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; -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 java.util.List; - - -/** - * DataElementExchangeClient is the client for managing comments, ratings, likes and tags. - */ -public class CollaborationExchangeClient extends ExchangeClientBase implements CollaborationExchangeInterface -{ - static final NullRequestBody nullRequestBody = new NullRequestBody(); - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public CollaborationExchangeClient(String serverName, - String serverPlatformURLRoot, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, auditLog); - } - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public CollaborationExchangeClient(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @param auditLog logging destination - * - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public CollaborationExchangeClient(String serverName, - String serverPlatformURLRoot, - String userId, - String password, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, userId, password, auditLog); - } - - - /** - * Create a new client that is going to be used in an OMAG Server. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param restClient client that issues the REST API calls - * @param maxPageSize maximum number of results supported by this server - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public CollaborationExchangeClient(String serverName, - String serverPlatformURLRoot, - AssetManagerRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public CollaborationExchangeClient(String serverName, - String serverPlatformURLRoot, - String userId, - String password) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, userId, password); - } - - - /** - * Adds a star rating and optional review text to the element. If the user has already attached - * a rating then the original one is over-ridden. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element. - * @param properties properties of the rating - * @return unique identifier of the rating - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String addRatingToElement(String userId, - String elementGUID, - RatingProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "addRatingToElement"; - final String guidParameter = "elementGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/ratings"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); - - GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - properties, - serverName, - userId, - elementGUID); - - return response.getGUID(); - } - - - /** - * Removes of a review that was added to the element by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the attached element. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void removeRatingFromElement(String userId, - String elementGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "removeRatingFromElement"; - final String guidParameter = "elementGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/ratings/remove"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - nullRequestBody, - serverName, - userId, - elementGUID); - } - - - /** - * Adds a "LikeProperties" to the element. - * - * @param userId userId of user making request - * @param elementGUID unique identifier for the element - * @param properties indicates whether the feedback should be shared or only be visible to the originating user - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void addLikeToElement(String userId, - String elementGUID, - LikeProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "addLikeToElement"; - final String guidParameter = "elementGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/likes"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - properties, - serverName, - userId, - elementGUID); - } - - - /** - * Removes a "LikeProperties" added to the element by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the like object. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void removeLikeFromElement(String userId, - String elementGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "removeLikeFromElement"; - final String guidParameter = "elementGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/likes/remove"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - nullRequestBody, - serverName, - userId, - elementGUID); - } - - - /** - * Adds a comment to the element. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element. - * @param properties properties of the comment - * - * @return guid of new comment. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String addCommentToElement(String userId, - String elementGUID, - CommentProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "addCommentToElement"; - final String guidParameter = "elementGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/comments"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); - - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - properties, - serverName, - userId, - elementGUID); - - return restResult.getGUID(); - } - - - /** - * Adds a comment to another comment. - * - * @param userId userId of user making request. - * @param elementGUID String - unique id of element that this chain of comments is linked. - * @param commentGUID unique identifier for an existing comment. Used to add a reply to a comment. - * @param properties properties of the comment - * - * @return guid of new comment. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String addCommentReply(String userId, - String elementGUID, - String commentGUID, - CommentProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "addCommentReply"; - final String commentGUIDParameter = "commentGUID"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/comments/{2}/replies"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameter, methodName); - - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - properties, - serverName, - userId, - commentGUID); - - return restResult.getGUID(); - } - - - /** - * Update an existing comment. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element that the comment is attached to (directly or indirectly). - * @param commentGUID unique identifier for the comment to change. - * @param properties comment properties - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void updateComment(String userId, - String elementGUID, - String commentGUID, - CommentProperties properties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "updateComment"; - final String elementGUIDParameter = "elementGUID"; - final String commentGUIDParameter = "commentGUID"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/comments/{3}/update"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); - invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - properties, - serverName, - userId, - elementGUID, - commentGUID); - } - - - /** - * Removes a comment added to the element by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element object. - * @param commentGUID unique identifier for the comment object. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the user does not have permission to perform this request. - */ - @Override - public void removeComment(String userId, - String elementGUID, - String commentGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "removeComment"; - final String elementGUIDParameter = "elementGUID"; - final String commentGUIDParameter = "commentGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/comments/{3}/remove"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); - invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - nullRequestBody, - serverName, - userId, - elementGUID, - commentGUID); - } - - - /** - * Return the requested comment. - * - * @param userId userId of user making request. - * @param commentGUID unique identifier for the comment object. - * @return comment properties - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the user does not have permission to perform this request. - */ - @Override - public CommentElement getComment(String userId, - String commentGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getComment"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/comments/{2}"; - final String guidParameter = "commentGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(commentGUID, guidParameter, methodName); - - CommentElementResponse restResult = restClient.callCommentElementGetRESTCall(methodName, - urlTemplate, - serverName, - userId, - commentGUID); - - return restResult.getElement(); - } - - - /** - * Return the comments attached to an element. - * - * @param userId userId of user making request. - * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * @return list of comments - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the user does not have permission to perform this request. - */ - @Override - public List getAttachedComments(String userId, - String elementGUID, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getAttachedComments"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/comments?startFrom={3}&pageSize={4}"; - final String guidParameter = "elementGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); - - CommentElementsResponse restResult = restClient.callCommentElementsGetRESTCall(methodName, - urlTemplate, - serverName, - userId, - elementGUID, - startFrom, - pageSize); - - return restResult.getElementList(); - } - - - /** - * Creates a new informal tag and returns the unique identifier for it. - * - * @param isPublic Flg to indicate whether the tag is a public or private tag. - * @param methodName name of calling method. - * @param userId userId of user making request. - * @param tagName name of the tag. - * @param tagDescription (optional) description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @return GUID for new tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - private String createTag(boolean isPublic, - String methodName, - String userId, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags"; - - invalidParameterHandler.validateUserId(userId, methodName); - - TagProperties tagProperties = new TagProperties(); - tagProperties.setIsPrivateTag(! isPublic); - tagProperties.setName(tagName); - tagProperties.setDescription(tagDescription); - - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - tagProperties, - serverName, - userId); - - return restResult.getGUID(); - } - - - /** - * Creates a new public informal tag and returns the unique identifier for it. - * - * @param userId userId of user making request. - * @param tagName name of the tag. - * @param tagDescription (optional) description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @return GUID for new tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String createPublicTag(String userId, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "createPublicTag"; - - return this.createTag(true, methodName, userId, tagName, tagDescription); - } - - - /** - * Creates a new private informal tag and returns the unique identifier for it. - * - * @param userId userId of user making request. - * @param tagName name of the tag. - * @param tagDescription (optional) description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @return GUID for new tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String createPrivateTag(String userId, - String tagName, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "createPrivateTag"; - - return this.createTag(false, methodName, userId, tagName, tagDescription); - } - - - /** - * Updates the description of an existing tag (either private or public). - * - * @param userId userId of user making request. - * @param tagGUID unique identifier for the tag. - * @param tagDescription description of the tag. Setting a description, particularly in a public tag - * makes the tag more valuable to other users and can act as an embryonic glossary term. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void updateTagDescription(String userId, - String tagGUID, - String tagDescription) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "updateTagDescription"; - final String guidParameter = "tagGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/{2}/update"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); - - InformalTagUpdateRequestBody tagRequestBody = new InformalTagUpdateRequestBody(); - tagRequestBody.setDescription(tagDescription); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - tagRequestBody, - serverName, - userId, - tagGUID); - } - - - /** - * Removes a tag from the repository. - * A private tag can be deleted by its creator and all the references are lost; - * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. - * - * @param userId userId of user making request. - * @param tagGUID unique id for the tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void deleteTag(String userId, - String tagGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "deleteTag"; - final String guidParameter = "tagGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/{2}/remove"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - nullRequestBody, - serverName, - userId, - tagGUID); - } - - - /** - * Return the tag for the supplied unique identifier (guid). - * - * @param userId userId of the user making the request. - * @param guid unique identifier of the tag. - * - * @return tag - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public InformalTagElement getTag(String userId, - String guid) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getTag"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/{2}"; - final String guidParameter = "guid"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(guid, guidParameter, methodName); - - InformalTagResponse restResult = restClient.callInformalTagGetRESTCall(methodName, - urlTemplate, - serverName, - userId, - guid); - - return restResult.getTag(); - } - - - /** - * Return the list of tags exactly matching the supplied name. - * - * @param userId the name of the calling user. - * @param tag name of tag. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List getTagsByName(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getTagsByName"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/by-name?startFrom={2}&pageSize={3}"; - final String nameParameter = "tag"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(tag, nameParameter, methodName); - - NameRequestBody requestBody = new NameRequestBody(); - - requestBody.setName(tag); - requestBody.setNameParameterName(nameParameter); - - InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - startFrom, - pageSize); - - return restResult.getTags(); - } - - - /** - * Return the list of the calling user's private tags exactly matching the supplied name. - * - * @param userId the name of the calling user. - * @param tag name of tag. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List getMyTagsByName(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getTagsByName"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/private/by-name?startFrom={2}&pageSize={3}"; - final String nameParameter = "tag"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(tag, nameParameter, methodName); - - NameRequestBody requestBody = new NameRequestBody(); - - requestBody.setName(tag); - requestBody.setNameParameterName(nameParameter); - - InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - startFrom, - pageSize); - - return restResult.getTags(); - } - - - /** - * Return the list of tags containing the supplied string in either the name or description. - * - * @param userId the name of the calling user. - * @param tag name of tag. This may include wild card characters. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List findTags(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "findTags"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/by-search-string?startFrom={2}&pageSize={3}"; - final String nameParameter = "tag"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(tag, nameParameter, methodName); - - SearchStringRequestBody requestBody = new SearchStringRequestBody(); - - requestBody.setSearchString(tag); - requestBody.setSearchStringParameterName(nameParameter); - - InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - startFrom, - pageSize); - - return restResult.getTags(); - } - - - /** - * Return the list of the calling user's private tags containing the supplied string in either the name or description. - * - * @param userId the name of the calling user. - * @param tag name of tag. This may include wild card characters. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return tag list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List findMyTags(String userId, - String tag, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "findTags"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/tags/private/by-search-string?startFrom={2}&pageSize={3}"; - final String nameParameter = "tag"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(tag, nameParameter, methodName); - - SearchStringRequestBody requestBody = new SearchStringRequestBody(); - - requestBody.setSearchString(tag); - requestBody.setSearchStringParameterName(nameParameter); - - InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - startFrom, - pageSize); - - return restResult.getTags(); - } - - - /** - * Adds a tag (either private of public) to an element. - * - * @param userId userId of user making request. - * @param elementGUID unique id for the element. - * @param tagGUID unique id of the tag. - * @param isPublic flag indicating whether the attachment of the tag is public or not - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem adding the element properties to the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void addTagToElement(String userId, - String elementGUID, - String tagGUID, - boolean isPublic) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "addTagToElement"; - final String elementGUIDParameterName = "elementGUID"; - final String tagGUIDParameterName = "tagGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/tags/{3}"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); - - FeedbackProperties requestBody = new FeedbackProperties(); - requestBody.setIsPublic(isPublic); - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - elementGUID, - tagGUID); - } - - - /** - * Removes a tag from the element that was added by this user. - * - * @param userId userId of user making request. - * @param elementGUID unique id for the element. - * @param tagGUID unique id for the tag. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem updating the element properties in the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void removeTagFromElement(String userId, - String elementGUID, - String tagGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "removeTagFromElement"; - final String elementGUIDParameterName = "elementGUID"; - final String tagGUIDParameterName = "tagGUID"; - - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/tags/{3}/remove"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - nullRequestBody, - serverName, - userId, - elementGUID, - tagGUID); - } - - - - /** - * Return the list of unique identifiers for elements that are linked to a specific tag either directly, or via one - * of its schema elements. An Element's GUID may appear multiple times in the results if it is tagged multiple times - * with the requested tag. - * - * @param userId the name of the calling user. - * @param tagGUID unique identifier of tag. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return element guid list - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List getElementsByTag(String userId, - String tagGUID, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getElementsByTag"; - final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/by-tag/{2}?startFrom={3}&pageSize={4}"; - final String tagGUIDParameterName = "tagGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); - - GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - urlTemplate, - serverName, - userId, - tagGUID, - startFrom, - pageSize); - - return restResult.getGUIDs(); - } -} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExchangeClientBase.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExchangeClientBase.java deleted file mode 100644 index 62c04dc07dc..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExchangeClientBase.java +++ /dev/null @@ -1,532 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.assetmanager.client; - -import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; -import org.odpi.openmetadata.accessservices.assetmanager.ffdc.AssetManagerErrorCode; -import org.odpi.openmetadata.accessservices.assetmanager.properties.*; -import org.odpi.openmetadata.accessservices.assetmanager.rest.*; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; -import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; - -import java.util.Date; -import java.util.Map; - -/** - * ExchangeClientBase provides the base class for the clients called XXXXExchangeClient - */ -public class ExchangeClientBase -{ - final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}"; - - String serverName; /* Initialized in constructor */ - String serverPlatformURLRoot; /* Initialized in constructor */ - - InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - AssetManagerRESTClient restClient; /* Initialized in constructor */ - - final NullRequestBody nullRequestBody = new NullRequestBody(); - - AuditLog auditLog = null; - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public ExchangeClientBase(String serverName, - String serverPlatformURLRoot, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Client Constructor"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - - this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot, auditLog); - - this.auditLog = auditLog; - } - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public ExchangeClientBase(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException - { - final String methodName = "Client Constructor"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - - this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @param auditLog logging destination - * - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public ExchangeClientBase(String serverName, - String serverPlatformURLRoot, - String userId, - String password, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Client Constructor"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - - this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); - - this.auditLog = auditLog; - } - - - /** - * Create a new client that is going to be used in an OMAG Server. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param restClient client that issues the REST API calls - * @param maxPageSize maximum number of results supported by this server - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public ExchangeClientBase(String serverName, - String serverPlatformURLRoot, - AssetManagerRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Client Constructor"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.setMaxPagingSize(maxPageSize); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - - this.restClient = restClient; - - this.auditLog = auditLog; - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public ExchangeClientBase(String serverName, - String serverPlatformURLRoot, - String userId, - String password) throws InvalidParameterException - { - final String methodName = "Client Constructor"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - - this.restClient = new AssetManagerRESTClient(serverName, serverPlatformURLRoot, userId, password); - } - - - /* ======================================================== - * Metadata correlation setup. - */ - - - /** - * Throw an exception because the asset manager's GUID has not been passed with an external identifier. - * - * @param externalIdentifier external identifier - * @param methodName calling method - * @throws InvalidParameterException resulting exception - */ - private void handleMissingScope(String externalIdentifier, - String methodName) throws InvalidParameterException - { - final String externalIdentifierParameterName = "externalIdentifier"; - - throw new InvalidParameterException(AssetManagerErrorCode.NO_SCOPE_FOR_EXTERNAL_ID.getMessageDefinition(externalIdentifier, - methodName), - this.getClass().getName(), - methodName, - externalIdentifierParameterName); - } - - - /** - * Set up the correlation properties for update. - * - * @param assetManagerGUID unique identifier of software server capability representing the caller - * @param assetManagerName unique name of software server capability representing the caller - * @param externalIdentifier unique identifier of the glossary in the external asset manager - * @param methodName calling method - * @return filled out correlation properties - * @throws InvalidParameterException missing external identifier - */ - MetadataCorrelationProperties getCorrelationProperties(String assetManagerGUID, - String assetManagerName, - String externalIdentifier, - String methodName) throws InvalidParameterException - { - MetadataCorrelationProperties correlationProperties = new MetadataCorrelationProperties(); - - if (assetManagerGUID != null) - { - correlationProperties.setAssetManagerGUID(assetManagerGUID); - correlationProperties.setAssetManagerName(assetManagerName); - correlationProperties.setExternalIdentifier(externalIdentifier); - - return correlationProperties; - } - else if (externalIdentifier != null) - { - handleMissingScope(externalIdentifier, methodName); - } - - return correlationProperties; - } - - - /** - * Set up the correlation properties for update. - * - * @param assetManagerGUID unique identifier of software server capability representing the caller - * @param assetManagerName unique name of software server capability representing the caller - * @param externalIdentifier unique identifier of the glossary in the external asset manager - * @param effectiveTime the time that the retrieved elements must be effective for - * @param methodName calling method - * @return filled out correlation properties - * @throws InvalidParameterException missing external identifier - */ - UpdateRequestBody getUpdateRequestBody(String assetManagerGUID, - String assetManagerName, - String externalIdentifier, - Date effectiveTime, - String methodName) throws InvalidParameterException - { - UpdateRequestBody requestBody = new UpdateRequestBody(); - - requestBody.setMetadataCorrelationProperties(getCorrelationProperties(assetManagerGUID, assetManagerName, externalIdentifier, methodName)); - requestBody.setEffectiveTime(effectiveTime); - - return requestBody; - } - - - /** - * Set up the correlation properties for request. - * - * @param assetManagerGUID unique identifier of software server capability representing the caller - * @param assetManagerName unique name of software server capability representing the caller - * @param externalIdentifier unique identifier of the element in the external asset manager - * @param externalIdentifierName name of property for the external identifier in the external asset manager - * @param externalIdentifierUsage optional usage description for the external identifier when calling the external asset manager - * @param externalIdentifierSource component that issuing this request. - * @param externalIdentifierKeyPattern pattern for the external identifier within the external asset manager (default is LOCAL_KEY) - * @param mappingProperties additional properties to help with the mapping of the elements in the external asset manager and open metadata - * @param methodName calling method - * @return filled out correlation properties - * @throws InvalidParameterException missing external identifier - */ - MetadataCorrelationProperties getCorrelationProperties(String assetManagerGUID, - String assetManagerName, - String externalIdentifier, - String externalIdentifierName, - String externalIdentifierUsage, - String externalIdentifierSource, - KeyPattern externalIdentifierKeyPattern, - Map mappingProperties, - String methodName) throws InvalidParameterException - { - MetadataCorrelationProperties correlationProperties = new MetadataCorrelationProperties(); - - if (assetManagerGUID != null) - { - correlationProperties.setAssetManagerGUID(assetManagerGUID); - correlationProperties.setAssetManagerName(assetManagerName); - - if (externalIdentifier != null) - { - correlationProperties.setKeyPattern(KeyPattern.LOCAL_KEY); - correlationProperties.setExternalIdentifier(externalIdentifier); - correlationProperties.setExternalIdentifierName(externalIdentifierName); - correlationProperties.setExternalIdentifierUsage(externalIdentifierUsage); - correlationProperties.setExternalIdentifierSource(externalIdentifierSource); - correlationProperties.setKeyPattern(externalIdentifierKeyPattern); - correlationProperties.setMappingProperties(mappingProperties); - } - } - else if (externalIdentifier != null) - { - handleMissingScope(externalIdentifier, methodName); - } - - return correlationProperties; - } - - - - /** - * Set up the correlation properties for request. - * - * @param assetManagerGUID unique identifier of software server capability representing the caller - * @param assetManagerName unique name of software server capability representing the caller - * @param externalIdentifierProperties optional properties used to define an external identifier - * @param methodName calling method - * @return filled out correlation properties - * @throws InvalidParameterException missing external identifier - */ - MetadataCorrelationProperties getCorrelationProperties(String assetManagerGUID, - String assetManagerName, - ExternalIdentifierProperties externalIdentifierProperties, - String methodName) throws InvalidParameterException - { - MetadataCorrelationProperties correlationProperties = new MetadataCorrelationProperties(externalIdentifierProperties); - - if (assetManagerGUID != null) - { - correlationProperties.setAssetManagerGUID(assetManagerGUID); - correlationProperties.setAssetManagerName(assetManagerName); - } - else if ((externalIdentifierProperties != null) && (externalIdentifierProperties.getExternalIdentifier() != null)) - { - handleMissingScope(externalIdentifierProperties.getExternalIdentifier(), methodName); - } - - return correlationProperties; - } - - - /** - * Return the asset manager identifiers packaged in an appropriate request body (or null if assetManagerGUID is null). - * - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique name for the asset manager - * @return request body - */ - AssetManagerIdentifiersRequestBody getAssetManagerIdentifiersRequestBody(String assetManagerGUID, - String assetManagerName) - { - AssetManagerIdentifiersRequestBody requestBody = new AssetManagerIdentifiersRequestBody(); - - if (assetManagerGUID != null) - { - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - } - - return requestBody; - } - - - - /** - * Return the asset manager identifiers packaged in an appropriate request body. - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique name for the asset manager - * @param effectiveTime the time that the retrieved elements must be effective for - * @return request body - */ - EffectiveTimeQueryRequestBody getEffectiveTimeQueryRequestBody(String assetManagerGUID, - String assetManagerName, - Date effectiveTime) - { - EffectiveTimeQueryRequestBody requestBody = new EffectiveTimeQueryRequestBody(); - - if (assetManagerGUID != null) - { - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - } - - requestBody.setEffectiveTime(effectiveTime); - - return requestBody; - } - - - - /** - * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. - * - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique name for the asset manager - * @param effectiveTime the time that the retrieved elements must be effective for - * @return request body - */ - RelationshipRequestBody getRelationshipRequestBody(String assetManagerGUID, - String assetManagerName, - Date effectiveTime, - RelationshipProperties relationshipProperties) - { - RelationshipRequestBody requestBody = new RelationshipRequestBody(); - - if (assetManagerGUID != null) - { - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - } - - requestBody.setEffectiveTime(effectiveTime); - requestBody.setProperties(relationshipProperties); - - return requestBody; - } - - - /** - * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. - * - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique name for the asset manager - * @param name name to search for - * @param nameParameterName parameter name - * @param effectiveTime the time that the retrieved elements must be effective for - * @return request body - */ - NameRequestBody getNameRequestBody(String assetManagerGUID, - String assetManagerName, - String name, - String nameParameterName, - Date effectiveTime) - { - NameRequestBody requestBody = new NameRequestBody(); - - if (assetManagerGUID != null) - { - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - } - - requestBody.setName(name); - requestBody.setNameParameterName(nameParameterName); - requestBody.setEffectiveTime(effectiveTime); - - return requestBody; - } - - - /** - * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. - * - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique name for the asset manager - * @param name name to search for - * @param effectiveTime the time that the retrieved elements must be effective for - * @param methodName calling method - * @return request body - * @throws InvalidParameterException blank name - */ - NameRequestBody getNameRequestBody(String assetManagerGUID, - String assetManagerName, - String name, - Date effectiveTime, - String methodName) throws InvalidParameterException - { - final String nameParameterName = "name"; - - invalidParameterHandler.validateName(name, nameParameterName, methodName); - - return getNameRequestBody(assetManagerGUID, assetManagerName, name, nameParameterName, effectiveTime); - } - - - /** - * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. - * - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique qualifiedName for the asset manager - * @param qualifiedName qualifiedName to search for - * @param effectiveTime the time that the retrieved elements must be effective for - * @return request body - */ - NameRequestBody getQualifiedNameRequestBody(String assetManagerGUID, - String assetManagerName, - String qualifiedName, - Date effectiveTime) - { - final String nameParameterName = "qualifiedName"; - - return getNameRequestBody(assetManagerGUID, assetManagerName, qualifiedName, nameParameterName, effectiveTime); - } - - - /** - * Return the asset manager identifiers packaged with relevant properties in an appropriate request body. - * - * @param assetManagerGUID unique identifier for the asset manager - * @param assetManagerName unique name for the asset manager - * @param searchString string to find in the properties - * @param effectiveTime the time that the retrieved elements must be effective for - * @param methodName calling method - * @return request body - * @throws InvalidParameterException blank name - */ - SearchStringRequestBody getSearchStringRequestBody(String assetManagerGUID, - String assetManagerName, - String searchString, - Date effectiveTime, - String methodName) throws InvalidParameterException - { - final String searchStringParameterName = "searchString"; - - invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); - - SearchStringRequestBody requestBody = new SearchStringRequestBody(); - - if (assetManagerGUID != null) - { - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - } - - requestBody.setSearchString(searchString); - requestBody.setSearchStringParameterName(searchStringParameterName); - requestBody.setEffectiveTime(effectiveTime); - - return requestBody; - } -} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/StewardshipExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/StewardshipExchangeClient.java deleted file mode 100644 index af8124af03f..00000000000 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/StewardshipExchangeClient.java +++ /dev/null @@ -1,303 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.assetmanager.client; - -import org.odpi.openmetadata.accessservices.assetmanager.api.StewardshipExchangeInterface; -import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; -import org.odpi.openmetadata.accessservices.assetmanager.properties.SecurityTagsProperties; -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.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; - -import java.util.Date; - - -/** - * StewardshipExchangeClient is the client for todos and tasks. - */ -public class StewardshipExchangeClient extends ExchangeClientBase implements StewardshipExchangeInterface -{ - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public StewardshipExchangeClient(String serverName, - String serverPlatformURLRoot, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, auditLog); - } - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public StewardshipExchangeClient(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @param auditLog logging destination - * - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public StewardshipExchangeClient(String serverName, - String serverPlatformURLRoot, - String userId, - String password, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, userId, password, auditLog); - } - - - /** - * Create a new client that is going to be used in an OMAG Server. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param restClient client that issues the REST API calls - * @param maxPageSize maximum number of results supported by this server - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public StewardshipExchangeClient(String serverName, - String serverPlatformURLRoot, - AssetManagerRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST services - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public StewardshipExchangeClient(String serverName, - String serverPlatformURLRoot, - String userId, - String password) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, userId, password); - } - - - /** - * Classify the element with the Memento classification to indicate that it has been logically deleted for by lineage requests. - * - * @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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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 void addMementoClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Remove the memento designation from the 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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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 void clearMementoClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Classify the element with the Incomplete classification to indicate that it has more details to come. - * - * @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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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 void addIncompleteClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Remove the Incomplete designation from the 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 metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager - * @param effectiveTime optional date for effective time of the query. Null means any effective time - * @param forLineage return elements marked with the Memento classification? - * @param forDuplicateProcessing do not merge elements marked as duplicates? - * - * @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 void clearIncompleteClassification(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Add or replace the security tags for an element. - * - * @param userId calling user - * @param elementGUID element to link it to - its type must inherit from Referenceable. - * @param properties details of the security tags - * - * @throws InvalidParameterException element not known, null userId or guid - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - @Override - public void addSecurityTags(String userId, - String elementGUID, - SecurityTagsProperties properties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "addSecurityTags"; - final String elementGUIDParameter = "elementGUID"; - final String propertiesParameter = "properties"; - final String assetURLTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/security-tags"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); - invalidParameterHandler.validateObject(properties, propertiesParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, assetURLTemplate, properties, serverName, userId, elementGUID); - } - - - /** - * Remove the security tags classification from an element. - * - * @param userId calling user - * @param elementGUID element where the security tags need to be removed. - * - * @throws InvalidParameterException asset or element not known, null userId or guid - * @throws PropertyServerException problem accessing property server - * @throws UserNotAuthorizedException security access problem - */ - @Override - public void removeSecurityTags(String userId, - String elementGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - final String methodName = "removeSecurityTags"; - final String elementGUIDParameter = "elementGUID"; - final String assetURLTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/elements/{2}/security-tags/remove"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); - - restClient.callVoidPostRESTCall(methodName, assetURLTemplate, nullRequestBody, serverName, userId, elementGUID); - } -} 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 new file mode 100644 index 00000000000..16b8007fdf7 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/CollaborationExchangeClient.java @@ -0,0 +1,2177 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; + +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.CollaborationExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.InformalTagProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ArchiveRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossaryElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.GlossarySearchStringRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NameRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteLogElementResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.NoteLogElementsResponse; +import org.odpi.openmetadata.accessservices.assetmanager.rest.SearchStringRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDListResponse; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +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 java.util.Date; +import java.util.List; + + +/** + * CollaborationExchangeClient is the client for managing comments, ratings, likes and tags. + */ +public class CollaborationExchangeClient extends AssetManagerBaseClient implements CollaborationExchangeInterface +{ + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationExchangeClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationExchangeClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationExchangeClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationExchangeClient(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationExchangeClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Adds a star rating and optional review text to the element. If the user has already attached + * a rating then the original one is over-ridden. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element. + * @param isPublic is this visible to other people + * @param properties properties of the rating + * @return unique identifier of the rating + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String addRatingToElement(String userId, + String elementGUID, + boolean isPublic, + RatingProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "addRatingToElement"; + final String guidParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/ratings?isPublic={3}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); + + GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + properties, + serverName, + userId, + elementGUID, + isPublic); + + return response.getGUID(); + } + + + /** + * Removes of a review that was added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the attached element. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void removeRatingFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "removeRatingFromElement"; + final String guidParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/ratings/remove"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + nullRequestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Adds a "LikeProperties" to the element. + * + * @param userId userId of user making request + * @param elementGUID unique identifier for the element + * @param isPublic is this visible to other people + * @param properties indicates whether the feedback should be shared or only be visible to the originating user + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void addLikeToElement(String userId, + String elementGUID, + boolean isPublic, + LikeProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "addLikeToElement"; + final String guidParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/likes?isPublic={3}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + properties, + serverName, + userId, + elementGUID, + isPublic); + } + + + /** + * Removes a "LikeProperties" added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the like object. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void removeLikeFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "removeLikeFromElement"; + final String guidParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/likes/remove"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + nullRequestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Adds a comment to the element. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier for the element. + * @param externalIdentifierProperties optional properties used to define an external identifier for the comment. + * @param isPublic is this comment visible to other people. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String addCommentToElement(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String elementGUID, + ExternalIdentifierProperties externalIdentifierProperties, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "addCommentToElement"; + final String guidParameterName = "elementGUID"; + final String propertiesParameterName = "properties"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/comments"; + + return super.createFeedbackWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + elementGUID, + guidParameterName, + isPublic, + properties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Adds a comment to another comment. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param commentGUID unique identifier for an existing comment. Used to add a reply to a comment. + * @param externalIdentifierProperties optional properties used to define an external identifier for the comment. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String addCommentReply(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String commentGUID, + ExternalIdentifierProperties externalIdentifierProperties, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "addCommentReply"; + final String commentGUIDParameter = "commentGUID"; + final String propertiesParameterName = "properties"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/{2}/replies"; + + return super.createFeedbackWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + commentGUID, + commentGUIDParameter, + isPublic, + properties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Update an existing comment. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param commentGUID unique identifier for the comment to change. + * @param externalIdentifier unique identifier of the comment in the external asset manager + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param properties properties of the comment + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void updateComment(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + String externalIdentifier, + boolean isMergeUpdate, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "updateComment"; + final String commentGUIDParameter = "commentGUID"; + final String propertiesParameterName = "properties"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/{2}/update"; + + super.updateFeedback(userId, + assetManagerGUID, + assetManagerName, + commentGUID, + commentGUIDParameter, + externalIdentifier, + isMergeUpdate, + isPublic, + properties, + propertiesParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @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 questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param properties is this visible to other people + * @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? + * + * @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 void setupAcceptedAnswer(String userId, + String assetManagerGUID, + String assetManagerName, + String questionCommentGUID, + String answerCommentGUID, + FeedbackProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupAcceptedAnswer"; + final String questionCommentGUIDParameterName = "questionCommentGUID"; + final String answerCommentGUIDParameterName = "answerCommentGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/questions/{2}/answers/{3}"; + + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + questionCommentGUID, + questionCommentGUIDParameterName, + properties, + answerCommentGUID, + answerCommentGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @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 questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @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? + * + * @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 void clearAcceptedAnswer(String userId, + String assetManagerGUID, + String assetManagerName, + String questionCommentGUID, + String answerCommentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearAcceptedAnswer"; + final String questionCommentGUIDParameterName = "questionCommentGUID"; + final String answerCommentGUIDParameterName = "answerCommentGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/questions/{2}/answers/{3}/remove"; + + super.clearRelationship(userId, + assetManagerGUID, + assetManagerName, + questionCommentGUID, + questionCommentGUIDParameterName, + answerCommentGUID, + answerCommentGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Removes a comment added to the element. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param commentGUID unique identifier for the comment object. + * @param externalIdentifier unique identifier of the comment in the external asset manager + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + @Override + public void removeComment(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "removeComment"; + final String commentGUIDParameter = "commentGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/{2}/remove"; + + super.removeReferenceable(userId, + assetManagerGUID, + assetManagerName, + commentGUID, + commentGUIDParameter, + externalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Return the requested comment. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param commentGUID unique identifier for the comment object. + * @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 comment properties + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + @Override + public CommentElement getComment(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getComment"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/{2}?forLineage={3}&forDuplicateProcessing={4}"; + final String guidParameter = "commentGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(commentGUID, guidParameter, methodName); + + CommentElementResponse restResult = restClient.callCommentElementPostRESTCall(methodName, + urlTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, + assetManagerName, + effectiveTime), + serverName, + userId, + commentGUID, + forLineage, + forDuplicateProcessing); + + return restResult.getElement(); + } + + + /** + * Return the comments attached to an element. + * + * @param userId userId of user making request. + * @param assetManagerGUID unique identifier of software capability representing the caller + * @param assetManagerName unique name of software capability representing the caller + * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). + * @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 comments + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + @Override + public List getAttachedComments(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getAttachedComments"; + final String guidParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/comments/retrieve?startFrom={3}&pageSize={4}&forLineage={}&forLineage={5}&forDuplicateProcessing={6}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, guidParameter, methodName); + + CommentElementsResponse restResult = restClient.callCommentElementsPostRESTCall(methodName, + urlTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), + serverName, + userId, + elementGUID, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of comment metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 searchString string to find in the properties + * @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 findComments(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findGlossaries"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName);requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + requestBody.setEffectiveTime(effectiveTime); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/comments/by-search-string?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + CommentElementsResponse restResult = restClient.callCommentElementsPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Creates a new informal tag and returns the unique identifier for it. + * + * @param userId userId of user making request. + * @param properties name of the tag and (optional) description. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic note. + * + * @return GUID for new tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String createInformalTag(String userId, + InformalTagProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "createInformalTag"; + final String propertiesParameterName = "properties"; + final String nameParameterName = "properties.tagName"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getName(), nameParameterName, methodName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + properties, + serverName, + userId); + + return restResult.getGUID(); + } + + + /** + * Updates the description of an existing tag (either private or public). + * + * @param userId userId of user making request. + * @param tagGUID unique identifier for the tag. + * @param tagDescription description of the tag. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic glossary term. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void updateTagDescription(String userId, + String tagGUID, + String tagDescription) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "updateTagDescription"; + final String guidParameter = "tagGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/{2}/update"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); + + InformalTagUpdateRequestBody tagRequestBody = new InformalTagUpdateRequestBody(); + tagRequestBody.setDescription(tagDescription); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + tagRequestBody, + serverName, + userId, + tagGUID); + } + + + /** + * Removes a tag from the repository. + * A private tag can be deleted by its creator and all the references are lost; + * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. + * + * @param userId userId of user making request. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void deleteTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "deleteTag"; + final String guidParameter = "tagGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/{2}/remove"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + nullRequestBody, + serverName, + userId, + tagGUID); + } + + + /** + * Return the tag for the supplied unique identifier (guid). + * + * @param userId userId of the user making the request. + * @param tagGUID unique identifier of the tag. + * + * @return tag + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public InformalTagElement getTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getTag"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/{2}"; + final String guidParameter = "guid"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); + + InformalTagResponse restResult = restClient.callInformalTagGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + tagGUID); + + return restResult.getTag(); + } + + + /** + * Return the list of tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List getTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getTagsByName"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/by-name?startFrom={2}&pageSize={3}"; + final String nameParameter = "tag"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(tag, nameParameter, methodName); + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setName(tag); + requestBody.setNameParameterName(nameParameter); + + InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + pageSize); + + return restResult.getTags(); + } + + + /** + * Return the list of the calling user's private tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List getMyTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getTagsByName"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/private/by-name?startFrom={2}&pageSize={3}"; + final String nameParameter = "tag"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(tag, nameParameter, methodName); + + NameRequestBody requestBody = new NameRequestBody(); + + requestBody.setName(tag); + requestBody.setNameParameterName(nameParameter); + + InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + pageSize); + + return restResult.getTags(); + } + + + /** + * Return the list of tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List findTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "findTags"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/by-search-string?startFrom={2}&pageSize={3}"; + final String nameParameter = "tag"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(tag, nameParameter, methodName); + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setSearchString(tag); + requestBody.setSearchStringParameterName(nameParameter); + + InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + pageSize); + + return restResult.getTags(); + } + + + /** + * Return the list of the calling user's private tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List findMyTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "findTags"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/tags/private/by-search-string?startFrom={2}&pageSize={3}"; + final String nameParameter = "tag"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(tag, nameParameter, methodName); + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + + requestBody.setSearchString(tag); + requestBody.setSearchStringParameterName(nameParameter); + + InformalTagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + pageSize); + + return restResult.getTags(); + } + + + /** + * Adds a tag (either private of public) to an element. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id of the tag. + * @param isPublic flag indicating whether the attachment of the tag is public or not + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void addTagToElement(String userId, + String elementGUID, + String tagGUID, + boolean isPublic) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "addTagToElement"; + final String elementGUIDParameterName = "elementGUID"; + final String tagGUIDParameterName = "tagGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/tags/{3}"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); + + FeedbackProperties requestBody = new FeedbackProperties(); + requestBody.setIsPublic(isPublic); + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + tagGUID); + } + + + /** + * Removes a tag from the element that was added by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void removeTagFromElement(String userId, + String elementGUID, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "removeTagFromElement"; + final String elementGUIDParameterName = "elementGUID"; + final String tagGUIDParameterName = "tagGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/tags/{3}/remove"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + nullRequestBody, + serverName, + userId, + elementGUID, + tagGUID); + } + + + + /** + * Return the list of unique identifiers for elements that are linked to a specific tag either directly, or via one + * of its schema elements. An Element's GUID may appear multiple times in the results if it is tagged multiple times + * with the requested tag. + * + * @param userId the name of the calling user. + * @param tagGUID unique identifier of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return element guid list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List getElementsByTag(String userId, + String tagGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getElementsByTag"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/by-tag/{2}?startFrom={3}&pageSize={4}"; + final String tagGUIDParameterName = "tagGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); + + GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + tagGUID, + startFrom, + pageSize); + + return restResult.getGUIDs(); + } + + + /* ===================================================================================================================== + * A note log maintains an ordered list of notes. It can be used to support release note, blogs and similar + * broadcast information. Notelogs are typically maintained by the owners/stewards of an element. + */ + + /** + * Create a new metadata element to represent a note log and attach it to an element (if supplied). + * Any supplied element becomes the note log's anchor, causing the note log to be deleted if/when the element is deleted. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier of the element where the note log is located + * @param externalIdentifierProperties optional properties used to define an external identifier for the note log + * @param noteLogProperties properties about the note log to store + * @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 unique identifier of the new note log + * + * @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 String createNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String elementGUID, + ExternalIdentifierProperties externalIdentifierProperties, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createNoteLog"; + final String guidParameterName = "elementGUID"; + final String propertiesParameterName = "noteLogProperties"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/note-logs"; + + return super.createReferenceableWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + elementGUID, + guidParameterName, + noteLogProperties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Create a new metadata element to represent a note log using an existing metadata element as a template. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param elementGUID unique identifier of the element where the note log is located + * @param templateGUID unique identifier of the metadata element to copy + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param templateProperties properties that override the template + * + * @return unique identifier of the new note log + * + * @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 String createNoteLogFromTemplate(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String elementGUID, + String templateGUID, + ExternalIdentifierProperties externalIdentifierProperties, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createNoteLogFromTemplate"; + final String guidParameterName = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/note-logs/from-template/{3}"; + + return super.createReferenceableFromTemplateWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + elementGUID, + guidParameterName, + templateGUID, + templateProperties, + externalIdentifierProperties, + urlTemplate, + methodName); + } + + + /** + * Update the metadata element representing a note log. + * + * @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 noteLogGUID unique identifier of the metadata element to update + * @param noteLogExternalIdentifier unique identifier of the note log in the external asset manager + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this element visible to other people. + * @param noteLogProperties new properties for the metadata element + * @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? + * + * @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 void updateNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + String noteLogExternalIdentifier, + boolean isMergeUpdate, + boolean isPublic, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateNoteLog"; + final String noteLogGUIDParameterName = "noteLogGUID"; + final String propertiesParameterName = "noteLogProperties"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/update"; + + super.updateFeedback(userId, + assetManagerGUID, + assetManagerName, + noteLogGUID, + noteLogGUIDParameterName, + noteLogExternalIdentifier, + isMergeUpdate, + isPublic, + noteLogProperties, + propertiesParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the metadata element representing a note log. + * + * @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 noteLogGUID unique identifier of the metadata element to remove + * @param noteLogExternalIdentifier unique identifier of the note log in the external asset manager + * @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? + * + * @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 void removeNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + String noteLogExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeNoteLog"; + final String noteLogGUIDParameterName = "noteLogGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/remove"; + + super.removeReferenceable(userId, + assetManagerGUID, + assetManagerName, + noteLogGUID, + noteLogGUIDParameterName, + noteLogExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 searchString string to find in the properties + * @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 findNoteLogs(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findNoteLogs"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + requestBody.setEffectiveTime(effectiveTime); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/by-search-string?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + NoteLogElementsResponse restResult = restClient.callNoteLogElementsPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @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 name name to search for + * @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 getNoteLogsByName(String userId, + String assetManagerGUID, + String assetManagerName, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNoteLogsByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + NameRequestBody requestBody = new NameRequestBody(); + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setName(name); + requestBody.setNameParameterName(nameParameterName); + requestBody.setEffectiveTime(effectiveTime); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/by-name?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + NoteLogElementsResponse restResult = restClient.callNoteLogElementsPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the note log metadata element with the supplied unique identifier. + * + * @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 noteLogGUID unique identifier of the requested metadata element + * @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 requested metadata element + * + * @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 NoteLogElement getNoteLogByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNoteLogByGUID"; + final String guidParameterName = "noteLogGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteLogGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/retrieve?forLineage={3}&forDuplicateProcessing={4}"; + + NoteLogElementResponse restResult = restClient.callNoteLogElementPostRESTCall(methodName, + urlTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, + assetManagerName, + effectiveTime), + serverName, + userId, + noteLogGUID, + forLineage, + forDuplicateProcessing); + + return restResult.getElement(); + } + + + /* =============================================================================== + * A element typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogGUID unique identifier of the element where the note is located + * @param externalIdentifierProperties optional properties used to define an external identifier for the note + * @param noteProperties properties for the note + * @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 unique identifier of the new metadata element for the note + * + * @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 String createNote(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String noteLogGUID, + ExternalIdentifierProperties externalIdentifierProperties, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createNote"; + final String guidParameterName = "noteLogGUID"; + final String propertiesParameterName = "noteProperties"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/notes"; + + return super.createReferenceableWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + noteLogGUID, + guidParameterName, + noteProperties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + + /** + * Create a new metadata element to represent a note using an existing metadata element as a template. + * + * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param noteLogGUID unique identifier of the element where the note is located + * @param templateGUID unique identifier of the metadata element to copy + * @param externalIdentifierProperties optional properties used to define an external identifier + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element for the note + * + * @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 String createNoteFromTemplate(String userId, + String assetManagerGUID, + String assetManagerName, + boolean assetManagerIsHome, + String noteLogGUID, + String templateGUID, + ExternalIdentifierProperties externalIdentifierProperties, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "createNoteFromTemplate"; + final String guidParameterName = "noteLogGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/notes/from-template/{3}"; + + return super.createReferenceableFromTemplateWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + noteLogGUID, + guidParameterName, + templateGUID, + templateProperties, + externalIdentifierProperties, + urlTemplate, + methodName); + } + + + /** + * Update the properties of the metadata element representing a note. + * + * @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 noteGUID unique identifier of the note to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param noteProperties new properties for the note + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @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? + * + * @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 void updateNote(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + boolean isMergeUpdate, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "updateNote"; + final String noteGUIDParameterName = "noteGUID"; + final String propertiesParameterName = "noteProperties"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/update"; + + super.updateReferenceable(userId, + assetManagerGUID, + assetManagerName, + noteGUID, + noteGUIDParameterName, + noteExternalIdentifier, + isMergeUpdate, + noteProperties, + propertiesParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Undo the last update to the note. + * + * @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 noteGUID unique identifier of the metadata element to update + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @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 recovered note + * + * @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 NoteElement undoNoteUpdate(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "undoNoteUpdate"; + final String noteGUIDParameterName = "noteGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteGUID, noteGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/undo&forLineage={3}&forDuplicateProcessing={4}"; + + NoteElementResponse response = restClient.callNoteElementPostRESTCall(methodName, + urlTemplate, + getUpdateRequestBody(assetManagerGUID, assetManagerName, noteExternalIdentifier, effectiveTime, methodName), + serverName, + userId, + noteGUID, + forLineage, + forDuplicateProcessing); + + return response.getElement(); + } + + + /** + * Archive the metadata element representing a note. This removes it from normal access. However, it is still available + * for lineage requests. + * + * @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 noteGUID unique identifier of the metadata element to archive + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @param archiveProperties option parameters about the archive process + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void archiveNote(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + ArchiveProperties archiveProperties, + Date effectiveTime, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "archiveNote"; + final String noteGUIDParameterName = "noteGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteGUID, noteGUIDParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/archive&forLineage={3}&forDuplicateProcessing={4}"; + + ArchiveRequestBody requestBody = new ArchiveRequestBody(); + requestBody.setElementProperties(archiveProperties); + requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, + assetManagerName, + noteExternalIdentifier, + methodName)); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + noteGUID, + forDuplicateProcessing); + } + + + /** + * Remove the metadata element representing a note. + * + * @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 noteGUID unique identifier of the metadata element to remove + * @param noteExternalIdentifier unique identifier of the note in the external asset manager + * @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? + * + * @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 void removeNote(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + String noteExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeNote"; + final String noteGUIDParameterName = "noteGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/remove"; + + super.removeReferenceable(userId, + assetManagerGUID, + assetManagerName, + noteGUID, + noteGUIDParameterName, + noteExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 to query + * @param searchString string to find in the properties + * @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 findNotes(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "findNotes"; + final String searchStringParameterName = "searchString"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + SearchStringRequestBody requestBody = new SearchStringRequestBody(); + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setSearchString(searchString); + requestBody.setSearchStringParameterName(searchStringParameterName); + requestBody.setEffectiveTime(effectiveTime); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/by-search-string?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + NoteElementsResponse restResult = restClient.callNoteElementsPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of notes associated with a note log. + * + * @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 noteLogGUID unique identifier of the note log of interest + * @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 associated 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 getNotesForNoteLog(String userId, + String assetManagerGUID, + String assetManagerName, + String noteLogGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNotesForNoteLog"; + final String guidParameterName = "noteLogGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteLogGUID, guidParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/{2}/notes/retrieve?startFrom={3}&pageSize={4}&forLineage={5}&forDuplicateProcessing={6}"; + + NoteElementsResponse restResult = restClient.callNoteElementsPostRESTCall(methodName, + urlTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), + serverName, + userId, + noteLogGUID, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the list of note metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @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 to query + * @param name name to search for + * @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 getNotesByName(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNotesByName"; + final String nameParameterName = "name"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(name, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + NameRequestBody requestBody = new NameRequestBody(); + requestBody.setAssetManagerGUID(assetManagerGUID); + requestBody.setAssetManagerName(assetManagerName); + requestBody.setName(name); + requestBody.setNameParameterName(nameParameterName); + requestBody.setEffectiveTime(effectiveTime); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/by-name?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; + + NoteElementsResponse restResult = restClient.callNoteElementsPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize, + forLineage, + forDuplicateProcessing); + + return restResult.getElementList(); + } + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @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 noteGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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 NoteElement getNoteByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String noteGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getNoteByGUID"; + final String guidParameterName = "noteGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(noteGUID, guidParameterName, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/note-logs/notes/{2}/retrieve?forLineage={3}&forDuplicateProcessing={4}"; + + NoteElementResponse restResult = restClient.callNoteElementPostRESTCall(methodName, + urlTemplate, + getEffectiveTimeQueryRequestBody(assetManagerGUID, + assetManagerName, + effectiveTime), + serverName, + userId, + noteGUID, + forLineage, + forDuplicateProcessing); + + return restResult.getElement(); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ConnectionExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ConnectionExchangeClient.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ConnectionExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ConnectionExchangeClient.java index bebb5d515f3..b663cc1a54e 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ConnectionExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ConnectionExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.ConnectionExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.ConnectionExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectionElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectorTypeElement; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/DataAssetExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/DataAssetExchangeClient.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/DataAssetExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/DataAssetExchangeClient.java index f568938649e..3de4f863367 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/DataAssetExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/DataAssetExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.DataAssetExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.DataAssetExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataAssetElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelationshipElement; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExchangeClientBase.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExchangeClientBase.java new file mode 100644 index 00000000000..56fdb8a1f87 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExchangeClientBase.java @@ -0,0 +1,121 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; + +import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.ffdc.AssetManagerErrorCode; +import org.odpi.openmetadata.accessservices.assetmanager.properties.*; +import org.odpi.openmetadata.accessservices.assetmanager.rest.*; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; + +import java.util.Date; +import java.util.Map; + +/** + * ExchangeClientBase provides the base class for the clients called XXXXExchangeClient + */ +public class ExchangeClientBase extends AssetManagerBaseClient +{ + + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ExchangeClientBase(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ExchangeClientBase(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ExchangeClientBase(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ExchangeClientBase(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ExchangeClientBase(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExternalAssetManagerClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExternalAssetManagerClient.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExternalAssetManagerClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExternalAssetManagerClient.java index 6bce899adb2..6546eee7dad 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExternalAssetManagerClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExternalAssetManagerClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.AssetManagerInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.ExternalAssetManagerInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; @@ -23,7 +23,7 @@ /** * ExternalAssetManagerClient is the client for setting up the SoftwareServerCapabilities that represent asset managers. */ -public class ExternalAssetManagerClient implements AssetManagerInterface +public class ExternalAssetManagerClient implements ExternalAssetManagerInterface { private final String assetManagerGUIDParameterName = "assetManagerGUID"; private final String assetManagerNameParameterName = "assetManagerName"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExternalReferenceExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExternalReferenceExchangeClient.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExternalReferenceExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExternalReferenceExchangeClient.java index 56a2e43e66d..8a56b97adbb 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ExternalReferenceExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ExternalReferenceExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.ExternalReferencesInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.ExternalReferencesInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceLinkElement; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GlossaryExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java similarity index 81% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GlossaryExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java index f7f83ed0caa..a5dcfe46b78 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GlossaryExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GlossaryExchangeClient.java @@ -1,9 +1,10 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.GlossaryExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.GlossaryExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; @@ -20,7 +21,7 @@ /** * GlossaryExchangeClient is the client for managing resources from a glossary. */ -public class GlossaryExchangeClient extends ExchangeClientBase implements GlossaryExchangeInterface +public class GlossaryExchangeClient extends AssetManagerBaseClient implements GlossaryExchangeInterface { /** * Create a new client with no authentication embedded in the HTTP request. @@ -131,6 +132,7 @@ public GlossaryExchangeClient(String serverName, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryProperties properties to store * @@ -144,6 +146,7 @@ public GlossaryExchangeClient(String serverName, public String createGlossary(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, GlossaryProperties glossaryProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -151,28 +154,18 @@ public String createGlossary(String userId, { final String methodName = "createGlossary"; final String propertiesParameterName = "glossaryProperties"; - final String qualifiedNameParameterName = "glossaryProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateObject(glossaryProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(glossaryProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - - GlossaryRequestBody requestBody = new GlossaryRequestBody(); - requestBody.setElementProperties(glossaryProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - externalIdentifierProperties, - methodName)); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId); - - return restResult.getGUID(); + return super.createReferenceable(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + externalIdentifierProperties, + glossaryProperties, + propertiesParameterName, + urlTemplate, + methodName); } @@ -186,6 +179,7 @@ public String createGlossary(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -200,39 +194,26 @@ public String createGlossary(String userId, public String createGlossaryFromTemplate(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - final String methodName = "createGlossaryFromTemplate"; - final String templateGUIDParameterName = "templateGUID"; - final String propertiesParameterName = "templateProperties"; - final String qualifiedNameParameterName = "templateProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); - invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - - TemplateRequestBody requestBody = new TemplateRequestBody(); - requestBody.setElementProperties(templateProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - externalIdentifierProperties, - methodName)); + final String methodName = "createGlossaryFromTemplate"; final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/from-template/{2}"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - templateGUID); - - return restResult.getGUID(); + return super.createReferenceableFromTemplate(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + templateGUID, + templateProperties, + externalIdentifierProperties, + urlTemplate, + methodName); } @@ -244,7 +225,11 @@ public String createGlossaryFromTemplate(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to update * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param glossaryProperties new properties for this element + * @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? * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -256,35 +241,34 @@ public void updateGlossary(String userId, String assetManagerName, String glossaryGUID, String glossaryExternalIdentifier, - GlossaryProperties glossaryProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + boolean isMergeUpdate, + GlossaryProperties glossaryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "updateGlossary"; final String glossaryGUIDParameterName = "glossaryGUID"; final String propertiesParameterName = "glossaryProperties"; - final String qualifiedNameParameterName = "glossaryProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); - invalidParameterHandler.validateObject(glossaryProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(glossaryProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - GlossaryRequestBody requestBody = new GlossaryRequestBody(); - requestBody.setElementProperties(glossaryProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryExternalIdentifier, - methodName)); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/update"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryGUID); + super.updateReferenceable(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryGUIDParameterName, + glossaryExternalIdentifier, + isMergeUpdate, + glossaryProperties, + propertiesParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -301,43 +285,45 @@ public void updateGlossary(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager - * @param organizingPrinciple description of how the glossary is organized + * @param properties description of how the glossary is organized + * @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? * * @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 void setGlossaryAsTaxonomy(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier, - String organizingPrinciple) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setGlossaryAsTaxonomy(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + TaxonomyProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setGlossaryAsTaxonomy"; final String glossaryGUIDParameterName = "glossaryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); - - TaxonomyClassificationRequestBody requestBody = new TaxonomyClassificationRequestBody(); - requestBody.setOrganizingPrinciple(organizingPrinciple); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryExternalIdentifier, - methodName)); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/is-taxonomy"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryGUID); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryGUIDParameterName, + glossaryExternalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -349,37 +335,42 @@ public void setGlossaryAsTaxonomy(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @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? * * @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 void clearGlossaryAsTaxonomy(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void clearGlossaryAsTaxonomy(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "clearGlossaryAsTaxonomy"; final String glossaryGUIDParameterName = "glossaryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/is-taxonomy/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryExternalIdentifier, - methodName), - serverName, - userId, - glossaryGUID); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryGUIDParameterName, + glossaryExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -395,43 +386,45 @@ public void clearGlossaryAsTaxonomy(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager - * @param scope description of the situations where this glossary is relevant. + * @param properties description of the situations where this glossary is relevant. + * @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? * * @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 void setGlossaryAsCanonical(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier, - String scope) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setGlossaryAsCanonical(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + CanonicalVocabularyProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setGlossaryAsCanonical"; final String glossaryGUIDParameterName = "glossaryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); - - CanonicalVocabularyClassificationRequestBody requestBody = new CanonicalVocabularyClassificationRequestBody(); - requestBody.setScope(scope); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryExternalIdentifier, - methodName)); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/is-canonical"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryGUID); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryGUIDParameterName, + glossaryExternalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -443,37 +436,42 @@ public void setGlossaryAsCanonical(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @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? * * @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 void clearGlossaryAsCanonical(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void clearGlossaryAsCanonical(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "clearGlossaryAsCanonical"; final String glossaryGUIDParameterName = "glossaryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/is-canonical/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryExternalIdentifier, - methodName), - serverName, - userId, - glossaryGUID); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryGUIDParameterName, + glossaryExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -486,37 +484,42 @@ public void clearGlossaryAsCanonical(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @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? * * @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 void removeGlossary(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void removeGlossary(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryGUID, + String glossaryExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "removeGlossary"; final String glossaryGUIDParameterName = "glossaryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryExternalIdentifier, - methodName), - serverName, - userId, - glossaryGUID); + super.removeReferenceable(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryGUIDParameterName, + glossaryExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -530,6 +533,9 @@ public void removeGlossary(String userId, * @param searchString string to find in the properties * @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 @@ -542,9 +548,12 @@ public List findGlossaries(String userId, String assetManagerName, String searchString, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "findGlossaries"; final String searchStringParameterName = "searchString"; @@ -558,8 +567,9 @@ public List findGlossaries(String userId, requestBody.setAssetManagerName(assetManagerName); requestBody.setSearchString(searchString); requestBody.setSearchStringParameterName(searchStringParameterName); + requestBody.setEffectiveTime(effectiveTime); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/by-search-string?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; GlossaryElementsResponse restResult = restClient.callGlossariesPostRESTCall(methodName, urlTemplate, @@ -567,7 +577,9 @@ public List findGlossaries(String userId, serverName, userId, startFrom, - validatedPageSize); + validatedPageSize, + forLineage, + forDuplicateProcessing); return restResult.getElementList(); } @@ -583,6 +595,9 @@ public List findGlossaries(String userId, * @param name name to search for * @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 * @@ -596,9 +611,12 @@ public List getGlossariesByName(String userId, String assetManagerName, String name, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "getGlossariesByName"; final String nameParameterName = "name"; @@ -614,7 +632,7 @@ public List getGlossariesByName(String userId, requestBody.setName(name); requestBody.setNameParameterName(nameParameterName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/by-name?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; GlossaryElementsResponse restResult = restClient.callGlossariesPostRESTCall(methodName, urlTemplate, @@ -622,7 +640,9 @@ public List getGlossariesByName(String userId, serverName, userId, startFrom, - validatedPageSize); + validatedPageSize, + forLineage, + forDuplicateProcessing); return restResult.getElementList(); } @@ -636,6 +656,9 @@ public List getGlossariesByName(String userId, * @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 matching metadata elements * @@ -648,24 +671,29 @@ public List getGlossariesForAssetManager(String userId, String assetManagerGUID, String assetManagerName, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "getGlossariesForAssetManager"; invalidParameterHandler.validateUserId(userId, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/by-asset-manager?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/by-asset-manager?startFrom={2}&pageSize={3}&forLineage={4}&forDuplicateProcessing={5}"; GlossaryElementsResponse restResult = restClient.callGlossariesPostRESTCall(methodName, urlTemplate, - getAssetManagerIdentifiersRequestBody(assetManagerGUID, assetManagerName), + getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), serverName, userId, startFrom, - validatedPageSize); + validatedPageSize, + forLineage, + forDuplicateProcessing); return restResult.getElementList(); } @@ -678,6 +706,9 @@ public List getGlossariesForAssetManager(String userId, * @param assetManagerGUID unique identifier of software capability representing the caller * @param assetManagerName unique name of software capability representing the caller * @param guid unique identifier of the requested metadata element + * @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 matching metadata element * @@ -689,9 +720,12 @@ public List getGlossariesForAssetManager(String userId, public GlossaryElement getGlossaryByGUID(String userId, String assetManagerGUID, String assetManagerName, - String guid) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + String guid, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "getGlossaryByGUID"; final String guidParameterName = "guid"; @@ -699,14 +733,16 @@ public GlossaryElement getGlossaryByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/retrieve"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/retrieve?forLineage={3}&forDuplicateProcessing={4}"; GlossaryElementResponse restResult = restClient.callGlossaryPostRESTCall(methodName, urlTemplate, getAssetManagerIdentifiersRequestBody(assetManagerGUID, assetManagerName), serverName, userId, - guid); + guid, + forLineage, + forDuplicateProcessing); return restResult.getElement(); } @@ -723,9 +759,13 @@ public GlossaryElement getGlossaryByGUID(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the category is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryCategoryProperties properties about the glossary category to store + * @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 unique identifier of the new glossary category * @@ -737,39 +777,36 @@ public GlossaryElement getGlossaryByGUID(String userId, public String createGlossaryCategory(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, - GlossaryCategoryProperties glossaryCategoryProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "createGlossaryCategory"; final String guidParameterName = "glossaryGUID"; final String propertiesParameterName = "glossaryCategoryProperties"; - final String qualifiedNameParameterName = "glossaryCategoryProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, guidParameterName, methodName); - invalidParameterHandler.validateObject(glossaryCategoryProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(glossaryCategoryProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - - GlossaryCategoryRequestBody requestBody = new GlossaryCategoryRequestBody(); - requestBody.setElementProperties(glossaryCategoryProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - externalIdentifierProperties, - methodName)); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/categories"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryGUID); - - return restResult.getGUID(); + return super.createReferenceableWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + glossaryGUID, + guidParameterName, + glossaryCategoryProperties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -779,6 +816,8 @@ public String createGlossaryCategory(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the category is located * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -793,39 +832,30 @@ public String createGlossaryCategory(String userId, public String createGlossaryCategoryFromTemplate(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, + String glossaryGUID, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - final String methodName = "createGlossaryCategoryFromTemplate"; - final String templateGUIDParameterName = "templateGUID"; - final String propertiesParameterName = "templateProperties"; - final String qualifiedNameParameterName = "templateProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); - invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - - TemplateRequestBody requestBody = new TemplateRequestBody(); - requestBody.setElementProperties(templateProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - externalIdentifierProperties, - methodName)); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/from-template/{1}"; + final String methodName = "createGlossaryCategoryFromTemplate"; + final String guidParameterName = "glossaryGUID"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - templateGUID); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/categories/from-template/{3}"; - return restResult.getGUID(); + return super.createReferenceableFromTemplateWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + glossaryGUID, + guidParameterName, + templateGUID, + templateProperties, + externalIdentifierProperties, + urlTemplate, + methodName); } @@ -864,32 +894,23 @@ public void updateGlossaryCategory(String userId, final String methodName = "updateGlossaryCategory"; final String glossaryGUIDParameterName = "glossaryCategoryGUID"; final String propertiesParameterName = "glossaryCategoryProperties"; - final String qualifiedNameParameterName = "glossaryCategoryProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryCategoryGUID, glossaryGUIDParameterName, methodName); - invalidParameterHandler.validateObject(glossaryCategoryProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(glossaryCategoryProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - GlossaryCategoryRequestBody requestBody = new GlossaryCategoryRequestBody(); - requestBody.setElementProperties(glossaryCategoryProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryCategoryExternalIdentifier, - methodName)); - requestBody.setEffectiveTime(effectiveTime); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/update"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}?isMergeUpdate={3}&forLineage={4}&forDuplicateProcessing={5}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryCategoryGUID, - isMergeUpdate, - forLineage, - forDuplicateProcessing); + super.updateReferenceable(userId, + assetManagerGUID, + assetManagerName, + glossaryCategoryGUID, + glossaryGUIDParameterName, + glossaryCategoryExternalIdentifier, + isMergeUpdate, + glossaryCategoryProperties, + propertiesParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -925,22 +946,21 @@ public void setupCategoryParent(String userId, final String glossaryParentGUIDParameterName = "glossaryParentCategoryGUID"; final String glossaryChildGUIDParameterName = "glossaryChildCategoryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryParentCategoryGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryChildCategoryGUID, glossaryChildGUIDParameterName, methodName); - - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/subcategories/{3}?forLineage={4}&forDuplicateProcessing={5}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/subcategories/{3}"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), - serverName, - userId, - glossaryParentCategoryGUID, - glossaryChildCategoryGUID, - forLineage, - forDuplicateProcessing); + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryParentCategoryGUID, + glossaryParentGUIDParameterName, + null, + glossaryChildCategoryGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -976,21 +996,20 @@ public void clearCategoryParent(String userId, final String glossaryParentGUIDParameterName = "glossaryParentCategoryGUID"; final String glossaryChildGUIDParameterName = "glossaryChildCategoryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryParentCategoryGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryChildCategoryGUID, glossaryChildGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/subcategory/{3}/remove?forLineage={4}&forDuplicateProcessing={5}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/subcategory/{3}/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), - serverName, - userId, - glossaryParentCategoryGUID, - glossaryChildCategoryGUID, - forLineage, - forDuplicateProcessing); + super.clearRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryParentCategoryGUID, + glossaryParentGUIDParameterName, + glossaryChildCategoryGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1025,19 +1044,19 @@ public void removeGlossaryCategory(String userId, final String methodName = "removeGlossaryCategory"; final String glossaryGUIDParameterName = "glossaryCategoryGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryCategoryGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/remove?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryCategoryExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryCategoryGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceable(userId, + assetManagerGUID, + assetManagerName, + glossaryCategoryGUID, + glossaryGUIDParameterName, + glossaryCategoryExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1392,9 +1411,13 @@ public List getGlossarySubCategories(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryTermProperties properties for the glossary term + * @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 unique identifier of the new metadata element for the glossary term * @@ -1406,39 +1429,36 @@ public List getGlossarySubCategories(String userId, public String createGlossaryTerm(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, - GlossaryTermProperties glossaryTermProperties) throws InvalidParameterException, + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { final String methodName = "createGlossaryTerm"; final String guidParameterName = "glossaryGUID"; final String propertiesParameterName = "glossaryTermProperties"; - final String qualifiedNameParameterName = "glossaryTermProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryGUID, guidParameterName, methodName); - invalidParameterHandler.validateObject(glossaryTermProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(glossaryTermProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - - GlossaryTermRequestBody requestBody = new GlossaryTermRequestBody(); - requestBody.setElementProperties(glossaryTermProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - externalIdentifierProperties, - methodName)); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/terms"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryGUID); - - return restResult.getGUID(); + return super.createReferenceableWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + glossaryGUID, + guidParameterName, + glossaryTermProperties, + propertiesParameterName, + externalIdentifierProperties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1448,10 +1468,14 @@ public String createGlossaryTerm(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryTermProperties properties for the glossary term * @param initialStatus glossary term status to use when the object is created + * @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 unique identifier of the new metadata element for the glossary term * @@ -1463,12 +1487,16 @@ public String createGlossaryTerm(String userId, public String createControlledGlossaryTerm(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, GlossaryTermProperties glossaryTermProperties, - GlossaryTermStatus initialStatus) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + GlossaryTermStatus initialStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "createControlledGlossaryTerm"; final String guidParameterName = "glossaryGUID"; @@ -1507,6 +1535,8 @@ public String createControlledGlossaryTerm(String userId, * @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 assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the term is located * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -1521,39 +1551,30 @@ public String createControlledGlossaryTerm(String userId, public String createGlossaryTermFromTemplate(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, + String glossaryGUID, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException - { - final String methodName = "createGlossaryTermFromTemplate"; - final String templateGUIDParameterName = "templateGUID"; - final String propertiesParameterName = "templateProperties"; - final String qualifiedNameParameterName = "templateProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); - invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - - TemplateRequestBody requestBody = new TemplateRequestBody(); - requestBody.setElementProperties(templateProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - externalIdentifierProperties, - methodName)); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/from-template/{1}"; + { + final String methodName = "createGlossaryTermFromTemplate"; + final String guidParameterName = "glossaryGUID"; - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - templateGUID); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/{2}/terms/from-template/{3}"; - return restResult.getGUID(); + return super.createReferenceableFromTemplateWithParent(userId, + assetManagerGUID, + assetManagerName, + assetManagerIsHome, + glossaryGUID, + guidParameterName, + templateGUID, + templateProperties, + externalIdentifierProperties, + urlTemplate, + methodName); } @@ -1592,36 +1613,23 @@ public void updateGlossaryTerm(String userId, final String methodName = "updateGlossaryTerm"; final String glossaryGUIDParameterName = "glossaryTermGUID"; final String propertiesParameterName = "glossaryTermProperties"; - final String qualifiedNameParameterName = "glossaryTermProperties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - invalidParameterHandler.validateObject(glossaryTermProperties, propertiesParameterName, methodName); - - if (! isMergeUpdate) - { - invalidParameterHandler.validateName(glossaryTermProperties.getQualifiedName(), qualifiedNameParameterName, methodName); - } - - GlossaryTermRequestBody requestBody = new GlossaryTermRequestBody(); - requestBody.setElementProperties(glossaryTermProperties); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryTermExternalIdentifier, - methodName)); - requestBody.setEffectiveTime(effectiveTime); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}?isMergeUpdate={3}&forLineage={4}&forDuplicateProcessing={5}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/update"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryTermGUID, - isMergeUpdate, - forLineage, - forDuplicateProcessing); + super.updateReferenceable(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + isMergeUpdate, + glossaryTermProperties, + propertiesParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1719,21 +1727,21 @@ public void setupTermCategory(String userId, final String glossaryParentGUIDParameterName = "glossaryCategoryGUID"; final String glossaryChildGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryCategoryGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryChildGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/terms/{3}?forLineage={4}&forDuplicateProcessing={5}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/terms/{3}"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getRelationshipRequestBody(assetManagerGUID, assetManagerName, effectiveTime, categorizationProperties), - serverName, - userId, - glossaryCategoryGUID, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryCategoryGUID, + glossaryParentGUIDParameterName, + categorizationProperties, + glossaryTermGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1769,21 +1777,20 @@ public void clearTermCategory(String userId, final String glossaryParentGUIDParameterName = "glossaryCategoryGUID"; final String glossaryChildGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryCategoryGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryChildGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/terms/{3}/remove?forLineage={4}&forDuplicateProcessing={5}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/categories/{2}/terms/{3}/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), - serverName, - userId, - glossaryCategoryGUID, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.clearRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryCategoryGUID, + glossaryParentGUIDParameterName, + glossaryTermGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1824,28 +1831,23 @@ public void setupTermRelationship(String userId, final String glossaryChildGUIDParameterName = "glossaryTermTwoGUID"; final String glossaryTypeParameterName = "relationshipTypeName"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermOneGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryTermTwoGUID, glossaryChildGUIDParameterName, methodName); - invalidParameterHandler.validateName(relationshipTypeName, glossaryTypeParameterName, methodName); - - TermRelationshipRequestBody requestBody = new TermRelationshipRequestBody(); - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - requestBody.setProperties(relationshipsProperties); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/relationships/{3}/terms/{4}?forLineage={4}&forDuplicateProcessing={5}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/relationships/{3}/terms/{4}"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryTermOneGUID, - relationshipTypeName, - glossaryTermTwoGUID, - forLineage, - forDuplicateProcessing); + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryTermOneGUID, + glossaryParentGUIDParameterName, + relationshipTypeName, + glossaryTypeParameterName, + relationshipsProperties, + glossaryTermTwoGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1884,28 +1886,25 @@ public void updateTermRelationship(String userId, final String methodName = "updateTermRelationship"; final String glossaryParentGUIDParameterName = "glossaryTermOneGUID"; final String glossaryChildGUIDParameterName = "glossaryTermTwoGUID"; + final String glossaryTypeParameterName = "relationshipTypeName"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermOneGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryTermTwoGUID, glossaryChildGUIDParameterName, methodName); - - TermRelationshipRequestBody requestBody = new TermRelationshipRequestBody(); - requestBody.setAssetManagerGUID(assetManagerGUID); - requestBody.setAssetManagerName(assetManagerName); - requestBody.setProperties(relationshipsProperties); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/relationships/{3}/terms/{4}/update?forLineage={5}&forDuplicateProcessing={6}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/relationships/{3}/terms/{4}/update"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryTermOneGUID, - relationshipTypeName, - glossaryTermTwoGUID, - forLineage, - forDuplicateProcessing); + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryTermOneGUID, + glossaryParentGUIDParameterName, + relationshipTypeName, + glossaryTypeParameterName, + relationshipsProperties, + glossaryTermTwoGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1942,23 +1941,24 @@ public void clearTermRelationship(String userId, final String methodName = "clearTermRelationship"; final String glossaryParentGUIDParameterName = "glossaryTermOneGUID"; final String glossaryChildGUIDParameterName = "glossaryTermTwoGUID"; + final String glossaryTypeParameterName = "relationshipTypeName"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermOneGUID, glossaryParentGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(glossaryTermTwoGUID, glossaryChildGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/relationships/{3}/terms/{4}/remove?forLineage={5}&forDuplicateProcessing={6}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/relationships/{3}/terms/{4}/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), - serverName, - userId, - glossaryTermOneGUID, - relationshipTypeName, - glossaryTermTwoGUID, - forLineage, - forDuplicateProcessing); + super.clearRelationship(userId, + assetManagerGUID, + assetManagerName, + glossaryTermOneGUID, + glossaryParentGUIDParameterName, + relationshipTypeName, + glossaryTypeParameterName, + glossaryTermTwoGUID, + glossaryChildGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -1993,19 +1993,20 @@ public void setTermAsAbstractConcept(String userId, final String methodName = "setTermAsAbstractConcept"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-abstract-concept?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-abstract-concept"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + null, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2040,19 +2041,19 @@ public void clearTermAsAbstractConcept(String userId, final String methodName = "clearTermAsAbstractConcept"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-abstract-concept/remove"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-abstract-concept/remove?forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2087,19 +2088,20 @@ public void setTermAsDataValue(String userId, final String methodName = "setTermAsDataValue"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-data-value?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-data-value"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + null, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2134,19 +2136,19 @@ public void clearTermAsDataValue(String userId, final String methodName = "clearTermAsDataValue"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-data-value/remove"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-data-value/remove?forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2158,7 +2160,7 @@ public void clearTermAsDataValue(String userId, * @param assetManagerName unique name of software capability representing the caller * @param glossaryTermGUID unique identifier of the metadata element to update * @param glossaryTermExternalIdentifier unique identifier of the glossary term in the external asset manager - * @param activityType type of activity + * @param properties type of activity * @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? @@ -2168,42 +2170,35 @@ public void clearTermAsDataValue(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ @Override - public void setTermAsActivity(String userId, - String assetManagerGUID, - String assetManagerName, - String glossaryTermGUID, - String glossaryTermExternalIdentifier, - GlossaryTermActivityType activityType, - Date effectiveTime, - boolean forLineage, - boolean forDuplicateProcessing) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setTermAsActivity(String userId, + String assetManagerGUID, + String assetManagerName, + String glossaryTermGUID, + String glossaryTermExternalIdentifier, + ActivityDescriptionProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setTermAsActivity"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - ActivityTermClassificationRequestBody requestBody = new ActivityTermClassificationRequestBody(); - requestBody.setActivityType(activityType); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryTermExternalIdentifier, - methodName)); - requestBody.setEffectiveTime(effectiveTime); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-activity"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-activity?forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2238,19 +2233,19 @@ public void clearTermAsActivity(String userId, final String methodName = "clearTermAsActivity"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-activity/remove?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-activity/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2287,27 +2282,20 @@ public void setTermAsContext(String userId, final String methodName = "setTermAsContext"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - ContextDefinitionClassificationRequestBody requestBody = new ContextDefinitionClassificationRequestBody(); - requestBody.setContextDefinition(contextDefinition); - requestBody.setMetadataCorrelationProperties(this.getCorrelationProperties(assetManagerGUID, - assetManagerName, - glossaryTermExternalIdentifier, - methodName)); - requestBody.setEffectiveTime(effectiveTime); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-context-definition?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-context-definition"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - requestBody, - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + contextDefinition, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2342,19 +2330,19 @@ public void clearTermAsContext(String userId, final String methodName = "clearTermAsContext"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-context-definition/remove"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-context-definition/remove?forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2389,19 +2377,20 @@ public void setTermAsSpineObject(String userId, final String methodName = "setTermAsSpineObject"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-object?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-object"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + null, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2436,19 +2425,19 @@ public void clearTermAsSpineObject(String userId, final String methodName = "clearTermAsSpineObject"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-object/remove"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-object/remove?forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2483,19 +2472,20 @@ public void setTermAsSpineAttribute(String userId, final String methodName = "setTermAsSpineAttribute"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-attribute?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-attribute"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + null, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2530,19 +2520,19 @@ public void clearTermAsSpineAttribute(String userId, final String methodName = "clearTermAsSpineAttribute"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-attribute/remove"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-spine-attribute/remove?forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2577,19 +2567,20 @@ public void setTermAsObjectIdentifier(String userId, final String methodName = "setTermAsObjectIdentifier"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-object-identifier?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-object-identifier"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + null, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2624,19 +2615,19 @@ public void clearTermAsObjectIdentifier(String userId, final String methodName = "clearTermAsObjectIdentifier"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-object-identifier/remove"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/is-object-identifier/remove&forLineage={3}&forDuplicateProcessing={4}"; - - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -2774,19 +2765,19 @@ public void removeGlossaryTerm(String userId, final String methodName = "removeGlossaryTerm"; final String glossaryGUIDParameterName = "glossaryTermGUID"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(glossaryTermGUID, glossaryGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/remove?forLineage={3}&forDuplicateProcessing={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/glossaries/terms/{2}/remove"; - restClient.callVoidPostRESTCall(methodName, - urlTemplate, - getUpdateRequestBody(assetManagerGUID, assetManagerName, glossaryTermExternalIdentifier, effectiveTime, methodName), - serverName, - userId, - glossaryTermGUID, - forLineage, - forDuplicateProcessing); + super.removeReferenceable(userId, + assetManagerGUID, + assetManagerName, + glossaryTermGUID, + glossaryGUIDParameterName, + glossaryTermExternalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); } @@ -3080,7 +3071,9 @@ public GlossaryTermElement getGlossaryTermByGUID(String userId, GlossaryTermElementResponse restResult = restClient.callGlossaryTermPostRESTCall(methodName, urlTemplate, - getEffectiveTimeQueryRequestBody(assetManagerGUID, assetManagerName, effectiveTime), + getEffectiveTimeQueryRequestBody(assetManagerGUID, + assetManagerName, + effectiveTime), serverName, userId, glossaryTermGUID, @@ -3095,6 +3088,8 @@ public GlossaryTermElement getGlossaryTermByGUID(String userId, * Retrieve all the versions of a 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 object to retrieve * @param fromTime the earliest point in time from which to retrieve historical versions of the entity (inclusive) * @param toTime the latest point in time from which to retrieve historical versions of the entity (exclusive) @@ -3422,6 +3417,8 @@ public void detachExternalLinkFromGlossary(String userId, * Retrieve the list of links to external glossary resources attached to a glossary. * * @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 glossaryGUID unique identifier of the metadata element for the glossary of interest * @param startFrom paging start point * @param pageSize maximum results that can be returned diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GovernanceExchangeClient.java similarity index 88% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GovernanceExchangeClient.java index 5cb9099686f..569504960bd 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/GovernanceExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.GovernanceExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.GovernanceExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceActionProcessElement; @@ -365,118 +365,6 @@ public GovernanceDefinitionElement getGovernanceDefinitionByDocId(String userId, } - /** - * Link a governance definition to an element using the GovernedBy relationship. - * - * @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 definitionGUID identifier of the governance definition to link - * @param elementGUID unique identifier of the metadata element to link - * @param methodName calling method - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - public void addGovernanceDefinitionToElement(String userId, - String assetManagerGUID, - String assetManagerName, - String definitionGUID, - String elementGUID, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Remove the GovernedBy relationship between a governance definition and an 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 definitionGUID identifier of the governance definition to link - * @param elementGUID unique identifier of the metadata element to update - * @param methodName calling method - * - * @throws InvalidParameterException one of the parameters is invalid - * @throws UserNotAuthorizedException the user is not authorized to issue this request - * @throws PropertyServerException there is a problem reported in the open metadata server(s) - */ - public void removeGovernanceDefinitionFromElement(String userId, - String assetManagerGUID, - String assetManagerName, - String definitionGUID, - String elementGUID, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Classify the element to asset that the definitions it represents are part of a subject area definition. - * - * @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 elementGUID unique identifier of the metadata element to update - * @param elementExternalIdentifier unique identifier of the glossary category in the external asset manager - * @param subjectAreaName qualified name of subject area - * @param methodName calling method - * - * @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 void addElementToSubjectArea(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String elementExternalIdentifier, - String subjectAreaName, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - - /** - * Remove the subject area designation from the identified 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 elementGUID unique identifier of the metadata element to update - * @param externalElementIdentifier unique identifier of the equivalent element in the external asset manager - * @param methodName calling method - * - * @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 void removeElementFromSubjectArea(String userId, - String assetManagerGUID, - String assetManagerName, - String elementGUID, - String externalElementIdentifier, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - - } - - /** * Retrieve the list of governance action process metadata elements that contain the search string. * The search string is treated as a regular expression. diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/InfrastructureExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/InfrastructureExchangeClient.java similarity index 97% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/InfrastructureExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/InfrastructureExchangeClient.java index 3150f0847d5..d398ac654e0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/InfrastructureExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/InfrastructureExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.InfrastructureExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.InfrastructureExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/LineageExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/LineageExchangeClient.java similarity index 96% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/LineageExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/LineageExchangeClient.java index d6728385098..c2551704ea0 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/LineageExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/LineageExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.LineageExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.LineageExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; @@ -3121,4 +3121,132 @@ public List getSourceLineageMappings(String userId, return results.getElementList(); } + + + /** + * Classify the element with the Memento classification to indicate that it has been logically deleted for by lineage requests. + * + * @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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void addMementoClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + } + + + /** + * Remove the memento designation from the 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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void clearMementoClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + } + + + /** + * Classify the element with the Incomplete classification to indicate that it has more details to come. + * + * @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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void addIncompleteClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + } + + + /** + * Remove the Incomplete designation from the 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 metadata element to update + * @param elementExternalIdentifier unique identifier of the element in the external asset manager + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void clearIncompleteClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementExternalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + + } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/SchemaExchangeClientBase.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/SchemaExchangeClientBase.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/SchemaExchangeClientBase.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/SchemaExchangeClientBase.java index c8494cef604..80998fb9f5c 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/SchemaExchangeClientBase.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/SchemaExchangeClientBase.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.SchemaExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.SchemaExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaAttributeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaTypeElement; 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 new file mode 100644 index 00000000000..8d3c5503b00 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/StewardshipExchangeClient.java @@ -0,0 +1,1111 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; + +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.StewardshipExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +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.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 java.util.Date; + + +/** + * StewardshipExchangeClient is the client for assigning relationships and classifications that help govern both metadata and its associated + * resources. + */ +public class StewardshipExchangeClient extends ExchangeClientBase implements StewardshipExchangeInterface +{ + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipExchangeClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipExchangeClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipExchangeClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipExchangeClient(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipExchangeClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Classify/reclassify the element (typically an asset) to indicate the level of confidence that the organization + * has that the data is complete, accurate and up-to-date. The level of confidence is expressed by the + * levelIdentifier property. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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 void setConfidenceClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setConfidenceClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/confidence"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidence to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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 void clearConfidenceClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearConfidenceClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/confidence/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + 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. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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 void setCriticalityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + GovernanceClassificationProperties properties, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setCriticalityClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/criticality"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the criticality classification from the element. This normally occurs when the organization has lost track of the level of + * criticality to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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 void clearCriticalityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearCriticalityClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/criticality/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + 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 + * of confidentiality is a suggestion for any element linked to the glossary term via the SemanticAssignment classification. + * The level of confidence is expressed by the levelIdentifier property. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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 void setConfidentialityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setConfidentialityClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/confidentiality"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidentiality to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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 void clearConfidentialityClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearConfidentialityClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/confidentiality/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + 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 + * property. The dates after which the element/resource is archived and then deleted are specified in the archiveAfter and deleteAfter + * properties respectively. + * + * @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 metadata element to classify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the classification + * @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? + * + * @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 void setRetentionClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + RetentionClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setRetentionClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/retention"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the retention classification from the element. This normally occurs when the organization has lost track of, or no longer needs to + * track the retention period to assign to the 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 metadata element to unclassify + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @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 void clearRetentionClassification(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearRetentionClassification"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/retention/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Add or replace the security tags for an 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 element to link it to - its type must inherit from Referenceable. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the security tags + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void addSecurityTags(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + SecurityTagsProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "addSecurityTags"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/security-tags"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the security tags classification from an 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 element where the security tags need to be removed. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void clearSecurityTags(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearSecurityTags"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/security-tags/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Add or replace the ownership classification for an 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 element to link it to - its type must inherit from Referenceable. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the ownership + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void addOwnership(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + OwnerProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "addOwnership"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/ownership"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the ownership classification from an 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 element where the classification needs to be removed. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void clearOwnership(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearOwnership"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/ownership/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Add or replace the origin classification for an asset. + * + * @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 assetGUID element to link it to - its type must inherit from Asset. + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties details of the origin + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void addAssetOrigin(String userId, + String assetManagerGUID, + String assetManagerName, + String assetGUID, + String externalIdentifier, + AssetOriginProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "addAssetOrigin"; + final String elementGUIDParameter = "assetGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/assets/{2}/origin"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + assetGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the origin classification from an asset. + * + * @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 assetGUID element where the classification needs to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void clearAssetOrigin(String userId, + String assetManagerGUID, + String assetManagerName, + String assetGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearAssetOrigin"; + final String elementGUIDParameter = "assetGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/assets/{2}/origin/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + assetGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Classify the element to assert that the definitions it represents are part of a subject area definition. + * + * @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 elementGUID unique identifier of the metadata element to update + * @param externalIdentifier unique identifier of the element in the external asset manager + * @param properties qualified name of subject area + * @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? + * + * @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 void addElementToSubjectArea(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + SubjectAreaMemberProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "addElementToSubjectArea"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/subject-area-member"; + + super.setReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + properties, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the subject area designation from the identified 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 elementGUID unique identifier of the metadata element to update + * @param externalIdentifier unique identifier of the equivalent element in the external asset manager + * @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? + * + * @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 void removeElementFromSubjectArea(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String externalIdentifier, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeElementFromSubjectArea"; + final String elementGUIDParameter = "elementGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/subject-area-member/remove"; + + super.removeReferenceableClassification(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameter, + externalIdentifier, + urlTemplate, + 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. + * + * @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 that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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? + * + * @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 void setupSemanticAssignment(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String glossaryTermGUID, + SemanticAssignmentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "setupSemanticAssignment"; + final String elementGUIDParameterName = "elementGUID"; + final String glossaryTermGUIDParameterName = "glossaryTermGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/semantic-assignment/terms/{3}"; + + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameterName, + properties, + glossaryTermGUID, + glossaryTermGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove a semantic assignment relationship between an element and its 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 elementGUID unique identifier of the element that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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? + * + * @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 void clearSemanticAssignment(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "clearSemanticAssignment"; + final String elementGUIDParameterName = "elementGUID"; + final String glossaryTermGUIDParameterName = "glossaryTermGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/semantic-assignment/terms/{3}/remove"; + + super.clearRelationship(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameterName, + glossaryTermGUID, + glossaryTermGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Link a governance definition to an element using the GovernedBy relationship. + * + * @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 definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to link + * @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? + * + * @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 void addGovernanceDefinitionToElement(String userId, + String assetManagerGUID, + String assetManagerName, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "addGovernanceDefinitionToElement"; + final String elementGUIDParameterName = "elementGUID"; + final String definitionGUIDParameterName = "definitionGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/governed-by/definition/{3}"; + + super.setupRelationship(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameterName, + null, + definitionGUID, + definitionGUIDParameterName, + urlTemplate, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + } + + + /** + * Remove the GovernedBy relationship between a governance definition and an 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 definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to update + * @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? + * + * @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 void removeGovernanceDefinitionFromElement(String userId, + String assetManagerGUID, + String assetManagerName, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "removeGovernanceDefinitionFromElement"; + final String elementGUIDParameterName = "elementGUID"; + final String definitionGUIDParameterName = "definitionGUID"; + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/elements/{2}/governed-by/definition/{3}/remove"; + + super.clearRelationship(userId, + assetManagerGUID, + assetManagerName, + elementGUID, + elementGUIDParameterName, + definitionGUID, + definitionGUIDParameterName, + urlTemplate, + 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/ValidValuesExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ValidValuesExchangeClient.java similarity index 99% rename from open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ValidValuesExchangeClient.java rename to open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ValidValuesExchangeClient.java index 3aba47fc1a3..7b251bb84be 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/ValidValuesExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/ValidValuesExchangeClient.java @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetmanager.client; +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; -import org.odpi.openmetadata.accessservices.assetmanager.api.ValidValuesExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.ValidValuesExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ValidValueElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/package-info.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/package-info.java new file mode 100644 index 00000000000..7600f7dc433 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/exchange/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * These are the Java clients for the Asset Manager OMAS that are used by the Open Metadata Integration Services (OMISs). + */ +package org.odpi.openmetadata.accessservices.assetmanager.client.exchange; 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 new file mode 100644 index 00000000000..296ad717374 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/CollaborationManagementClient.java @@ -0,0 +1,1280 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.client.management; + +import org.odpi.openmetadata.accessservices.assetmanager.api.management.CollaborationManagementInterface; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.CollaborationExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.NoteLogElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.InformalTagProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteLogProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.NoteProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +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 java.util.Date; +import java.util.List; + + +/** + * CollaborationExchangeClient is the client for managing comments, ratings, likes and tags. + */ +public class CollaborationManagementClient implements CollaborationManagementInterface +{ + private final CollaborationExchangeClient client; + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationManagementClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + client = new CollaborationExchangeClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationManagementClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + client = new CollaborationExchangeClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationManagementClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + client = new CollaborationExchangeClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationManagementClient(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + client = new CollaborationExchangeClient(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public CollaborationManagementClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + client = new CollaborationExchangeClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Adds a star rating and optional review text to the element. If the user has already attached + * a rating then the original one is over-ridden. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element. + * @param isPublic is this visible to other people + * @param properties properties of the rating + * @return unique identifier of the rating + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String addRatingToElement(String userId, + String elementGUID, + boolean isPublic, + RatingProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.addRatingToElement(userId, elementGUID, isPublic, properties); + } + + + /** + * Removes of a review that was added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the attached element. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void removeRatingFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.removeRatingFromElement(userId, elementGUID); + } + + + /** + * Adds a "LikeProperties" to the element. + * + * @param userId userId of user making request + * @param elementGUID unique identifier for the element + * @param isPublic is this visible to other people + * @param properties indicates whether the feedback should be shared or only be visible to the originating user + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void addLikeToElement(String userId, + String elementGUID, + boolean isPublic, + LikeProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.addLikeToElement(userId, elementGUID, isPublic, properties); + } + + + /** + * Removes a "LikeProperties" added to the element by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the like object. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void removeLikeFromElement(String userId, + String elementGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.removeLikeFromElement(userId, elementGUID); + } + + + /** + * Adds a comment to the element. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element. + * @param isPublic is this comment visible to other people. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String addCommentToElement(String userId, + String elementGUID, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.addCommentToElement(userId, null, null, false, elementGUID, null, isPublic, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Adds a comment to another comment. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for an existing comment. Used to add a reply to a comment. + * @param properties properties of the comment + * @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 guid of new comment. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String addCommentReply(String userId, + String commentGUID, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.addCommentReply(userId, null, null, false, commentGUID, null, isPublic, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Update an existing comment. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for the comment to change. + * @param isPublic is this visible to other people + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties properties of the comment + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void updateComment(String userId, + String commentGUID, + boolean isMergeUpdate, + boolean isPublic, + CommentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.updateComment(userId, + null, + null, + commentGUID, null, + isMergeUpdate, + isPublic, + properties, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param properties is this visible to other people + * @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? + * + * @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 void setupAcceptedAnswer(String userId, + String questionCommentGUID, + String answerCommentGUID, + FeedbackProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setupAcceptedAnswer(userId, null, null, questionCommentGUID, answerCommentGUID, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @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? + * + * @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 void clearAcceptedAnswer(String userId, + String questionCommentGUID, + String answerCommentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearAcceptedAnswer(userId, null, null, questionCommentGUID, answerCommentGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Removes a comment added to the element by this user. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for the comment object. + * @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? + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + @Override + public void removeComment(String userId, + String commentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.removeComment(userId, null, null, commentGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Return the requested comment. + * + * @param userId userId of user making request. + * @param commentGUID unique identifier for the comment object. + * @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 comment properties + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + @Override + public CommentElement getComment(String userId, + String commentGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getComment(userId, null, null, commentGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Return the comments attached to an element. + * + * @param userId userId of user making request. + * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). + * @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 comments + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the user does not have permission to perform this request. + */ + @Override + public List getAttachedComments(String userId, + String elementGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getAttachedComments(userId, null, null, elementGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of comment metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @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 findComments(String userId, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.findComments(userId, + null, + null, + searchString, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + /** + * Creates a new informal tag and returns the unique identifier for it. + * + * @param userId userId of user making request. + * @param properties name of the tag and (optional) description. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic note. + * + * @return GUID for new tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String createInformalTag(String userId, + InformalTagProperties properties) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.createInformalTag(userId, properties); + } + + + /** + * Updates the description of an existing tag (either private or public). + * + * @param userId userId of user making request. + * @param tagGUID unique identifier for the tag. + * @param tagDescription description of the tag. Setting a description, particularly in a public tag + * makes the tag more valuable to other users and can act as an embryonic glossary term. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void updateTagDescription(String userId, + String tagGUID, + String tagDescription) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.updateTagDescription(userId, tagGUID, tagDescription); + } + + + /** + * Removes a tag from the repository. + * A private tag can be deleted by its creator and all the references are lost; + * a public tag can be deleted by anyone, but only if it is not attached to any referenceable. + * + * @param userId userId of user making request. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void deleteTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.deleteTag(userId, tagGUID); + } + + + /** + * Return the tag for the supplied unique identifier (guid). + * + * @param userId userId of the user making the request. + * @param tagGUID unique identifier of the tag. + * + * @return tag + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public InformalTagElement getTag(String userId, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getTag(userId, tagGUID); + } + + + /** + * Return the list of tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List getTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getTagsByName(userId, tag, startFrom, pageSize); + } + + + /** + * Return the list of the calling user's private tags exactly matching the supplied name. + * + * @param userId the name of the calling user. + * @param tag name of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List getMyTagsByName(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getMyTagsByName(userId, tag, startFrom, pageSize); + } + + + /** + * Return the list of tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List findTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.findTags(userId, tag, startFrom, pageSize); + } + + + /** + * Return the list of the calling user's private tags containing the supplied string in either the name or description. + * + * @param userId the name of the calling user. + * @param tag name of tag. This may include wild card characters. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return tag list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List findMyTags(String userId, + String tag, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.findMyTags(userId, tag, startFrom, pageSize); + } + + + /** + * Adds a tag (either private of public) to an element. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id of the tag. + * @param isPublic flag indicating whether the attachment of the tag is public or not + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem adding the element properties to the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void addTagToElement(String userId, + String elementGUID, + String tagGUID, + boolean isPublic) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.addTagToElement(userId, elementGUID, tagGUID, isPublic); + } + + + /** + * Removes a tag from the element that was added by this user. + * + * @param userId userId of user making request. + * @param elementGUID unique id for the element. + * @param tagGUID unique id for the tag. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem updating the element properties in the property server. + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public void removeTagFromElement(String userId, + String elementGUID, + String tagGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + client.removeTagFromElement(userId, elementGUID, tagGUID); + } + + + + /** + * Return the list of unique identifiers for elements that are linked to a specific tag either directly, or via one + * of its schema elements. An Element's GUID may appear multiple times in the results if it is tagged multiple times + * with the requested tag. + * + * @param userId the name of the calling user. + * @param tagGUID unique identifier of tag. + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return element guid list + * @throws InvalidParameterException the userId is null or invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public List getElementsByTag(String userId, + String tagGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getElementsByTag(userId, tagGUID, startFrom, pageSize); + } + + + /* ===================================================================================================================== + * A note log maintains an ordered list of notes. It can be used to support release note, blogs and similar + * broadcast information. Notelogs are typically maintained by the owners/stewards of an element. + */ + + /** + * Create a new metadata element to represent a note log and attach it to an element (if supplied). + * Any supplied element becomes the note log's anchor, causing the note log to be deleted if/when the element is deleted. + * + * @param userId calling user + * @param elementGUID unique identifier of the element where the note log is located + * @param noteLogProperties properties about the note log to store + * @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 unique identifier of the new note log + * + * @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 String createNoteLog(String userId, + String elementGUID, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createNoteLog(userId, null, null, false, elementGUID, null, noteLogProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a new metadata element to represent a note log using an existing metadata element as a template. + * + * @param userId calling user + * @param elementGUID unique identifier of the element where the note log is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new note log + * + * @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 String createNoteLogFromTemplate(String userId, + String elementGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createNoteLogFromTemplate(userId, null, null, false, elementGUID, templateGUID, null, templateProperties); + } + + + /** + * Update the metadata element representing a note log. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param noteLogProperties new properties for the metadata element + * @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? + * + * @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 void updateNoteLog(String userId, + String noteLogGUID, + boolean isMergeUpdate, + boolean isPublic, + NoteLogProperties noteLogProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateNoteLog(userId, null, null, noteLogGUID, null, isMergeUpdate, isPublic, noteLogProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the metadata element representing a note log. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void removeNoteLog(String userId, + String noteLogGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeNoteLog(userId, null, null, noteLogGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of note log metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @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 findNoteLogs(String userId, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.findNoteLogs(userId, null, null, searchString, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of note log metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @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 getNoteLogsByName(String userId, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getNoteLogsByName(userId, null, null, name, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the note log metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the requested metadata element + * @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 requested metadata element + * + * @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 NoteLogElement getNoteLogByGUID(String userId, + String noteLogGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getNoteLogByGUID(userId, null, null, noteLogGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /* =============================================================================== + * A element typically contains many notes, linked with relationships. + */ + + /** + * Create a new metadata element to represent a note. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the element where the note is located + * @param noteProperties properties for the note + * + * @return unique identifier of the new metadata element for the note + * + * @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 String createNote(String userId, + String noteLogGUID, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createNote(userId, null, null, false, noteLogGUID, null, noteProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + + /** + * Create a new metadata element to represent a note using an existing metadata element as a template. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the element where the note is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element for the note + * + * @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 String createNoteFromTemplate(String userId, + String noteLogGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createNoteFromTemplate(userId, null, null, false, noteLogGUID, templateGUID, null, templateProperties); + } + + + /** + * Update the properties of the metadata element representing a note. + * + * @param userId calling user + * @param noteGUID unique identifier of the note to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param noteProperties new properties for the note + * @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? + * + * @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 void updateNote(String userId, + String noteGUID, + boolean isMergeUpdate, + NoteProperties noteProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateNote(userId, null, null, noteGUID, null, isMergeUpdate, noteProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Undo the last update to the note. + * + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to update + * @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 recovered note + * + * @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 NoteElement undoNoteUpdate(String userId, + String noteGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.undoNoteUpdate(userId, null, null, noteGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Archive the metadata element representing a note. This removes it from normal access. However, it is still available + * for lineage requests. + * + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to archive + * @param archiveProperties option parameters about the archive process + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void archiveNote(String userId, + String noteGUID, + ArchiveProperties archiveProperties, + Date effectiveTime, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.archiveNote(userId, null, null, noteGUID, null, archiveProperties, effectiveTime, forDuplicateProcessing); + } + + + /** + * Remove the metadata element representing a note. + * + * @param userId calling user + * @param noteGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void removeNote(String userId, + String noteGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeNote(userId, null, null, noteGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of note metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param elementGUID unique identifier of the element to query + * @param searchString string to find in the properties + * @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 findNotes(String userId, + String elementGUID, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.findNotes(userId, null, null, elementGUID, searchString, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of notes associated with a note log. + * + * @param userId calling user + * @param noteLogGUID unique identifier of the note log of interest + * @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 associated 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 getNotesForNoteLog(String userId, + String noteLogGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getNotesForNoteLog(userId, null, null, noteLogGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of note metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param elementGUID unique identifier of the element to query + * @param name name to search for + * @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 getNotesByName(String userId, + String elementGUID, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getNotesByName(userId, null, null, elementGUID, name, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the note metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param noteGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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 NoteElement getNoteByGUID(String userId, + String noteGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getNoteByGUID(userId, null, null, noteGUID, effectiveTime, forLineage, forDuplicateProcessing); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/GlossaryManagementClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/GlossaryManagementClient.java new file mode 100644 index 00000000000..79369fe234a --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/GlossaryManagementClient.java @@ -0,0 +1,2167 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.client.management; + +import org.odpi.openmetadata.accessservices.assetmanager.api.management.GlossaryManagementInterface; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalGlossaryLinkElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ArchiveProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CanonicalVocabularyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryElementLinkProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalGlossaryLinkProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryCategoryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermContextDefinition; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationship; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermStatus; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TaxonomyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ActivityDescriptionProperties; +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 java.util.Date; +import java.util.List; + +/** + * GlossaryManagementClient is the client for managing resources from a glossary. + */ +public class GlossaryManagementClient implements GlossaryManagementInterface +{ + final GlossaryExchangeClient client; + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public GlossaryManagementClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + client = new GlossaryExchangeClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public GlossaryManagementClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + client = new GlossaryExchangeClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public GlossaryManagementClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + client = new GlossaryExchangeClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public GlossaryManagementClient(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + client = new GlossaryExchangeClient(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public GlossaryManagementClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + client = new GlossaryExchangeClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /* ======================================================== + * The Glossary entity is the top level element in a glossary. + */ + + + /** + * Create a new metadata element to represent the root of a glossary. All categories and terms are linked + * to a single glossary. They are owned by this glossary and if the glossary is deleted, any linked terms and + * categories are deleted as well. + * + * @param userId calling user + * @param glossaryProperties properties to store + * + * @return unique identifier of the new metadata element + * + * @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 String createGlossary(String userId, + GlossaryProperties glossaryProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createGlossary(userId, null, null, false, null, glossaryProperties); + } + + + /** + * Create a new metadata element to represent a glossary using an existing metadata element as a template. + * The template defines additional classifications and relationships that should be added to the new glossary. + * + * All categories and terms are linked to a single glossary. They are owned by this glossary and if the + * glossary is deleted, any linked terms and categories are deleted as well. + * + * @param userId calling user + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element + * + * @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 String createGlossaryFromTemplate(String userId, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createGlossaryFromTemplate(userId, null, null, false, templateGUID, null, templateProperties); + } + + + /** + * Update the metadata element representing a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param glossaryProperties new properties for this element + * @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? + * + * @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 void updateGlossary(String userId, + String glossaryGUID, + boolean isMergeUpdate, + GlossaryProperties glossaryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateGlossary(userId, + null, + null, + glossaryGUID, + null, + isMergeUpdate, + glossaryProperties, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Classify the glossary to indicate that it can be used as a taxonomy. + * This means each term is attached to one, and only one category and the categories are organized as a hierarchy + * with a single root category. + * + * Taxonomies are used as a way of organizing assets and other related metadata. The terms in the taxonomy + * are linked to the assets etc. and as such they are logically categorized by the linked category. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to remove + * @param properties description of how the glossary is organized + * @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? + * + * @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 void setGlossaryAsTaxonomy(String userId, + String glossaryGUID, + TaxonomyProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setGlossaryAsTaxonomy(userId, + null, + null, + glossaryGUID, + null, + properties, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Remove the taxonomy designation from the glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void clearGlossaryAsTaxonomy(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearGlossaryAsTaxonomy(userId, + null, + null, + glossaryGUID, + null, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Classify a glossary to declare that it has no two GlossaryTerm definitions with + * the same name. This means there is only one definition for each term. Typically, the terms are also of a similar + * level of granularity and are limited to a specific scope of use. + * + * Canonical vocabularies are used to semantically classify assets in an unambiguous way. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to remove + * @param properties description of the situations where this glossary is relevant. + * @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? + * + * @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 void setGlossaryAsCanonical(String userId, + String glossaryGUID, + CanonicalVocabularyProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setGlossaryAsCanonical(userId, + null, + null, + glossaryGUID, + null, + properties, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Remove the canonical designation from the glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void clearGlossaryAsCanonical(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearGlossaryAsCanonical(userId, + null, + null, + glossaryGUID, + null, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Remove the metadata element representing a glossary. This will delete the glossary and all categories + * and terms. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void removeGlossary(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeGlossary(userId, + null, + null, + glossaryGUID, + null, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param searchString string to find in the properties + * @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 findGlossaries(String userId, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.findGlossaries(userId, + null, + null, + searchString, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param name name to search for + * @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 getGlossariesByName(String userId, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossariesByName(userId, + null, + null, + name, + startFrom, + pageSize, + effectiveTime, + forLineage, + forDuplicateProcessing); + } + + + /** + * Retrieve the glossary metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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 GlossaryElement getGlossaryByGUID(String userId, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossaryByGUID(userId, null, null, glossaryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + + /* ===================================================================================================================== + * A glossary may host one or more glossary categories depending on its capability + */ + + /** + * Create a new metadata element to represent a glossary category. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param glossaryCategoryProperties properties about the glossary category to store + * @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 unique identifier of the new glossary category + * + * @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 String createGlossaryCategory(String userId, + String glossaryGUID, + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createGlossaryCategory(userId, null, null, false, glossaryGUID, null, glossaryCategoryProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a new metadata element to represent a glossary category using an existing metadata element as a template. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new glossary category + * + * @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 String createGlossaryCategoryFromTemplate(String userId, + String glossaryGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createGlossaryCategoryFromTemplate(userId, null, null, false, glossaryGUID, templateGUID, null, templateProperties); + } + + + /** + * Update the metadata element representing a glossary category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param glossaryCategoryProperties new properties for the metadata element + * @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? + * + * @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 void updateGlossaryCategory(String userId, + String glossaryCategoryGUID, + boolean isMergeUpdate, + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateGlossaryCategory(userId, null, null, glossaryCategoryGUID, null, isMergeUpdate, glossaryCategoryProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a parent-child relationship between two categories. + * + * @param userId calling user + * @param glossaryParentCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the super-category + * @param glossaryChildCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the subcategory + * @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? + * + * @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 void setupCategoryParent(String userId, + String glossaryParentCategoryGUID, + String glossaryChildCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setupCategoryParent(userId, null, null, glossaryParentCategoryGUID, glossaryChildCategoryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove a parent-child relationship between two categories. + * + * @param userId calling user + * @param glossaryParentCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the super-category + * @param glossaryChildCategoryGUID unique identifier of the glossary category in the external asset manager that is to be the subcategory + * @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? + * + * @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 void clearCategoryParent(String userId, + String glossaryParentCategoryGUID, + String glossaryChildCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearCategoryParent(userId, null, null, glossaryParentCategoryGUID, glossaryChildCategoryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the metadata element representing a glossary category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void removeGlossaryCategory(String userId, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeGlossaryCategory(userId, null, null, glossaryCategoryGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary category metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param glossaryGUID optional glossary unique identifier to scope the search to a glossary. + * @param searchString string to find in the properties + * @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 findGlossaryCategories(String userId, + String glossaryGUID, + String searchString, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.findGlossaryCategories(userId, null, null, glossaryGUID, searchString, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Return the list of categories associated with a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary to query + * @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 metadata elements describing the categories associated with the requested glossary + * + * @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 getCategoriesForGlossary(String userId, + String glossaryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getCategoriesForGlossary(userId, null, null, glossaryGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary category metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param glossaryGUID optional glossary unique identifier to scope the search to a glossary. + * @param name name to search for + * @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 getGlossaryCategoriesByName(String userId, + String glossaryGUID, + String name, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossaryCategoriesByName(userId, null, null, glossaryGUID, name, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the glossary category metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the requested metadata element + * @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 requested metadata element + * + * @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 GlossaryCategoryElement getGlossaryCategoryByGUID(String userId, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossaryCategoryByGUID(userId, null, null, glossaryCategoryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the glossary category metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the requested metadata element + * @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 parent glossary category element + * + * @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 GlossaryCategoryElement getGlossaryCategoryParent(String userId, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossaryCategoryParent(userId, null, null, glossaryCategoryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the glossary category metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the requested metadata element + * @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 glossary category element + * + * @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 getGlossarySubCategories(String userId, + String glossaryCategoryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossarySubCategories(userId, null, null, glossaryCategoryGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /* =============================================================================== + * A glossary typically contains many glossary terms, linked with relationships. + */ + + /** + * Create a new metadata element to represent a glossary term. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param glossaryTermProperties properties for the glossary term + * @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 unique identifier of the new metadata element for the glossary term + * + * @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 String createGlossaryTerm(String userId, + String glossaryGUID, + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createGlossaryTerm(userId, null, null, false, glossaryGUID, null, glossaryTermProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a new metadata element to represent a glossary term whose lifecycle is managed through a controlled workflow. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param glossaryTermProperties properties for the glossary term + * @param initialStatus glossary term status to use when the object is created + * @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 unique identifier of the new metadata element for the glossary term + * + * @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 String createControlledGlossaryTerm(String userId, + String glossaryGUID, + GlossaryTermProperties glossaryTermProperties, + GlossaryTermStatus initialStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createControlledGlossaryTerm(userId, null, null, false, glossaryGUID, null, glossaryTermProperties, initialStatus, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a new metadata element to represent a glossary term using an existing metadata element as a template. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * + * @return unique identifier of the new metadata element for the glossary term + * + * @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 String createGlossaryTermFromTemplate(String userId, + String glossaryGUID, + String templateGUID, + TemplateProperties templateProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createGlossaryTermFromTemplate(userId, null, null, false, glossaryGUID, templateGUID, null, templateProperties); + } + + + /** + * Update the metadata element representing a glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param glossaryTermProperties new properties for the glossary term + * @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? + * + * @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 void updateGlossaryTerm(String userId, + String glossaryTermGUID, + boolean isMergeUpdate, + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateGlossaryTerm(userId, null, null, glossaryTermGUID, null, isMergeUpdate, glossaryTermProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Update the status of the metadata element representing a glossary term. This is only valid on + * a controlled glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the glossary term to update + * @param glossaryTermStatus new properties for the glossary term + * @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? + * + * @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 void updateGlossaryTermStatus(String userId, + String glossaryTermGUID, + GlossaryTermStatus glossaryTermStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateGlossaryTermStatus(userId, null, null, glossaryTermGUID, null, glossaryTermStatus, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Link a term to a category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the glossary category + * @param glossaryTermGUID unique identifier of the glossary term + * @param categorizationProperties properties for the categorization relationship + * @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? + * + * @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 void setupTermCategory(String userId, + String glossaryCategoryGUID, + String glossaryTermGUID, + GlossaryTermCategorization categorizationProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setupTermCategory(userId, null, null, glossaryCategoryGUID, glossaryTermGUID, categorizationProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Unlink a term from a category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the glossary category + * @param glossaryTermGUID unique identifier of the glossary term + * @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? + * + * @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 void clearTermCategory(String userId, + String glossaryCategoryGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermCategory(userId, null, null, glossaryCategoryGUID, glossaryTermGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Link two terms together using a specialist relationship. + * + * @param userId calling user + * @param relationshipTypeName name of the type of relationship to create + * @param glossaryTermOneGUID unique identifier of the glossary term at end 1 + * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 + * @param relationshipsProperties properties for the relationship + * @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? + * + * @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 void setupTermRelationship(String userId, + String relationshipTypeName, + String glossaryTermOneGUID, + String glossaryTermTwoGUID, + GlossaryTermRelationship relationshipsProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setupTermRelationship(userId, null, null, relationshipTypeName, glossaryTermOneGUID, glossaryTermTwoGUID, relationshipsProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Update the relationship properties for the two terms. + * + * @param userId calling user + * @param relationshipTypeName name of the type of relationship to create + * @param glossaryTermOneGUID unique identifier of the glossary term at end 1 + * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 + * @param relationshipsProperties properties for the relationship + * @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? + * + * @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 void updateTermRelationship(String userId, + String relationshipTypeName, + String glossaryTermOneGUID, + String glossaryTermTwoGUID, + GlossaryTermRelationship relationshipsProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateTermRelationship(userId, null, null, relationshipTypeName, glossaryTermOneGUID, glossaryTermTwoGUID, relationshipsProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the relationship between two terms. + * + * @param userId calling user + * @param relationshipTypeName name of the type of relationship to create + * @param glossaryTermOneGUID unique identifier of the glossary term at end 1 + * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 + * @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? + * + * @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 void clearTermRelationship(String userId, + String relationshipTypeName, + String glossaryTermOneGUID, + String glossaryTermTwoGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermRelationship(userId, null, null, relationshipTypeName, glossaryTermOneGUID, glossaryTermTwoGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes an abstract concept. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void setTermAsAbstractConcept(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsAbstractConcept(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the abstract concept designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsAbstractConcept(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsAbstractConcept(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes a data value. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void setTermAsDataValue(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsDataValue(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the data value designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsDataValue(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsDataValue(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes a data value. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @param properties type of activity + * @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? + * + * @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 void setTermAsActivity(String userId, + String glossaryTermGUID, + ActivityDescriptionProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsActivity(userId, null, null, glossaryTermGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the activity designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsActivity(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsActivity(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes a context. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @param contextDefinition more details of the context + * @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? + * + * @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 void setTermAsContext(String userId, + String glossaryTermGUID, + GlossaryTermContextDefinition contextDefinition, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsContext(userId, null, null, glossaryTermGUID, null, contextDefinition, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the context definition designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsContext(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsContext(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes a spine object. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void setTermAsSpineObject(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsSpineObject(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the spine object designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsSpineObject(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsSpineObject(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes a spine attribute. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void setTermAsSpineAttribute(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsSpineAttribute(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the spine attribute designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsSpineAttribute(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsSpineAttribute(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the glossary term to indicate that it describes an object identifier. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void setTermAsObjectIdentifier(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setTermAsObjectIdentifier(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the object identifier designation from the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 void clearTermAsObjectIdentifier(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearTermAsObjectIdentifier(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Undo the last update to the glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to update + * @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? + * + * @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 GlossaryTermElement undoGlossaryTermUpdate(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.undoGlossaryTermUpdate(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Archive the metadata element representing a glossary term. This removes it from normal access. However, it is still available + * for lineage requests. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to archive + * @param archiveProperties option parameters about the archive process + * @param effectiveTime the time that the retrieved elements must be effective for + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * + * @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 void archiveGlossaryTerm(String userId, + String glossaryTermGUID, + ArchiveProperties archiveProperties, + Date effectiveTime, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.archiveGlossaryTerm(userId, null, null, glossaryTermGUID, null, archiveProperties, effectiveTime, forDuplicateProcessing); + } + + + /** + * Remove the metadata element representing a glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void removeGlossaryTerm(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeGlossaryTerm(userId, null, null, glossaryTermGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary term metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary to query + * @param searchString string to find in the properties + * @param limitResultsByStatus By default, terms in all statuses are returned. However, it is possible + * to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values. + * @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 findGlossaryTerms(String userId, + String glossaryGUID, + String searchString, + List limitResultsByStatus, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.findGlossaryTerms(userId, null, null, glossaryGUID, searchString, limitResultsByStatus, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary terms associated with a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary of interest + * @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 associated 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 getTermsForGlossary(String userId, + String glossaryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getTermsForGlossary(userId, null, null, glossaryGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary terms associated with a glossary category. + * + * @param userId calling user + * @param glossaryCategoryGUID unique identifier of the glossary category of interest + * @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 associated 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 getTermsForGlossaryCategory(String userId, + String glossaryCategoryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getTermsForGlossaryCategory(userId, null, null, glossaryCategoryGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of glossary term metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the glossary to query + * @param name name to search for + * @param limitResultsByStatus By default, terms in all statuses are returned. However, it is possible + * to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values. + * @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 getGlossaryTermsByName(String userId, + String glossaryGUID, + String name, + List limitResultsByStatus, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossaryTermsByName(userId, null, null, glossaryGUID, name, limitResultsByStatus, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the glossary term metadata element with the supplied unique identifier. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of the requested metadata element + * @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 matching metadata element + * + * @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 GlossaryTermElement getGlossaryTermByGUID(String userId, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossaryTermByGUID(userId, null, null, glossaryTermGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve all the versions of a glossary term. + * + * @param userId calling user + * @param glossaryTermGUID unique identifier of object to retrieve + * @param fromTime the earliest point in time from which to retrieve historical versions of the entity (inclusive) + * @param toTime the latest point in time from which to retrieve historical versions of the entity (exclusive) + * @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 oldestFirst defining how the results should be ordered. + * @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) + * @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. + */ + @Override + public List getGlossaryTermHistory(String userId, + String glossaryTermGUID, + Date fromTime, + Date toTime, + int startFrom, + int pageSize, + boolean oldestFirst, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return client.getGlossaryTermHistory(userId, null, null, glossaryTermGUID, fromTime, toTime, startFrom, pageSize, oldestFirst, forLineage, forDuplicateProcessing, effectiveTime); + } + + + /* ========================================================================================= + * 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. + * It is possible that the external glossary resource may have been generated by the metadata + * representation or vice versa. + */ + + + /** + * Create a link to an external glossary resource. This is associated with a glossary to show that they have equivalent content. + * It is possible that this resource was generated from the glossary content or was the source for it. + * + * @param userId calling user + * @param linkProperties properties of the link + * + * @return unique identifier of the external reference + * + * @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 String createExternalGlossaryLink(String userId, + ExternalGlossaryLinkProperties linkProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.createExternalGlossaryLink(userId, null, null, linkProperties); + } + + + /** + * Update the properties of a reference to an external glossary resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param linkProperties properties of the link + * @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? + * + * @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 void updateExternalGlossaryLink(String userId, + String externalLinkGUID, + boolean isMergeUpdate, + ExternalGlossaryLinkProperties linkProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.updateExternalGlossaryLink(userId, null, null, externalLinkGUID, isMergeUpdate, linkProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove information about a link to an external glossary resource (and the relationships that attached it to the glossaries). + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @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? + * + * @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 void removeExternalGlossaryLink(String userId, + String externalLinkGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeExternalGlossaryLink(userId, null, null, externalLinkGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Connect a glossary to a reference to an external glossary resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryGUID unique identifier of the metadata element to attach + * @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? + * + * @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 void attachExternalLinkToGlossary(String userId, + String externalLinkGUID, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.attachExternalLinkToGlossary(userId, null, null, externalLinkGUID, glossaryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Disconnect a glossary from a reference to an external glossary resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryGUID unique identifier of the metadata element to remove + * @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? + * + * @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 void detachExternalLinkFromGlossary(String userId, + String externalLinkGUID, + String glossaryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.detachExternalLinkFromGlossary(userId, null, null, externalLinkGUID, glossaryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Retrieve the list of links to external glossary resources attached to a glossary. + * + * @param userId calling user + * @param glossaryGUID unique identifier of the metadata element for the glossary of interest + * @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 attached links to external glossary resources + * + * @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 getExternalLinksForGlossary(String userId, + String glossaryGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getExternalLinksForGlossary(userId, null, null, glossaryGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Return the glossaries connected to an external glossary source. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the metadata element for the external glossary link of interest + * @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 glossaries + * + * @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 getGlossariesForExternalLink(String userId, + String externalLinkGUID, + int startFrom, + int pageSize, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return client.getGlossariesForExternalLink(userId, null, null, externalLinkGUID, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a link to an external glossary category resource. This is associated with a category to show that they have equivalent content. + * It is possible that this resource was generated from the glossary content or was the source for it. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryCategoryGUID unique identifier for the glossary category + * @param linkProperties properties of the link + * @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? + * + * @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 void attachExternalCategoryLink(String userId, + String externalLinkGUID, + String glossaryCategoryGUID, + ExternalGlossaryElementLinkProperties linkProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.attachExternalCategoryLink(userId, null, null, externalLinkGUID, glossaryCategoryGUID, linkProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the link to an external glossary category resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryCategoryGUID unique identifier for the glossary category + * @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? + * + * @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 void detachExternalCategoryLink(String userId, + String externalLinkGUID, + String glossaryCategoryGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.detachExternalCategoryLink(userId, null, null, externalLinkGUID, glossaryCategoryGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Create a link to an external glossary term resource. This is associated with a term to show that they have equivalent content. + * It is possible that this resource was generated from the glossary content or was the source for it. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryTermGUID unique identifier for the glossary category + * @param linkProperties properties of the link + * @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? + * + * @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 void attachExternalTermLink(String userId, + String externalLinkGUID, + String glossaryTermGUID, + ExternalGlossaryElementLinkProperties linkProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.attachExternalTermLink(userId, null, null, externalLinkGUID, glossaryTermGUID, linkProperties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the link to an external glossary term resource. + * + * @param userId calling user + * @param externalLinkGUID unique identifier of the external reference + * @param glossaryTermGUID unique identifier for the glossary category + * @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? + * + * @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 void detachExternalTermLink(String userId, + String externalLinkGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.detachExternalTermLink(userId, null, null, externalLinkGUID, glossaryTermGUID, effectiveTime, forLineage, forDuplicateProcessing); + } +} 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 new file mode 100644 index 00000000000..2c8d0073e74 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/StewardshipManagementClient.java @@ -0,0 +1,685 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.client.management; + +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.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +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.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 java.util.Date; + + +/** + * StewardshipExchangeClient is the client for assigning relationships and classifications that help govern both metadata and its associated + * resources. + */ +public class StewardshipManagementClient implements StewardshipManagementInterface +{ + private final StewardshipExchangeClient client; + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipManagementClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + client = new StewardshipExchangeClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipManagementClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + client = new StewardshipExchangeClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipManagementClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + client = new StewardshipExchangeClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * @param auditLog logging destination + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipManagementClient(String serverName, + String serverPlatformURLRoot, + AssetManagerRESTClient restClient, + int maxPageSize, + AuditLog auditLog) throws InvalidParameterException + { + client = new StewardshipExchangeClient(serverName, serverPlatformURLRoot, restClient, maxPageSize, auditLog); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST services + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public StewardshipManagementClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + client = new StewardshipExchangeClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Classify/reclassify the element (typically an asset) to indicate the level of confidence that the organization + * has that the data is complete, accurate and up-to-date. The level of confidence is expressed by the + * levelIdentifier property. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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 void setConfidenceClassification(String userId, + String elementGUID, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setConfidenceClassification(userId, null, null, elementGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidence to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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 void clearConfidenceClassification(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearConfidenceClassification(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * 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. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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 void setCriticalityClassification(String userId, + String elementGUID, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setCriticalityClassification(userId, null, null, elementGUID, properties, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the criticality classification from the element. This normally occurs when the organization has lost track of the level of + * criticality to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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 void clearCriticalityClassification(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearCriticalityClassification(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * 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 + * of confidentiality is a suggestion for any element linked to the glossary term via the SemanticAssignment classification. + * The level of confidence is expressed by the levelIdentifier property. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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 void setConfidentialityClassification(String userId, + String elementGUID, + GovernanceClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setConfidentialityClassification(userId, null, null, elementGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidentiality to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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 void clearConfidentialityClassification(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearConfidentialityClassification(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * 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 + * property. The dates after which the element/resource is archived and then deleted are specified in the archiveAfter and deleteAfter + * properties respectively. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @param properties details of the classification + * @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? + * + * @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 void setRetentionClassification(String userId, + String elementGUID, + RetentionClassificationProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setRetentionClassification(userId, null, null, elementGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the retention classification from the element. This normally occurs when the organization has lost track of, or no longer needs to + * track the retention period to assign to the element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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? + * + * @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 void clearRetentionClassification(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearRetentionClassification(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Add or replace the security tags for an element. + * + * @param userId calling user + * @param elementGUID element to link it to - its type must inherit from Referenceable. + * @param properties details of the security tags + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void addSecurityTags(String userId, + String elementGUID, + SecurityTagsProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.addSecurityTags(userId, null, null, elementGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the security tags classification from an element. + * + * @param userId calling user + * @param elementGUID element where the security tags need to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void clearSecurityTags(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearSecurityTags(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Add or replace the ownership classification for an element. + * + * @param userId calling user + * @param elementGUID element to link it to - its type must inherit from Referenceable. + * @param properties details of the ownership + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void addOwnership(String userId, + String elementGUID, + OwnerProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.addOwnership(userId, null, null, elementGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the ownership classification from an element. + * + * @param userId calling user + * @param elementGUID element where the classification needs to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void clearOwnership(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearOwnership(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Add or replace the origin classification for an asset. + * + * @param userId calling user + * @param assetGUID element to link it to - its type must inherit from Asset. + * @param properties details of the origin + * @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? + * + * @throws InvalidParameterException element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void addAssetOrigin(String userId, + String assetGUID, + AssetOriginProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.addAssetOrigin(userId, null, null, assetGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the origin classification from an asset. + * + * @param userId calling user + * @param assetGUID element where the classification needs to be removed. + * @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? + * + * @throws InvalidParameterException asset or element not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public void clearAssetOrigin(String userId, + String assetGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearAssetOrigin(userId, null, null, assetGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Classify the element to assert that the definitions it represents are part of a subject area definition. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @param properties qualified name of subject area + * @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? + * + * @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 void addElementToSubjectArea(String userId, + String elementGUID, + SubjectAreaMemberProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.addElementToSubjectArea(userId, null, null, elementGUID, null, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the subject area designation from the identified element. + * + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @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? + * + * @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 void removeElementFromSubjectArea(String userId, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeElementFromSubjectArea(userId, null, null, elementGUID, null, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * 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. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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? + * + * @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 void setupSemanticAssignment(String userId, + String elementGUID, + String glossaryTermGUID, + SemanticAssignmentProperties properties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.setupSemanticAssignment(userId, null, null, elementGUID, glossaryTermGUID, properties, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove a semantic assignment relationship between an element and its glossary term. + * + * @param userId calling user + * @param elementGUID unique identifier of the element that is being assigned to the glossary term + * @param glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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? + * + * @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 void clearSemanticAssignment(String userId, + String elementGUID, + String glossaryTermGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.clearSemanticAssignment(userId, null, null, elementGUID, glossaryTermGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Link a governance definition to an element using the GovernedBy relationship. + * + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to link + * @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? + * + * @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 void addGovernanceDefinitionToElement(String userId, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.addGovernanceDefinitionToElement(userId, null, null, definitionGUID, elementGUID, effectiveTime, forLineage, forDuplicateProcessing); + } + + + /** + * Remove the GovernedBy relationship between a governance definition and an element. + * + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to update + * @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? + * + * @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 void removeGovernanceDefinitionFromElement(String userId, + String definitionGUID, + String elementGUID, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + client.removeGovernanceDefinitionFromElement(userId, null, null, definitionGUID, elementGUID, effectiveTime, forLineage, forDuplicateProcessing); + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/package-info.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/package-info.java new file mode 100644 index 00000000000..2d7d8c554b5 --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/management/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * These are the Java clients for the Asset Manager OMAS that are used by catalog services that wish to use Egeria as their metadata services. + */ +package org.odpi.openmetadata.accessservices.assetmanager.client.management; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/package-info.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/package-info.java index ee1bc89b520..b8c9953be9f 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/package-info.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/package-info.java @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ /** - * These are the Java clients for the Asset Manager OMAS. + * These are the Java clients for the Asset Manager OMAS that can be used either by integration services or external asset managers that are + * using Egeria directly as their metadata management services. */ package org.odpi.openmetadata.accessservices.assetmanager.client; 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 373c271834a..ffbcbe2eac7 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 @@ -89,6 +89,35 @@ public AssetManagerRESTClient(String serverName, } + + /** + * Issue a POST REST call that returns a RelatedElementsResponse 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 RelatedElementsResponse callRelatedElementsPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + RelatedElementsResponse restResult = this.callPostRESTCall(methodName, RelatedElementsResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a POST REST call that returns a ExternalReferenceElementResponse object. * @@ -368,6 +397,7 @@ public CommentElementsResponse callCommentElementsPostRESTCall(String methodN * * @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 @@ -375,13 +405,14 @@ public CommentElementsResponse callCommentElementsPostRESTCall(String methodN * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public CommentElementResponse callCommentElementGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public CommentElementResponse callCommentElementPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - CommentElementResponse restResult = this.callGetRESTCall(methodName, CommentElementResponse.class, urlTemplate, params); + CommentElementResponse restResult = this.callPostRESTCall(methodName, CommentElementResponse.class, urlTemplate, requestBody, params); exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); @@ -444,10 +475,11 @@ public NoteLogElementsResponse callNoteLogElementsPostRESTCall(String methodN /** - * Issue a GET REST call that returns a NoteLogElementResponse object. + * Issue a POST REST call that returns a NoteLogElementResponse 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 @@ -455,13 +487,14 @@ public NoteLogElementsResponse callNoteLogElementsPostRESTCall(String methodN * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public NoteLogElementResponse callNoteLogElementGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, + public NoteLogElementResponse callNoteLogElementPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - NoteLogElementResponse restResult = this.callGetRESTCall(methodName, NoteLogElementResponse.class, urlTemplate, params); + NoteLogElementResponse restResult = this.callPostRESTCall(methodName, NoteLogElementResponse.class, urlTemplate, requestBody, params); exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); @@ -499,10 +532,11 @@ public NoteElementsResponse callNoteElementsPostRESTCall(String methodName, /** - * Issue a GET REST call that returns a NoteLogElementResponse object. + * Issue a POST REST call that returns a NoteLogElementResponse 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 @@ -510,13 +544,14 @@ public NoteElementsResponse callNoteElementsPostRESTCall(String methodName, * @throws UserNotAuthorizedException the user is not authorized to make this request. * @throws PropertyServerException the repository is not available or not working properly. */ - public NoteElementResponse callNoteElementGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public NoteElementResponse callNoteElementPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - NoteElementResponse restResult = this.callGetRESTCall(methodName, NoteElementResponse.class, urlTemplate, params); + NoteElementResponse restResult = this.callPostRESTCall(methodName, NoteElementResponse.class, urlTemplate, requestBody, params); exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/CommentConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/CommentConverter.java index 611a1c6984c..4532e681737 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/CommentConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/CommentConverter.java @@ -86,7 +86,6 @@ public B getNewBean(Class beanClass, properties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); properties.setCommentText(this.removeCommentText(instanceProperties)); properties.setCommentType(this.removeCommentTypeFromProperties(instanceProperties)); - properties.setIsPublic(this.removeIsPublic(instanceProperties)); /* * Any remaining properties are returned in the extended properties. They are diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/LikeConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/LikeConverter.java index c41c0c874b7..8ddfc574708 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/LikeConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/LikeConverter.java @@ -76,8 +76,6 @@ public B getNewBean(Class beanClass, { instanceProperties = new InstanceProperties(entity.getProperties()); properties.setUser(entity.getCreatedBy()); - - properties.setIsPublic(this.removeIsPublic(instanceProperties)); } else { diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RatingConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RatingConverter.java index e9934771c63..15d6511213b 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RatingConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/RatingConverter.java @@ -84,7 +84,6 @@ public B getNewBean(Class beanClass, properties.setReview(this.removeReview(instanceProperties)); properties.setStarRating(this.removeStarRatingFromProperties(instanceProperties)); - properties.setIsPublic(this.removeIsPublic(instanceProperties)); } else { 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 new file mode 100644 index 00000000000..b68d6f3763a --- /dev/null +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/CommentExchangeHandler.java @@ -0,0 +1,636 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.assetmanager.handlers; + +import org.odpi.openmetadata.accessservices.assetmanager.converters.CommentConverter; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.MetadataElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentType; +import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.generichandlers.CommentHandler; +import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; +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.metadatasecurity.server.OpenMetadataServerSecurityVerifier; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; + +import java.util.Date; +import java.util.List; + +/** + * CommentExchangeHandler is the server side handler for managing comments. + */ +public class CommentExchangeHandler extends ExchangeHandlerBase +{ + private final CommentHandler commentHandler; + + private final static String commentGUIDParameterName = "commentGUID"; + + /** + * Construct the comment exchange handler with information needed to work with comment related objects + * for Asset Manager OMAS. + * + * @param serviceName name of this service + * @param serverName name of the local server + * @param invalidParameterHandler handler for managing parameter errors + * @param repositoryHandler manages calls to the repository services + * @param repositoryHelper provides utilities for manipulating the repository services objects + * @param localServerUserId userId for this server + * @param securityVerifier open metadata security services verifier + * @param supportedZones list of zones that the access service is allowed to serve instances from. + * @param defaultZones list of zones that the access service should set in all new instances. + * @param publishZones list of zones that the access service sets up in published instances. + * @param auditLog destination for audit log events. + */ + public CommentExchangeHandler(String serviceName, + String serverName, + InvalidParameterHandler invalidParameterHandler, + RepositoryHandler repositoryHandler, + OMRSRepositoryHelper repositoryHelper, + String localServerUserId, + OpenMetadataServerSecurityVerifier securityVerifier, + List supportedZones, + List defaultZones, + List publishZones, + AuditLog auditLog) + { + super(serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + + commentHandler = new CommentHandler<>(new CommentConverter<>(repositoryHelper, serviceName, serverName), + CommentElement.class, + serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); + } + + + + /* ======================================================== + * Managing the externalIds and related correlation properties. + */ + + + /** + * Update each returned element with details of the correlation properties for the supplied asset manager. + * + * @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 results list of elements + * @param methodName calling method + * + * @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) + */ + private void addCorrelationPropertiesToComments(String userId, + String assetManagerGUID, + String assetManagerName, + List results, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + if ((results != null) && (assetManagerGUID != null)) + { + for (MetadataElement comment : results) + { + if ((comment != null) && (comment.getElementHeader() != null) && (comment.getElementHeader().getGUID() != null)) + { + comment.setCorrelationHeaders(this.getCorrelationProperties(userId, + comment.getElementHeader().getGUID(), + commentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + assetManagerGUID, + assetManagerName, + false, + false, + null, + methodName)); + } + } + } + } + + + /** + * Create a new comment. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param isPublic is this visible to other people + * @param commentProperties properties to store + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param methodName calling method + * + * @return unique identifier of the new metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public String createComment(String userId, + String guid, + String guidParameterName, + MetadataCorrelationProperties correlationProperties, + boolean isPublic, + CommentProperties commentProperties, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String propertiesParameterName = "commentProperties"; + final String qualifiedNameParameterName = "commentProperties.qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + + invalidParameterHandler.validateObject(commentProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(commentProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + int commentType = CommentType.STANDARD_COMMENT.getOpenTypeOrdinal(); + + if (commentProperties.getCommentType() != null) + { + commentType = commentProperties.getCommentType().getOpenTypeOrdinal(); + } + + String commentGUID = commentHandler.attachNewComment(userId, + correlationProperties.getAssetManagerGUID(), + getExternalSourceName(correlationProperties), + guid, + guid, + guidParameterName, + commentType, + commentProperties.getCommentText(), + isPublic, + commentProperties.getEffectiveFrom(), + commentProperties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + null, + methodName); + + if (commentGUID != null) + { + this.createExternalIdentifier(userId, + commentGUID, + commentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + + return commentGUID; + } + + + /** + * Update the metadata element representing a comment. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param commentGUID unique identifier of the metadata element to update + * @param commentProperties new properties for this element + * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void updateComment(String userId, + MetadataCorrelationProperties correlationProperties, + String commentGUID, + CommentProperties commentProperties, + boolean isMergeUpdate, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String propertiesParameterName = "commentProperties"; + final String qualifiedNameParameterName = "commentProperties.qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameterName, methodName); + invalidParameterHandler.validateObject(commentProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(commentProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + int commentType = CommentType.STANDARD_COMMENT.getOpenTypeOrdinal(); + + if (commentProperties.getCommentType() != null) + { + commentType = commentProperties.getCommentType().getOpenTypeOrdinal(); + } + + this.validateExternalIdentifier(userId, + commentGUID, + commentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + commentHandler.updateComment(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + commentGUID, + commentGUIDParameterName, + commentProperties.getQualifiedName(), + commentType, + commentProperties.getCommentText(), + isPublic, + isMergeUpdate, + commentProperties.getEffectiveFrom(), + commentProperties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Remove the metadata element representing a comment. This will delete the comment and all comment replies. + * + * @param userId calling user + * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param commentGUID unique identifier of the metadata element to remove + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeComment(String userId, + MetadataCorrelationProperties correlationProperties, + String commentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameterName, methodName); + + this.validateExternalIdentifier(userId, + commentGUID, + commentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + correlationProperties, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (correlationProperties != null) + { + commentHandler.removeCommentFromElement(userId, + correlationProperties.getAssetManagerGUID(), + correlationProperties.getAssetManagerName(), + commentGUID, + commentGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + else + { + commentHandler.removeCommentFromElement(userId, + null, + null, + commentGUID, + commentGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + } + + + + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @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 questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param isPublic who can retrieve the relationship + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void setupAcceptedAnswer(String userId, + String assetManagerGUID, + String assetManagerName, + String questionCommentGUID, + String answerCommentGUID, + boolean isPublic, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String questionCommentGUIDParameterName = "questionCommentGUID"; + final String answerCommentGUIDParameterName = "answerCommentGUID"; + + commentHandler.setupAcceptedAnswer(userId, + assetManagerGUID, + assetManagerName, + questionCommentGUID, + questionCommentGUIDParameterName, + answerCommentGUID, + answerCommentGUIDParameterName, + isPublic, + effectiveFrom, + effectiveTo, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + + externalIdentifierHandler.logRelationshipCreation(assetManagerGUID, + assetManagerName, + OpenMetadataAPIMapper.ANSWER_RELATIONSHIP_TYPE_GUID, + questionCommentGUID, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + answerCommentGUID, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + methodName); + } + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @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 questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime optional date for effective time of the query. Null means any effective time + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void clearAcceptedAnswer(String userId, + String assetManagerGUID, + String assetManagerName, + String questionCommentGUID, + String answerCommentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String questionCommentGUIDParameterName = "questionCommentGUID"; + final String answerCommentGUIDParameterName = "answerCommentGUID"; + + commentHandler.clearAcceptedAnswer(userId, + assetManagerGUID, + assetManagerName, + questionCommentGUID, + questionCommentGUIDParameterName, + answerCommentGUID, + answerCommentGUIDParameterName, + effectiveTime, + forLineage, + forDuplicateProcessing, + methodName); + + externalIdentifierHandler.logRelationshipRemoval(assetManagerGUID, + assetManagerName, + OpenMetadataAPIMapper.ANSWER_RELATIONSHIP_TYPE_NAME, + questionCommentGUID, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + answerCommentGUID, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + methodName); + } + + + /** + * Retrieve the list of comment metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @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 searchString string to find in the properties + * @param searchStringParameterName name of parameter for search string + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @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 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) + */ + public List findComments(String userId, + String assetManagerGUID, + String assetManagerName, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = commentHandler.findBeans(userId, + searchString, + searchStringParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_GUID, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + "qualifiedName", + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + addCorrelationPropertiesToComments(userId, assetManagerGUID, assetManagerName, results , methodName); + + return results; + } + + + /** + * Return the comments attached to an 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 elementGUID unique identifier for the element where the like is attached. + * @param elementGUIDParameterName name of parameter for elementGUID + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * @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 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) + */ + public List getAttachedComments(String userId, + String assetManagerGUID, + String assetManagerName, + String elementGUID, + String elementGUIDParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List results = commentHandler.getComments(userId, + elementGUID, + elementGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + addCorrelationPropertiesToComments(userId, assetManagerGUID, assetManagerName, results , methodName); + + return results; + } + + + /** + * Retrieve the comment metadata element with the supplied unique identifier. + * + * @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 commentGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now + * @param methodName calling method + * + * @return matching metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public CommentElement getCommentByGUID(String userId, + String assetManagerGUID, + String assetManagerName, + String commentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String guidParameterName = "commentGUID"; + + CommentElement comment = commentHandler.getBeanFromRepository(userId, + commentGUID, + guidParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + + if (comment != null) + { + comment.setCorrelationHeaders(this.getCorrelationProperties(userId, + commentGUID, + guidParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + assetManagerGUID, + assetManagerName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName)); + } + + return comment; + } +} diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java index f7519a4c3e4..cdf2e836078 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/DataAssetExchangeHandler.java @@ -26,6 +26,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; /** @@ -402,7 +403,92 @@ public void updateDataAsset(String userId, effectiveTime, methodName); } - + + + /** + * Add the asset origin classification to an asset. The method needs to build a before an after image of the + * asset to perform a security check before the update is pushed to the repository. + * + * @param userId calling user + * @param assetGUID unique identifier of asset + * @param assetGUIDParameterName parameter name supplying assetGUID + * @param organizationGUID Unique identifier (GUID) of the organization where this asset originated from - or null + * @param organizationGUIDParameterName parameter name supplying organizationGUID + * @param businessCapabilityGUID Unique identifier (GUID) of the business capability where this asset originated from. + * @param businessCapabilityGUIDParameterName parameter name supplying businessCapabilityGUID + * @param otherOriginValues Descriptive labels describing origin of the asset + * @param effectiveFrom the time that the elements must be effective from (null for any time) + * @param effectiveTo the time that the elements must be effective from (null for any time) + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @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 + * + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void addAssetOrigin(String userId, + String assetGUID, + String assetGUIDParameterName, + String organizationGUID, + String organizationGUIDParameterName, + String businessCapabilityGUID, + String businessCapabilityGUIDParameterName, + Map otherOriginValues, + Date effectiveFrom, + Date effectiveTo, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + assetHandler.addAssetOrigin(userId, + assetGUID, + assetGUIDParameterName, + organizationGUID, + organizationGUIDParameterName, + businessCapabilityGUID, + businessCapabilityGUIDParameterName, + otherOriginValues, effectiveFrom, + effectiveTo, isMergeUpdate, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Remove the asset origin classification to an asset. + * + * @param userId calling user + * @param assetGUID unique identifier of asset + * @param assetGUIDParameterName parameter name supplying assetGUID + * @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 + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void removeAssetOrigin(String userId, + String assetGUID, + String assetGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + assetHandler.removeAssetOrigin(userId, assetGUID, assetGUIDParameterName, forLineage, forDuplicateProcessing, effectiveTime, methodName); + } /** * Update the zones for the asset so that it becomes visible to consumers. 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 5b7d2f7eae3..919ed08ce49 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 @@ -17,7 +17,6 @@ import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.HistorySequencingOrder; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; -import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; @@ -284,6 +283,7 @@ private void addCorrelationPropertiesToGlossaryTerms(String u * * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryProperties properties to store * @param methodName calling method * @@ -295,6 +295,7 @@ private void addCorrelationPropertiesToGlossaryTerms(String u */ public String createGlossary(String userId, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, GlossaryProperties glossaryProperties, String methodName) throws InvalidParameterException, UserNotAuthorizedException, @@ -309,6 +310,8 @@ public String createGlossary(String userId, invalidParameterHandler.validateName(glossaryProperties.getQualifiedName(), qualifiedNameParameterName, methodName); String glossaryGUID = glossaryHandler.createGlossary(userId, + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), glossaryProperties.getQualifiedName(), glossaryProperties.getDisplayName(), glossaryProperties.getDescription(), @@ -345,6 +348,7 @@ public String createGlossary(String userId, * * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template * @param methodName calling method @@ -357,6 +361,7 @@ public String createGlossary(String userId, */ public String createGlossaryFromTemplate(String userId, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, String templateGUID, TemplateProperties templateProperties, String methodName) throws InvalidParameterException, @@ -371,6 +376,8 @@ public String createGlossaryFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); String glossaryGUID = glossaryHandler.createGlossaryFromTemplate(userId, + this.getExternalSourceGUID(correlationProperties, assetManagerIsHome), + this.getExternalSourceName(correlationProperties, assetManagerIsHome), templateGUID, templateProperties.getQualifiedName(), templateProperties.getDisplayName(), @@ -401,6 +408,9 @@ public String createGlossaryFromTemplate(String userId, * @param glossaryGUID unique identifier of the metadata element to update * @param glossaryProperties new properties for this element * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid @@ -412,6 +422,9 @@ public void updateGlossary(String userId, String glossaryGUID, GlossaryProperties glossaryProperties, boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -429,12 +442,14 @@ public void updateGlossary(String userId, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); glossaryHandler.updateGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), glossaryGUID, glossaryGUIDParameterName, glossaryProperties.getQualifiedName(), @@ -446,6 +461,9 @@ public void updateGlossary(String userId, glossaryProperties.getTypeName(), glossaryProperties.getExtendedProperties(), isMergeUpdate, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -457,6 +475,9 @@ public void updateGlossary(String userId, * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid @@ -466,6 +487,9 @@ public void updateGlossary(String userId, public void removeGlossary(String userId, MetadataCorrelationProperties correlationProperties, String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -478,29 +502,20 @@ public void removeGlossary(String userId, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); - if (correlationProperties != null) - { - glossaryHandler.removeGlossary(userId, - correlationProperties.getAssetManagerGUID(), - correlationProperties.getAssetManagerName(), - glossaryGUID, - glossaryGUIDParameterName, - methodName); - } - else - { - glossaryHandler.removeGlossary(userId, - null, - null, - glossaryGUID, - glossaryGUIDParameterName, - methodName); - } + glossaryHandler.removeGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + glossaryGUID, + glossaryGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); } @@ -515,7 +530,10 @@ public void removeGlossary(String userId, * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata * @param glossaryGUID unique identifier of the metadata element to remove - * @param organizingPrinciple description of how the glossary is organized + * @param properties description of how the glossary is organized + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid @@ -525,7 +543,10 @@ public void removeGlossary(String userId, public void setGlossaryAsTaxonomy(String userId, MetadataCorrelationProperties correlationProperties, String glossaryGUID, - String organizingPrinciple, + TaxonomyProperties properties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -538,16 +559,37 @@ public void setGlossaryAsTaxonomy(String userId, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); - glossaryHandler.addTaxonomyClassificationToGlossary(userId, - glossaryGUID, - glossaryGUIDParameterName, - organizingPrinciple, - methodName); + if (properties != null) + { + glossaryHandler.addTaxonomyClassificationToGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + glossaryGUID, + glossaryGUIDParameterName, + properties.getOrganizingPrinciple(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + else + { + glossaryHandler.addTaxonomyClassificationToGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + glossaryGUID, + glossaryGUIDParameterName, + null, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } } @@ -557,18 +599,24 @@ public void setGlossaryAsTaxonomy(String userId, * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public void clearGlossaryAsTaxonomy(String userId, + public void clearGlossaryAsTaxonomy(String userId, MetadataCorrelationProperties correlationProperties, - String glossaryGUID, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); @@ -578,14 +626,19 @@ public void clearGlossaryAsTaxonomy(String userId, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); glossaryHandler.removeTaxonomyClassificationFromGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), glossaryGUID, glossaryGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -600,7 +653,10 @@ public void clearGlossaryAsTaxonomy(String userId, * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata * @param glossaryGUID unique identifier of the metadata element to remove - * @param scope description of the situations where this glossary is relevant. + * @param properties description of the situations where this glossary is relevant. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid @@ -610,7 +666,10 @@ public void clearGlossaryAsTaxonomy(String userId, public void setGlossaryAsCanonical(String userId, MetadataCorrelationProperties correlationProperties, String glossaryGUID, - String scope, + CanonicalVocabularyProperties properties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -623,16 +682,37 @@ public void setGlossaryAsCanonical(String userId, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); - glossaryHandler.addCanonicalVocabClassificationToGlossary(userId, - glossaryGUID, - glossaryGUIDParameterName, - scope, - methodName); + if (properties != null) + { + glossaryHandler.addCanonicalVocabClassificationToGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + glossaryGUID, + glossaryGUIDParameterName, + properties.getScope(), + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + else + { + glossaryHandler.addCanonicalVocabClassificationToGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), + glossaryGUID, + glossaryGUIDParameterName, + null, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } } @@ -643,6 +723,9 @@ public void setGlossaryAsCanonical(String userId, * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid @@ -652,6 +735,9 @@ public void setGlossaryAsCanonical(String userId, public void clearGlossaryAsCanonical(String userId, MetadataCorrelationProperties correlationProperties, String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -664,14 +750,19 @@ public void clearGlossaryAsCanonical(String userId, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); glossaryHandler.removeCanonicalVocabClassificationFromGlossary(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), glossaryGUID, glossaryGUIDParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -687,6 +778,9 @@ public void clearGlossaryAsCanonical(String userId, * @param searchStringParameterName name of parameter for search string * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @return list of matching metadata elements @@ -702,11 +796,22 @@ public List findGlossaries(String userId, String searchStringParameterName, int startFrom, int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - List results = glossaryHandler.findGlossaries(userId, searchString, searchStringParameterName, startFrom, pageSize,methodName); + List results = glossaryHandler.findGlossaries(userId, + searchString, + searchStringParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); addCorrelationPropertiesToGlossaries(userId, assetManagerGUID, assetManagerName, results , methodName); @@ -725,6 +830,9 @@ public List findGlossaries(String userId, * @param nameParameterName name of parameter supplying name value * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @return list of matching metadata elements @@ -740,11 +848,22 @@ public List getGlossariesByName(String userId, String nameParameterName, int startFrom, int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - List results = glossaryHandler.getGlossariesByName(userId, name, nameParameterName, startFrom, pageSize, methodName); + List results = glossaryHandler.getGlossariesByName(userId, + name, + nameParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); addCorrelationPropertiesToGlossaries(userId, assetManagerGUID, assetManagerName, results, methodName); @@ -760,6 +879,9 @@ public List getGlossariesByName(String userId, * @param assetManagerName unique name of software server capability representing the caller * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @return list of matching metadata elements @@ -773,6 +895,9 @@ public List getGlossariesForAssetManager(String userId, String assetManagerName, int startFrom, int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -793,9 +918,9 @@ public List getGlossariesForAssetManager(String userId, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, startFrom, pageSize, - null, - false, - false, + effectiveTime, + forLineage, + forDuplicateProcessing, methodName); if (glossaryEntities != null) @@ -817,9 +942,9 @@ public List getGlossariesForAssetManager(String userId, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, assetManagerGUID, assetManagerName, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName)); results.add(glossaryElement); @@ -845,7 +970,10 @@ public List getGlossariesForAssetManager(String userId, * @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 openMetadataGUID unique identifier of the requested metadata element + * @param glossaryGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param effectiveTime when should the elements be effected for - null is anytime; new Date() is now * @param methodName calling method * * @return matching metadata element @@ -857,26 +985,35 @@ public List getGlossariesForAssetManager(String userId, public GlossaryElement getGlossaryByGUID(String userId, String assetManagerGUID, String assetManagerName, - String openMetadataGUID, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - final String guidParameterName = "openMetadataGUID"; + final String guidParameterName = "glossaryGUID"; - GlossaryElement glossary = glossaryHandler.getGlossaryByGUID(userId, openMetadataGUID, guidParameterName, methodName); + GlossaryElement glossary = glossaryHandler.getGlossaryByGUID(userId, + glossaryGUID, + guidParameterName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); if (glossary != null) { glossary.setCorrelationHeaders(this.getCorrelationProperties(userId, - openMetadataGUID, + glossaryGUID, guidParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, assetManagerGUID, assetManagerName, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName)); } @@ -894,7 +1031,11 @@ public GlossaryElement getGlossaryByGUID(String userId, * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the category is located * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryCategoryProperties properties about the glossary category to store + * @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 unique identifier of the new glossary category @@ -906,7 +1047,11 @@ public GlossaryElement getGlossaryByGUID(String userId, public String createGlossaryCategory(String userId, String glossaryGUID, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, GlossaryCategoryProperties glossaryCategoryProperties, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -918,6 +1063,8 @@ public String createGlossaryCategory(String userId, invalidParameterHandler.validateName(glossaryCategoryProperties.getQualifiedName(), qualifiedNameParameterName, methodName); String glossaryCategoryGUID = glossaryCategoryHandler.createGlossaryCategory(userId, + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), glossaryGUID, glossaryGUIDParameterName, glossaryCategoryProperties.getQualifiedName(), @@ -928,7 +1075,7 @@ public String createGlossaryCategory(String userId, glossaryCategoryProperties.getExtendedProperties(), glossaryCategoryProperties.getEffectiveFrom(), glossaryCategoryProperties.getEffectiveTo(), - new Date(), + effectiveTime, methodName); if (glossaryCategoryGUID != null) @@ -938,9 +1085,9 @@ public String createGlossaryCategory(String userId, glossaryCategoryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, correlationProperties, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -953,6 +1100,8 @@ public String createGlossaryCategory(String userId, * * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the category is located * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template * @param methodName calling method @@ -965,12 +1114,15 @@ public String createGlossaryCategory(String userId, */ public String createGlossaryCategoryFromTemplate(String userId, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, + String glossaryGUID, String templateGUID, TemplateProperties templateProperties, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { + final String glossaryGUIDParameterName = "glossaryGUID"; final String templateGUIDParameterName = "templateGUID"; final String propertiesParameterName = "templateProperties"; @@ -979,6 +1131,10 @@ public String createGlossaryCategoryFromTemplate(String u invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); String glossaryCategoryGUID = glossaryCategoryHandler.createGlossaryCategoryFromTemplate(userId, + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), + glossaryGUID, + glossaryGUIDParameterName, templateGUID, templateProperties.getQualifiedName(), templateProperties.getDisplayName(), @@ -1047,6 +1203,8 @@ public void updateGlossaryCategory(String userId, methodName); glossaryCategoryHandler.updateGlossaryCategory(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), glossaryCategoryGUID, glossaryCategoryGUIDParameterName, glossaryCategoryProperties.getQualifiedName(), @@ -1101,6 +1259,8 @@ public void setupCategoryParent(String userId, final String glossaryChildCategoryGUIDParameterName = "glossaryChildCategoryGUID"; glossaryCategoryHandler.setupCategoryParent(userId, + assetManagerGUID, + assetManagerName, glossaryParentCategoryGUID, glossaryParentCategoryGUIDParameterName, glossaryChildCategoryGUID, @@ -1156,6 +1316,8 @@ public void clearCategoryParent(String userId, final String glossaryChildCategoryGUIDParameterName = "glossaryChildCategoryGUID"; glossaryCategoryHandler.clearCategoryParent(userId, + assetManagerGUID, + assetManagerName, glossaryParentCategoryGUID, glossaryParentCategoryGUIDParameterName, glossaryChildCategoryGUID, @@ -1212,6 +1374,8 @@ public void removeGlossaryCategory(String userId, methodName); glossaryCategoryHandler.removeGlossaryCategory(userId, + getExternalSourceGUID(correlationProperties), + getExternalSourceName(correlationProperties), glossaryCategoryGUID, glossaryCategoryGUIDParameterName, effectiveTime, @@ -1579,7 +1743,11 @@ public GlossaryCategoryElement getGlossaryCategoryByGUID(String userId, * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the term is located * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryTermProperties properties for the glossary term + * @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 unique identifier of the new metadata element for the glossary term @@ -1591,7 +1759,11 @@ public GlossaryCategoryElement getGlossaryCategoryByGUID(String userId, public String createGlossaryTerm(String userId, String glossaryGUID, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, GlossaryTermProperties glossaryTermProperties, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -1603,8 +1775,8 @@ public String createGlossaryTerm(String userId, invalidParameterHandler.validateName(glossaryTermProperties.getQualifiedName(), qualifiedNameParameterName, methodName); String glossaryTermGUID = glossaryTermHandler.createGlossaryTerm(userId, - getExternalSourceGUID(correlationProperties), - getExternalSourceName(correlationProperties), + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), glossaryGUID, glossaryGUIDParameterName, glossaryTermProperties.getQualifiedName(), @@ -1620,7 +1792,7 @@ public String createGlossaryTerm(String userId, InstanceStatus.ACTIVE, glossaryTermProperties.getEffectiveFrom(), glossaryTermProperties.getEffectiveTo(), - new Date(), + effectiveTime, methodName); if (glossaryTermGUID != null) @@ -1630,9 +1802,9 @@ public String createGlossaryTerm(String userId, glossaryTermGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, correlationProperties, - false, - false, - new Date(), + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -1688,9 +1860,13 @@ private InstanceStatus getInstanceStatus(GlossaryTermStatus status) * * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located * @param glossaryTermProperties properties for the glossary term * @param initialStatus glossary term status to use when the object is created + * @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 unique identifier of the new metadata element for the glossary term @@ -1702,8 +1878,12 @@ private InstanceStatus getInstanceStatus(GlossaryTermStatus status) public String createControlledGlossaryTerm(String userId, String glossaryGUID, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, GlossaryTermProperties glossaryTermProperties, GlossaryTermStatus initialStatus, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -1724,8 +1904,8 @@ public String createControlledGlossaryTerm(String userId, } String glossaryTermGUID = glossaryTermHandler.createGlossaryTerm(userId, - getExternalSourceGUID(correlationProperties), - getExternalSourceName(correlationProperties), + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), glossaryGUID, glossaryGUIDParameterName, glossaryTermProperties.getQualifiedName(), @@ -1741,7 +1921,7 @@ public String createControlledGlossaryTerm(String userId, getInstanceStatus(initialStatus), glossaryTermProperties.getEffectiveFrom(), glossaryTermProperties.getEffectiveTo(), - new Date(), + effectiveTime, methodName); if (glossaryTermGUID != null) @@ -1751,9 +1931,9 @@ public String createControlledGlossaryTerm(String userId, glossaryTermGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, correlationProperties, - false, - false, - new Date(), + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -1766,6 +1946,8 @@ public String createControlledGlossaryTerm(String userId, * * @param userId calling user * @param correlationProperties properties to help with the mapping of the elements in the external asset manager and open metadata + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the term is located * @param templateGUID unique identifier of the metadata element to copy * @param templateProperties properties that override the template * @param methodName calling method @@ -1778,6 +1960,8 @@ public String createControlledGlossaryTerm(String userId, */ public String createGlossaryTermFromTemplate(String userId, MetadataCorrelationProperties correlationProperties, + boolean assetManagerIsHome, + String glossaryGUID, String templateGUID, TemplateProperties templateProperties, String methodName) throws InvalidParameterException, @@ -1792,8 +1976,10 @@ public String createGlossaryTermFromTemplate(String userI invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); String glossaryTermGUID = glossaryTermHandler.createGlossaryTermFromTemplate(userId, - getExternalSourceGUID(correlationProperties), - getExternalSourceName(correlationProperties), + getExternalSourceGUID(correlationProperties, assetManagerIsHome), + getExternalSourceName(correlationProperties, assetManagerIsHome), + glossaryGUID, + glossaryGUIDParameterName, templateGUID, templateProperties.getQualifiedName(), templateProperties.getDisplayName(), @@ -1808,7 +1994,7 @@ public String createGlossaryTermFromTemplate(String userI correlationProperties, false, false, - new Date(), + null, methodName); } @@ -2144,8 +2330,8 @@ public void setupTermRelationship(String userId, if (relationshipsProperties != null) { glossaryTermHandler.setupTermRelationship(userId, - null, - null, + assetManagerGUID, + assetManagerName, glossaryTermOneGUID, glossaryTermOneGUIDParameterName, relationshipTypeName, @@ -2167,8 +2353,8 @@ public void setupTermRelationship(String userId, else { glossaryTermHandler.setupTermRelationship(userId, - null, - null, + assetManagerGUID, + assetManagerName, glossaryTermOneGUID, glossaryTermOneGUIDParameterName, relationshipTypeName, @@ -2203,6 +2389,8 @@ public void setupTermRelationship(String userId, * Update the relationship properties for the two terms. * * @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 glossaryTermOneGUID unique identifier of the glossary term at end 1 * @param relationshipTypeName name of the type of relationship to create * @param glossaryTermTwoGUID unique identifier of the glossary term at end 2 @@ -2217,6 +2405,8 @@ public void setupTermRelationship(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void updateTermRelationship(String userId, + String assetManagerGUID, + String assetManagerName, String glossaryTermOneGUID, String relationshipTypeName, String glossaryTermTwoGUID, @@ -2235,8 +2425,8 @@ public void updateTermRelationship(String userId, if (relationshipsProperties != null) { glossaryTermHandler.updateTermRelationship(userId, - null, - null, + assetManagerGUID, + assetManagerName, glossaryTermOneGUID, glossaryTermOneGUIDParameterName, relationshipTypeName, @@ -2259,8 +2449,8 @@ public void updateTermRelationship(String userId, else { glossaryTermHandler.updateTermRelationship(userId, - null, - null, + assetManagerGUID, + assetManagerName, glossaryTermOneGUID, glossaryTermOneGUIDParameterName, relationshipTypeName, 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 ed30d8dc57e..5e2ea15a7ba 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 @@ -2,6 +2,7 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetmanager.server; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.CommentExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ConnectionExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.DataAssetExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ExternalReferenceExchangeHandler; @@ -447,11 +448,11 @@ RatingHandler getRatingHandler(String userId, * @throws UserNotAuthorizedException user does not have access to the requested server * @throws PropertyServerException error in the requested server */ - CommentHandler getCommentHandler(String userId, - String serverName, - String serviceOperationName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + CommentExchangeHandler getCommentHandler(String userId, + String serverName, + String serviceOperationName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { AssetManagerServicesInstance instance = (AssetManagerServicesInstance)super.getServerServiceInstance(userId, 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 517ad43485c..60b600341f8 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 @@ -5,6 +5,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.connectors.outtopic.AssetManagerOutTopicClientProvider; import org.odpi.openmetadata.accessservices.assetmanager.converters.*; import org.odpi.openmetadata.accessservices.assetmanager.ffdc.AssetManagerErrorCode; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.CommentExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ConnectionExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.DataAssetExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.handlers.ExternalReferenceExchangeHandler; @@ -46,7 +47,7 @@ public class AssetManagerServicesInstance extends OMASServiceInstance private final InformalTagHandler informalTagHandler; private final LikeHandler likeHandler; private final RatingHandler ratingHandler; - private final CommentHandler commentHandler; + private final CommentExchangeHandler commentHandler; /** * Set up the local repository connector that will service the REST Calls. @@ -278,19 +279,17 @@ public AssetManagerServicesInstance(OMRSRepositoryConnector repositoryConnector, publishZones, auditLog); - this.commentHandler = new CommentHandler<>(new CommentConverter<>(repositoryHelper, serviceName, serverName), - CommentElement.class, - serviceName, - serverName, - invalidParameterHandler, - repositoryHandler, - repositoryHelper, - localServerUserId, - securityVerifier, - supportedZones, - defaultZones, - publishZones, - auditLog); + this.commentHandler = new CommentExchangeHandler(serviceName, + serverName, + invalidParameterHandler, + repositoryHandler, + repositoryHelper, + localServerUserId, + securityVerifier, + supportedZones, + defaultZones, + publishZones, + auditLog); } @@ -525,7 +524,7 @@ RatingHandler getRatingHandler() throws PropertyServerException * @return handler object * @throws PropertyServerException the instance has not been initialized successfully */ - CommentHandler getCommentHandler() throws PropertyServerException + CommentExchangeHandler getCommentHandler() throws PropertyServerException { final String methodName = "getCommentHandler"; diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java index fa223031d7a..7f00fe408c6 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/CollaborationExchangeRESTServices.java @@ -2,21 +2,24 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetmanager.server; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.CommentElement; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.CommentExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.InformalTagElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.LikeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RatingElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; -import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentType; import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.StarRating; import org.odpi.openmetadata.accessservices.assetmanager.properties.TagProperties; 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; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableUpdateRequestBody; +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; @@ -26,7 +29,6 @@ import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; -import org.odpi.openmetadata.commonservices.generichandlers.CommentHandler; import org.odpi.openmetadata.commonservices.generichandlers.InformalTagHandler; import org.odpi.openmetadata.commonservices.generichandlers.LikeHandler; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; @@ -66,6 +68,7 @@ public CollaborationExchangeRESTServices() * @param serverName name of the server instances for this request * @param userId String - userId of user making request. * @param guid String - unique id for the element. + * @param isPublic is this visible to other people * @param requestBody containing the StarRating and user review of referenceable (probably element). * * @return void or @@ -74,9 +77,10 @@ public CollaborationExchangeRESTServices() * the metadata repository or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - public VoidResponse addRatingToElement(String serverName, - String userId, - String guid, + public VoidResponse addRatingToElement(String serverName, + String userId, + String guid, + boolean isPublic, RatingProperties requestBody) { final String methodName = "addRatingToElement"; @@ -99,6 +103,7 @@ public VoidResponse addRatingToElement(String serverName, { starRating = requestBody.getStarRating().getOpenTypeOrdinal(); } + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); handler.saveRating(userId, null, @@ -107,7 +112,7 @@ public VoidResponse addRatingToElement(String serverName, guidParameterName, starRating, requestBody.getReview(), - requestBody.getIsPublic(), + isPublic, false, false, new Date(), @@ -188,6 +193,7 @@ public VoidResponse removeRatingFromElement(String serverName, * @param serverName name of the server instances for this request * @param userId String - userId of user making request. * @param guid String - unique id for the element. + * @param isPublic is this visible to other people * @param requestBody feedback request body . * * @return void or @@ -196,10 +202,11 @@ public VoidResponse removeRatingFromElement(String serverName, * the metadata repository or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - public VoidResponse addLikeToElement(String serverName, - String userId, - String guid, - FeedbackProperties requestBody) + public VoidResponse addLikeToElement(String serverName, + String userId, + String guid, + boolean isPublic, + LikeProperties requestBody) { final String methodName = "addLikeToElement"; final String guidParameterName = "guid"; @@ -221,7 +228,7 @@ public VoidResponse addLikeToElement(String serverName, null, guid, guidParameterName, - requestBody.getIsPublic(), + isPublic, false, false, new Date(), @@ -301,6 +308,9 @@ public VoidResponse removeLikeFromElement(String serverName, * @param serverName name of the server instances for this request * @param userId String - userId of user making request. * @param guid String - unique id for the element. + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody containing type of comment enum and the text of the comment. * * @return guid for new comment object or @@ -309,13 +319,16 @@ public VoidResponse removeLikeFromElement(String serverName, * the metadata repository or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - public GUIDResponse addCommentToElement(String serverName, - String userId, - String guid, - CommentProperties requestBody) + public GUIDResponse addCommentToElement(String serverName, + String userId, + String guid, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { - final String methodName = "addCommentToElement"; - final String guidParameterName = "guid"; + final String methodName = "addCommentToElement"; + final String guidParameterName = "elementGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -324,32 +337,28 @@ public GUIDResponse addCommentToElement(String serverName, try { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + if (requestBody != null) { - int commentType = CommentType.STANDARD_COMMENT.getOpenTypeOrdinal(); - - if (requestBody.getCommentType() != null) + if (requestBody.getElementProperties() instanceof CommentProperties commentProperties) { - commentType = requestBody.getCommentType().getOpenTypeOrdinal(); + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + + response.setGUID(handler.createComment(userId, + guid, + guidParameterName, + requestBody.getMetadataCorrelationProperties(), + isPublic, + commentProperties, + forLineage, + forDuplicateProcessing, + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CommentProperties.class.getName(), methodName); } - CommentHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); - - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - response.setGUID(handler.attachNewComment(userId, - null, - null, - guid, - guid, - guidParameterName, - commentType, - requestBody.getCommentText(), - requestBody.getIsPublic(), - null, - null, - false, - false, - new Date(), - methodName)); } else { @@ -371,8 +380,10 @@ public GUIDResponse addCommentToElement(String serverName, * * @param serverName name of the server instances for this request * @param userId String - userId of user making request. - * @param elementGUID String - unique id of element that this chain of comments is linked. * @param commentGUID String - unique id for an existing comment. Used to add a reply to a comment. + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody containing type of comment enum and the text of the comment. * * @return guid for new comment object or @@ -381,11 +392,13 @@ public GUIDResponse addCommentToElement(String serverName, * the metadata repository or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - public GUIDResponse addCommentReply(String serverName, - String userId, - String elementGUID, - String commentGUID, - CommentProperties requestBody) + public GUIDResponse addCommentReply(String serverName, + String userId, + String commentGUID, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String guidParameterName = "commentGUID"; final String methodName = "addCommentReply"; @@ -399,31 +412,24 @@ public GUIDResponse addCommentReply(String serverName, { if (requestBody != null) { - int commentType = CommentType.STANDARD_COMMENT.getOpenTypeOrdinal(); - - if (requestBody.getCommentType() != null) + if (requestBody.getElementProperties() instanceof CommentProperties commentProperties) { - commentType = requestBody.getCommentType().getOpenTypeOrdinal(); + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + + response.setGUID(handler.createComment(userId, + commentGUID, + guidParameterName, + requestBody.getMetadataCorrelationProperties(), + isPublic, + commentProperties, + forLineage, + forDuplicateProcessing, + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CommentProperties.class.getName(), methodName); } - - CommentHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); - - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - response.setGUID(handler.attachNewComment(userId, - null, - null, - elementGUID, - commentGUID, - guidParameterName, - commentType, - requestBody.getCommentText(), - requestBody.getIsPublic(), - null, - null, - false, - false, - new Date(), - methodName)); } else { @@ -445,8 +451,11 @@ public GUIDResponse addCommentReply(String serverName, * * @param serverName name of the server instances for this request. * @param userId userId of user making request. - * @param elementGUID unique identifier for the element that the comment is attached to (directly or indirectly). * @param commentGUID unique identifier for the comment to change. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody containing type of comment enum and the text of the comment. * * @return void or @@ -455,11 +464,14 @@ public GUIDResponse addCommentReply(String serverName, * UserNotAuthorizedException the requesting user is not authorized to issue this request. */ @SuppressWarnings(value = "unused") - public VoidResponse updateComment(String serverName, - String userId, - String elementGUID, - String commentGUID, - CommentProperties requestBody) + public VoidResponse updateComment(String serverName, + String userId, + String commentGUID, + boolean isMergeUpdate, + boolean isPublic, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String guidParameterName = "commentGUID"; final String methodName = "updateComment"; @@ -471,32 +483,104 @@ public VoidResponse updateComment(String serverName, try { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + if (requestBody != null) { - int commentType = CommentType.STANDARD_COMMENT.getOpenTypeOrdinal(); - - if (requestBody.getCommentType() != null) + if (requestBody.getElementProperties() instanceof CommentProperties commentProperties) + { + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + + handler.updateComment(userId, + requestBody.getMetadataCorrelationProperties(), + commentGUID, + commentProperties, + isMergeUpdate, + isPublic, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else { - commentType = requestBody.getCommentType().getOpenTypeOrdinal(); + restExceptionHandler.handleInvalidPropertiesObject(CommentProperties.class.getName(), methodName); } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } - CommentHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - handler.updateComment(userId, - null, - null, - commentGUID, - guidParameterName, - commentType, - requestBody.getCommentText(), - requestBody.getIsPublic(), - null, - null, - false, - false, - new Date(), - methodName); + + + /** + * Link a comment that contains the best answer to a question posed in another comment. + * + * @param serverName name of the server to route the request to + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse setupAcceptedAnswer(String serverName, + String userId, + String questionCommentGUID, + String answerCommentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + RelationshipRequestBody requestBody) + { + final String methodName = "setupAcceptedAnswer"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof FeedbackProperties feedbackProperties) + { + handler.setupAcceptedAnswer(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + questionCommentGUID, + answerCommentGUID, + feedbackProperties.getIsPublic(), + requestBody.getProperties().getEffectiveFrom(), + requestBody.getProperties().getEffectiveTo(), + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CommentProperties.class.getName(), methodName); + } } else { @@ -509,6 +593,80 @@ public VoidResponse updateComment(String serverName, } restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @param serverName name of the server to route the request to + * @param userId calling user + * @param questionCommentGUID unique identifier of the comment containing the question + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata + * + * @return void or + * InvalidParameterException one of the parameters is invalid + * UserNotAuthorizedException the user is not authorized to issue this request + * PropertyServerException there is a problem reported in the open metadata server(s) + */ + public VoidResponse clearAcceptedAnswer(String serverName, + String userId, + String questionCommentGUID, + String answerCommentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "clearCategoryParent"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.clearAcceptedAnswer(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + questionCommentGUID, + answerCommentGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.clearAcceptedAnswer(userId, + null, + null, + questionCommentGUID, + answerCommentGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; } @@ -520,6 +678,8 @@ public VoidResponse updateComment(String serverName, * @param userId String - userId of user making request. * @param elementGUID String - unique id for the element object * @param commentGUID String - unique id for the comment object + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody null request body needed to satisfy the HTTP Post request * * @return void or @@ -529,11 +689,13 @@ public VoidResponse updateComment(String serverName, * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ @SuppressWarnings(value = "unused") - public VoidResponse removeCommentFromElement(String serverName, - String userId, - String elementGUID, - String commentGUID, - NullRequestBody requestBody) + public VoidResponse removeCommentFromElement(String serverName, + String userId, + String elementGUID, + String commentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String guidParameterName = "commentGUID"; final String methodName = "removeElementComment"; @@ -545,18 +707,30 @@ public VoidResponse removeCommentFromElement(String serverName, try { - CommentHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - handler.removeCommentFromElement(userId, - null, - null, - commentGUID, - guidParameterName, - false, - false, - new Date(), - methodName); + + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeComment(userId, + requestBody.getMetadataCorrelationProperties(), + commentGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeComment(userId, + null, + commentGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } } catch (Exception error) { @@ -574,16 +748,22 @@ public VoidResponse removeCommentFromElement(String serverName, * @param serverName name of the server instances for this request * @param userId userId of user making request. * @param commentGUID unique identifier for the comment object. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody effectiveTime and asset manager identifiers * @return comment properties or * InvalidParameterException one of the parameters is null or invalid. * PropertyServerException there is a problem updating the element properties in the property server. * UserNotAuthorizedException the user does not have permission to perform this request. */ - public CommentElementResponse getComment(String serverName, - String userId, - String commentGUID) + public CommentElementResponse getCommentByGUID(String serverName, + String userId, + String commentGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) { - final String methodName = "getComment"; + final String methodName = "getComment"; final String guidParameterName = "commentGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -593,17 +773,32 @@ public CommentElementResponse getComment(String serverName, try { - CommentHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - response.setElement(handler.getBeanFromRepository(userId, - commentGUID, - guidParameterName, - OpenMetadataAPIMapper.COMMENT_TYPE_NAME, - false, - false, - new Date(), - methodName)); + + if (requestBody != null) + { + response.setElement(handler.getCommentByGUID(userId, + commentGUID, + guidParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + response.setElement(handler.getCommentByGUID(userId, + commentGUID, + guidParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } } catch (Exception error) { @@ -623,16 +818,22 @@ public CommentElementResponse getComment(String serverName, * @param elementGUID unique identifier for the element that the comments are connected to (maybe a comment too). * @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 effectiveTime and asset manager identifiers * @return list of comments or * InvalidParameterException one of the parameters is null or invalid. * PropertyServerException there is a problem updating the element properties in the property server. * UserNotAuthorizedException the user does not have permission to perform this request. */ - public CommentElementsResponse getAttachedComments(String serverName, - String userId, - String elementGUID, - int startFrom, - int pageSize) + public CommentElementsResponse getAttachedComments(String serverName, + String userId, + String elementGUID, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) { final String methodName = "getAttachedComments"; final String guidParameterName = "elementGUID"; @@ -644,25 +845,38 @@ public CommentElementsResponse getAttachedComments(String serverName, try { - CommentHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); + CommentExchangeHandler handler = instanceHandler.getCommentHandler(userId, serverName, methodName); auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - response.setElementList(handler.getAttachedElements(userId, - elementGUID, - guidParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_GUID, - OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_NAME, - OpenMetadataAPIMapper.COMMENT_TYPE_NAME, - null, - null, - 2, - false, - false, - startFrom, - pageSize, - new Date(), - methodName)); + + if (requestBody != null) + { + response.setElementList(handler.getAttachedComments(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + elementGUID, + guidParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + response.setElementList(handler.getAttachedComments(userId, + null, + null, + elementGUID, + guidParameterName, + startFrom, + pageSize, + forLineage, + forDuplicateProcessing, + null, + methodName)); + } } catch (Exception error) { diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java index 57e5d5e3b58..726efdb18f9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/GlossaryExchangeRESTServices.java @@ -4,10 +4,14 @@ package org.odpi.openmetadata.accessservices.assetmanager.server; import org.odpi.openmetadata.accessservices.assetmanager.handlers.GlossaryExchangeHandler; -import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.CanonicalVocabularyProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryCategoryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermContextDefinition; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationship; -import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.TaxonomyProperties; import org.odpi.openmetadata.accessservices.assetmanager.rest.*; import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; @@ -15,14 +19,8 @@ import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; 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.slf4j.LoggerFactory; -import java.util.Date; -import java.util.List; - /** * GlossaryExchangeRESTServices is the server-side implementation of the Asset Manager OMAS's @@ -56,6 +54,7 @@ public GlossaryExchangeRESTServices() * * @param serverName name of the server to route the request to * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param requestBody properties to store * * @return unique identifier of the new metadata element or @@ -63,9 +62,10 @@ public GlossaryExchangeRESTServices() * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GUIDResponse createGlossary(String serverName, - String userId, - GlossaryRequestBody requestBody) + public GUIDResponse createGlossary(String serverName, + String userId, + boolean assetManagerIsHome, + ReferenceableRequestBody requestBody) { final String methodName = "createGlossary"; @@ -80,12 +80,21 @@ public GUIDResponse createGlossary(String serverName, if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getElementProperties() instanceof GlossaryProperties glossaryProperties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - response.setGUID(handler.createGlossary(userId, - requestBody.getMetadataCorrelationProperties(), - requestBody.getElementProperties(), - methodName)); + + response.setGUID(handler.createGlossary(userId, + requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + glossaryProperties, + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryProperties.class.getName(), methodName); + } } else { @@ -112,6 +121,7 @@ public GUIDResponse createGlossary(String serverName, * * @param serverName name of the server to route the request to * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param requestBody properties that override the template * @@ -122,6 +132,7 @@ public GUIDResponse createGlossary(String serverName, */ public GUIDResponse createGlossaryFromTemplate(String serverName, String userId, + boolean assetManagerIsHome, String templateGUID, TemplateRequestBody requestBody) { @@ -142,6 +153,7 @@ public GUIDResponse createGlossaryFromTemplate(String serverName, response.setGUID(handler.createGlossaryFromTemplate(userId, requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, templateGUID, requestBody.getElementProperties(), methodName)); @@ -169,6 +181,8 @@ public GUIDResponse createGlossaryFromTemplate(String serverName, * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to update * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody new properties for this element * * @return void or @@ -176,11 +190,13 @@ public GUIDResponse createGlossaryFromTemplate(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse updateGlossary(String serverName, - String userId, - String glossaryGUID, - boolean isMergeUpdate, - GlossaryRequestBody requestBody) + public VoidResponse updateGlossary(String serverName, + String userId, + String glossaryGUID, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "updateGlossary"; @@ -195,14 +211,24 @@ public VoidResponse updateGlossary(String serverName, if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getElementProperties() instanceof GlossaryProperties glossaryProperties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.updateGlossary(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryGUID, - requestBody.getElementProperties(), - isMergeUpdate, - methodName); + handler.updateGlossary(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryGUID, + glossaryProperties, + isMergeUpdate, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryProperties.class.getName(), methodName); + } } else { @@ -227,6 +253,8 @@ public VoidResponse updateGlossary(String serverName, * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata * * @return void or @@ -234,10 +262,12 @@ public VoidResponse updateGlossary(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse removeGlossary(String serverName, - String userId, - String glossaryGUID, - MetadataCorrelationProperties requestBody) + public VoidResponse removeGlossary(String serverName, + String userId, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "removeGlossary"; @@ -252,7 +282,26 @@ public VoidResponse removeGlossary(String serverName, GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.removeGlossary(userId, requestBody, glossaryGUID, methodName); + if (requestBody != null) + { + handler.removeGlossary(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeGlossary(userId, + null, + glossaryGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } } catch (Exception error) { @@ -276,6 +325,8 @@ public VoidResponse removeGlossary(String serverName, * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata * * @return void or @@ -283,10 +334,12 @@ public VoidResponse removeGlossary(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setGlossaryAsTaxonomy(String serverName, - String userId, - String glossaryGUID, - TaxonomyClassificationRequestBody requestBody) + public VoidResponse setGlossaryAsTaxonomy(String serverName, + String userId, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setGlossaryAsTaxonomy"; @@ -301,13 +354,23 @@ public VoidResponse setGlossaryAsTaxonomy(String serv if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof TaxonomyProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.setGlossaryAsTaxonomy(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryGUID, - requestBody.getOrganizingPrinciple(), - methodName); + handler.setGlossaryAsTaxonomy(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(TaxonomyProperties.class.getName(), methodName); + } } else { @@ -331,6 +394,8 @@ public VoidResponse setGlossaryAsTaxonomy(String serv * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody correlation properties for the external asset manager * * @return void or @@ -338,10 +403,12 @@ public VoidResponse setGlossaryAsTaxonomy(String serv * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearGlossaryAsTaxonomy(String serverName, - String userId, - String glossaryGUID, - MetadataCorrelationProperties requestBody) + public VoidResponse clearGlossaryAsTaxonomy(String serverName, + String userId, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearGlossaryAsTaxonomy"; @@ -356,7 +423,26 @@ public VoidResponse clearGlossaryAsTaxonomy(String server GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.clearGlossaryAsTaxonomy(userId, requestBody, glossaryGUID, methodName); + if (requestBody != null) + { + handler.clearGlossaryAsTaxonomy(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.clearGlossaryAsTaxonomy(userId, + null, + glossaryGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } } catch (Exception error) { @@ -379,6 +465,8 @@ public VoidResponse clearGlossaryAsTaxonomy(String server * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody description of the situations where this glossary is relevant. * * @return void or @@ -386,10 +474,12 @@ public VoidResponse clearGlossaryAsTaxonomy(String server * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setGlossaryAsCanonical(String serverName, - String userId, - String glossaryGUID, - CanonicalVocabularyClassificationRequestBody requestBody) + public VoidResponse setGlossaryAsCanonical(String serverName, + String userId, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setGlossaryAsCanonical"; @@ -404,13 +494,23 @@ public VoidResponse setGlossaryAsCanonical(String if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof CanonicalVocabularyProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.setGlossaryAsCanonical(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryGUID, - requestBody.getScope(), - methodName); + handler.setGlossaryAsCanonical(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(CanonicalVocabularyProperties.class.getName(), methodName); + } } else { @@ -434,6 +534,8 @@ public VoidResponse setGlossaryAsCanonical(String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody correlation properties for the external asset manager * * @return void or @@ -441,10 +543,12 @@ public VoidResponse setGlossaryAsCanonical(String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearGlossaryAsCanonical(String serverName, - String userId, - String glossaryGUID, - MetadataCorrelationProperties requestBody) + public VoidResponse clearGlossaryAsCanonical(String serverName, + String userId, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearGlossaryAsCanonical"; @@ -459,7 +563,26 @@ public VoidResponse clearGlossaryAsCanonical(String serve GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.clearGlossaryAsCanonical(userId, requestBody, glossaryGUID, methodName); + if (requestBody != null) + { + handler.clearGlossaryAsCanonical(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.clearGlossaryAsCanonical(userId, + null, + glossaryGUID, + forLineage, + forDuplicateProcessing, + null, + methodName); + } } catch (Exception error) { @@ -480,6 +603,8 @@ public VoidResponse clearGlossaryAsCanonical(String serve * @param userId calling user * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody string to find in the properties * * @return list of matching metadata elements or @@ -487,11 +612,13 @@ public VoidResponse clearGlossaryAsCanonical(String serve * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GlossaryElementsResponse findGlossaries(String serverName, - String userId, - int startFrom, - int pageSize, - SearchStringRequestBody requestBody) + public GlossaryElementsResponse findGlossaries(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + SearchStringRequestBody requestBody) { final String methodName = "findGlossaries"; @@ -515,6 +642,9 @@ public GlossaryElementsResponse findGlossaries(String serverNam requestBody.getSearchStringParameterName(), startFrom, pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), methodName)); } else @@ -541,6 +671,8 @@ public GlossaryElementsResponse findGlossaries(String serverNam * @param userId calling user * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody name to search for * * @return list of matching metadata elements or @@ -548,11 +680,13 @@ public GlossaryElementsResponse findGlossaries(String serverNam * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GlossaryElementsResponse getGlossariesByName(String serverName, - String userId, - int startFrom, - int pageSize, - NameRequestBody requestBody) + public GlossaryElementsResponse getGlossariesByName(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + NameRequestBody requestBody) { final String methodName = "getGlossariesByName"; @@ -576,6 +710,9 @@ public GlossaryElementsResponse getGlossariesByName(String serverName requestBody.getNameParameterName(), startFrom, pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), methodName)); } else @@ -601,6 +738,8 @@ public GlossaryElementsResponse getGlossariesByName(String serverName * @param userId calling user * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody asset manager identifiers * * @return list of matching metadata elements or @@ -608,11 +747,13 @@ public GlossaryElementsResponse getGlossariesByName(String serverName * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GlossaryElementsResponse getGlossariesForAssetManager(String serverName, - String userId, - int startFrom, - int pageSize, - AssetManagerIdentifiersRequestBody requestBody) + public GlossaryElementsResponse getGlossariesForAssetManager(String serverName, + String userId, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) { final String methodName = "getGlossariesForAssetManager"; @@ -634,6 +775,9 @@ public GlossaryElementsResponse getGlossariesForAssetManager(String requestBody.getAssetManagerName(), startFrom, pageSize, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), methodName)); } else @@ -643,6 +787,9 @@ public GlossaryElementsResponse getGlossariesForAssetManager(String null, startFrom, pageSize, + forLineage, + forDuplicateProcessing, + null, methodName)); } } @@ -662,7 +809,9 @@ public GlossaryElementsResponse getGlossariesForAssetManager(String * * @param serverName name of the server to route the request to * @param userId calling user - * @param openMetadataGUID unique identifier of the requested metadata element + * @param glossaryGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody asset manager identifiers * * @return matching metadata element or @@ -670,10 +819,12 @@ public GlossaryElementsResponse getGlossariesForAssetManager(String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GlossaryElementResponse getGlossaryByGUID(String serverName, - String userId, - String openMetadataGUID, - AssetManagerIdentifiersRequestBody requestBody) + public GlossaryElementResponse getGlossaryByGUID(String serverName, + String userId, + String glossaryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) { final String methodName = "getGlossaryByGUID"; @@ -693,7 +844,10 @@ public GlossaryElementResponse getGlossaryByGUID(String response.setElement(handler.getGlossaryByGUID(userId, requestBody.getAssetManagerGUID(), requestBody.getAssetManagerName(), - openMetadataGUID, + glossaryGUID, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), methodName)); } else @@ -701,7 +855,10 @@ public GlossaryElementResponse getGlossaryByGUID(String response.setElement(handler.getGlossaryByGUID(userId, null, null, - openMetadataGUID, + glossaryGUID, + forLineage, + forDuplicateProcessing, + null, methodName)); } } @@ -727,6 +884,9 @@ public GlossaryElementResponse getGlossaryByGUID(String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the category is located + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties about the glossary category to store * * @return unique identifier of the new glossary category or @@ -734,10 +894,13 @@ public GlossaryElementResponse getGlossaryByGUID(String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GUIDResponse createGlossaryCategory(String serverName, - String userId, - String glossaryGUID, - GlossaryCategoryRequestBody requestBody) + public GUIDResponse createGlossaryCategory(String serverName, + String userId, + String glossaryGUID, + boolean assetManagerIsHome, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "createGlossaryCategory"; @@ -752,13 +915,24 @@ public GUIDResponse createGlossaryCategory(String serverNam if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getElementProperties() instanceof GlossaryCategoryProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - response.setGUID(handler.createGlossaryCategory(userId, - glossaryGUID, - requestBody.getMetadataCorrelationProperties(), - requestBody.getElementProperties(), - methodName)); + response.setGUID(handler.createGlossaryCategory(userId, + glossaryGUID, + requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryCategoryProperties.class.getName(), methodName); + } } else { @@ -781,6 +955,8 @@ public GUIDResponse createGlossaryCategory(String serverNam * * @param serverName name of the server to route the request to * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param glossaryGUID unique identifier of the glossary where the category is located * @param templateGUID unique identifier of the metadata element to copy * @param requestBody properties that override the template * @@ -791,7 +967,9 @@ public GUIDResponse createGlossaryCategory(String serverNam */ public GUIDResponse createGlossaryCategoryFromTemplate(String serverName, String userId, + String glossaryGUID, String templateGUID, + boolean assetManagerIsHome, TemplateRequestBody requestBody) { final String methodName = "createGlossaryCategoryFromTemplate"; @@ -811,6 +989,8 @@ public GUIDResponse createGlossaryCategoryFromTemplate(String serv response.setGUID(handler.createGlossaryCategoryFromTemplate(userId, requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + glossaryGUID, templateGUID, requestBody.getElementProperties(), methodName)); @@ -837,6 +1017,7 @@ public GUIDResponse createGlossaryCategoryFromTemplate(String serv * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryCategoryGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param forLineage return elements marked with the Memento classification? * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody new properties for the metadata element @@ -846,12 +1027,13 @@ public GUIDResponse createGlossaryCategoryFromTemplate(String serv * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse updateGlossaryCategory(String serverName, - String userId, - String glossaryCategoryGUID, - boolean forLineage, - boolean forDuplicateProcessing, - GlossaryCategoryRequestBody requestBody) + public VoidResponse updateGlossaryCategory(String serverName, + String userId, + String glossaryCategoryGUID, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "updateGlossaryCategory"; @@ -866,16 +1048,24 @@ public VoidResponse updateGlossaryCategory(String serverNam if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getElementProperties() instanceof GlossaryCategoryProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.updateGlossaryCategory(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryCategoryGUID, - requestBody.getElementProperties(), - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + + handler.updateGlossaryCategory(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryCategoryGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryCategoryProperties.class.getName(), methodName); + } } else { @@ -1075,12 +1265,12 @@ public VoidResponse clearCategoryParent(String serverName * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse removeGlossaryCategory(String serverName, - String userId, - String glossaryCategoryGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse removeGlossaryCategory(String serverName, + String userId, + String glossaryCategoryGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "removeGlossaryCategory"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -1566,6 +1756,9 @@ public GlossaryCategoryElementsResponse getGlossarySubCategories(String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the term is located + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties for the glossary term * * @return unique identifier of the new metadata element for the glossary term or @@ -1573,10 +1766,13 @@ public GlossaryCategoryElementsResponse getGlossarySubCategories(String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public GUIDResponse createGlossaryTerm(String serverName, - String userId, - String glossaryGUID, - GlossaryTermRequestBody requestBody) + public GUIDResponse createGlossaryTerm(String serverName, + String userId, + String glossaryGUID, + boolean assetManagerIsHome, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "createGlossaryTerm"; @@ -1591,13 +1787,24 @@ public GUIDResponse createGlossaryTerm(String serverName, if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getElementProperties() instanceof GlossaryTermProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - response.setGUID(handler.createGlossaryTerm(userId, - glossaryGUID, - requestBody.getMetadataCorrelationProperties(), - requestBody.getElementProperties(), - methodName)); + response.setGUID(handler.createGlossaryTerm(userId, + glossaryGUID, + requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + properties, + requestBody.getEffectiveTime(), + forLineage, + forDuplicateProcessing, + methodName)); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryTermProperties.class.getName(), methodName); + } } else { @@ -1621,6 +1828,9 @@ public GUIDResponse createGlossaryTerm(String serverName, * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the term is located + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties for the glossary term * * @return unique identifier of the new metadata element for the glossary term or @@ -1631,6 +1841,9 @@ public GUIDResponse createGlossaryTerm(String serverName, public GUIDResponse createControlledGlossaryTerm(String serverName, String userId, String glossaryGUID, + boolean assetManagerIsHome, + boolean forLineage, + boolean forDuplicateProcessing, ControlledGlossaryTermRequestBody requestBody) { final String methodName = "createControlledGlossaryTerm"; @@ -1651,8 +1864,12 @@ public GUIDResponse createControlledGlossaryTerm(String response.setGUID(handler.createControlledGlossaryTerm(userId, glossaryGUID, requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, requestBody.getElementProperties(), requestBody.getInitialStatus(), + requestBody.getEffectiveTime(), + forLineage, + forDuplicateProcessing, methodName)); } else @@ -1676,6 +1893,8 @@ public GUIDResponse createControlledGlossaryTerm(String * * @param serverName name of the server to route the request to * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param requestBody properties that override the template * @@ -1685,8 +1904,10 @@ public GUIDResponse createControlledGlossaryTerm(String * PropertyServerException there is a problem reported in the open metadata server(s) */ public GUIDResponse createGlossaryTermFromTemplate(String serverName, + String glossaryGUID, String userId, String templateGUID, + boolean assetManagerIsHome, TemplateRequestBody requestBody) { final String methodName = "createGlossaryTermFromTemplate"; @@ -1706,6 +1927,8 @@ public GUIDResponse createGlossaryTermFromTemplate(String serverNa response.setGUID(handler.createGlossaryTermFromTemplate(userId, requestBody.getMetadataCorrelationProperties(), + assetManagerIsHome, + glossaryGUID, templateGUID, requestBody.getElementProperties(), methodName)); @@ -1748,7 +1971,7 @@ public VoidResponse updateGlossaryTerm(String serverName, boolean isMergeUpdate, boolean forLineage, boolean forDuplicateProcessing, - GlossaryTermRequestBody requestBody) + ReferenceableUpdateRequestBody requestBody) { final String methodName = "updateGlossaryTerm"; @@ -1763,17 +1986,25 @@ public VoidResponse updateGlossaryTerm(String serverName, if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getElementProperties() instanceof GlossaryTermProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.updateGlossaryTerm(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryTermGUID, - requestBody.getElementProperties(), - isMergeUpdate, - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + + handler.updateGlossaryTerm(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryTermGUID, + properties, + isMergeUpdate, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryTermProperties.class.getName(), methodName); + } } else { @@ -1889,20 +2120,27 @@ public VoidResponse setupTermCategory(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if ((requestBody != null) && (requestBody.getProperties() instanceof GlossaryTermCategorization properties)) + if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof GlossaryTermCategorization properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.setupTermCategory(userId, - requestBody.getAssetManagerGUID(), - requestBody.getAssetManagerName(), - glossaryCategoryGUID, - glossaryTermGUID, - properties, - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + handler.setupTermCategory(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + glossaryCategoryGUID, + glossaryTermGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryTermCategorization.class.getName(), methodName); + } } else { @@ -2030,21 +2268,28 @@ public VoidResponse setupTermRelationship(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if ((requestBody != null) && (requestBody.getProperties() instanceof GlossaryTermRelationship properties)) + if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - - handler.setupTermRelationship(userId, - requestBody.getAssetManagerGUID(), - requestBody.getAssetManagerName(), - glossaryTermOneGUID, - relationshipTypeName, - glossaryTermTwoGUID, - properties, - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + if (requestBody.getProperties() instanceof GlossaryTermRelationship properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + + handler.setupTermRelationship(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + glossaryTermOneGUID, + relationshipTypeName, + glossaryTermTwoGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryTermRelationship.class.getName(), methodName); + } } else { @@ -2099,19 +2344,28 @@ public VoidResponse updateTermRelationship(String serverName, { auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - if ((requestBody != null) && (requestBody.getProperties() instanceof GlossaryTermRelationship properties)) + if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof GlossaryTermRelationship properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.updateTermRelationship(userId, - glossaryTermOneGUID, - relationshipTypeName, - glossaryTermTwoGUID, - properties, - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + handler.updateTermRelationship(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + glossaryTermOneGUID, + relationshipTypeName, + glossaryTermTwoGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryTermRelationship.class.getName(), methodName); + } } else { @@ -2222,12 +2476,12 @@ public VoidResponse clearTermRelationship(String serverNa * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsAbstractConcept(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse setTermAsAbstractConcept(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsAbstractConcept"; @@ -2283,12 +2537,12 @@ public VoidResponse setTermAsAbstractConcept(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsAbstractConcept(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsAbstractConcept(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsAbstractConcept"; @@ -2337,12 +2591,12 @@ public VoidResponse clearTermAsAbstractConcept(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsDataValue(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse setTermAsDataValue(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsDataValue"; @@ -2398,12 +2652,12 @@ public VoidResponse setTermAsDataValue(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsDataValue(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsDataValue(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsDataValue"; @@ -2458,12 +2712,12 @@ public VoidResponse clearTermAsDataValue(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsActivity(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - ActivityTermClassificationRequestBody requestBody) + public VoidResponse setTermAsActivity(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsActivity"; @@ -2478,16 +2732,23 @@ public VoidResponse setTermAsActivity(String serv if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof ActivityDescriptionProperties properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.setTermAsActivity(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryTermGUID, - requestBody.getActivityType(), - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + handler.setTermAsActivity(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryTermGUID, + properties.getActivityType(), + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ActivityDescriptionProperties.class.getName(), methodName); + } } else { @@ -2520,12 +2781,12 @@ public VoidResponse setTermAsActivity(String serv * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsActivity(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsActivity(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsActivity"; @@ -2581,12 +2842,12 @@ public VoidResponse clearTermAsActivity(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsContext(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - ContextDefinitionClassificationRequestBody requestBody) + public VoidResponse setTermAsContext(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsContext"; @@ -2601,16 +2862,23 @@ public VoidResponse setTermAsContext(String if (requestBody != null) { - GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof GlossaryTermContextDefinition properties) + { + GlossaryExchangeHandler handler = instanceHandler.getGlossaryExchangeHandler(userId, serverName, methodName); - handler.setTermAsContext(userId, - requestBody.getMetadataCorrelationProperties(), - glossaryTermGUID, - requestBody.getContextDefinition(), - forLineage, - forDuplicateProcessing, - requestBody.getEffectiveTime(), - methodName); + handler.setTermAsContext(userId, + requestBody.getMetadataCorrelationProperties(), + glossaryTermGUID, + properties, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GlossaryTermContextDefinition.class.getName(), methodName); + } } else { @@ -2643,12 +2911,12 @@ public VoidResponse setTermAsContext(String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsContext(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsContext(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsContext"; @@ -2704,12 +2972,12 @@ public VoidResponse clearTermAsContext(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsSpineObject(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse setTermAsSpineObject(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsSpineObject"; @@ -2765,12 +3033,12 @@ public VoidResponse setTermAsSpineObject(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsSpineObject(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsSpineObject(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsSpineObject"; @@ -2826,12 +3094,12 @@ public VoidResponse clearTermAsSpineObject(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsSpineAttribute(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse setTermAsSpineAttribute(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsSpineAttribute"; @@ -2887,12 +3155,12 @@ public VoidResponse setTermAsSpineAttribute(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsSpineAttribute(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsSpineAttribute(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsSpineAttribute"; @@ -2947,12 +3215,12 @@ public VoidResponse clearTermAsSpineAttribute(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse setTermAsObjectIdentifier(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse setTermAsObjectIdentifier(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "setTermAsObjectIdentifier"; @@ -3008,12 +3276,12 @@ public VoidResponse setTermAsObjectIdentifier(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse clearTermAsObjectIdentifier(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse clearTermAsObjectIdentifier(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { final String methodName = "clearTermAsObjectIdentifier"; @@ -3195,12 +3463,12 @@ public VoidResponse archiveGlossaryTerm(String serverName, * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - public VoidResponse removeGlossaryTerm(String serverName, - String userId, - String glossaryTermGUID, - boolean forLineage, - boolean forDuplicateProcessing, - UpdateRequestBody requestBody) + public VoidResponse removeGlossaryTerm(String serverName, + String userId, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ReferenceableUpdateRequestBody requestBody) { final String methodName = "removeGlossaryTerm"; 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 5a5701fc15a..fd17b68fd5a 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 @@ -3,23 +3,30 @@ package org.odpi.openmetadata.accessservices.assetmanager.server; +import org.odpi.openmetadata.accessservices.assetmanager.handlers.DataAssetExchangeHandler; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SoftwareCapabilityElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetOriginProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GovernanceClassificationProperties; +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.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.accessservices.assetmanager.properties.SemanticAssignmentProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.SubjectAreaMemberProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.EffectiveTimeQueryRequestBody; +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.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; import org.odpi.openmetadata.commonservices.generichandlers.SoftwareCapabilityHandler; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.slf4j.LoggerFactory; -import java.util.Date; /** - * AssetManagerRESTServices provides part of the server-side support for the Asset Owner Open Metadata Access Service (OMAS). + * StewardshipExchangeRESTServices provides part of the server-side support for the Asset Owner Open Metadata Access Service (OMAS). * There are other REST services that provide specialized methods for specific types of Asset. */ public class StewardshipExchangeRESTServices @@ -38,26 +45,1132 @@ public StewardshipExchangeRESTServices() } + /** + * Classify/reclassify the element (typically an asset) to indicate the level of confidence that the organization + * has that the data is complete, accurate and up-to-date. The level of confidence is expressed by the + * levelIdentifier property. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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 VoidResponse setConfidenceClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "setConfidenceClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.addGovernanceActionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getLevelIdentifier(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.addGovernanceActionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getLevelIdentifier(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidence to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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 VoidResponse clearConfidenceClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "clearConfidenceClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.removeGovernanceActionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + else + { + handler.removeGovernanceActionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENCE_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + 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. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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 VoidResponse setCriticalityClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "setCriticalityClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.addGovernanceActionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getLevelIdentifier(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.addGovernanceActionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getLevelIdentifier(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the criticality classification from the element. This normally occurs when the organization has lost track of the level of + * criticality to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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 VoidResponse clearCriticalityClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "clearCriticalityClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.removeGovernanceActionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + else + { + handler.removeGovernanceActionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CRITICALITY_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + 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 + * of confidentiality is a suggestion for any element linked to the glossary term via the SemanticAssignment classification. + * The level of confidence is expressed by the levelIdentifier property. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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 VoidResponse setConfidentialityClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "setConfidentialityClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.addGovernanceActionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getLevelIdentifier(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.addGovernanceActionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getLevelIdentifier(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidentiality to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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 VoidResponse clearConfidentialityClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "clearConfidentialityClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.removeGovernanceActionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + else + { + handler.removeGovernanceActionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + 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 + * property. The dates after which the element/resource is archived and then deleted are specified in the archiveAfter and deleteAfter + * properties respectively. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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 VoidResponse setRetentionClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "setRetentionClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof RetentionClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.addRetentionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getRetentionBasis(), + properties.getAssociatedGUID(), + properties.getArchiveAfter(), + properties.getDeleteAfter(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.addRetentionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + properties.getStatus(), + properties.getConfidence(), + properties.getSteward(), + properties.getStewardTypeName(), + properties.getStewardPropertyName(), + properties.getSource(), + properties.getNotes(), + properties.getRetentionBasis(), + properties.getAssociatedGUID(), + properties.getArchiveAfter(), + properties.getDeleteAfter(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(RetentionClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the retention classification from the element. This normally occurs when the organization has lost track of, or no longer needs to + * track the retention period to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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 VoidResponse clearRetentionClassification(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "clearRetentionClassification"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof GovernanceClassificationProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.removeRetentionClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + else + { + handler.removeRetentionClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(GovernanceClassificationProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + 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. * * @param serverName name of the server instance to connect to - * @param userId calling user - * @param elementGUID unique identifier of element to attach to - * @param requestBody list of security labels and properties + * @param userId calling user + * @param elementGUID unique identifier of element to attach to + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody list of security labels and properties + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public VoidResponse addSecurityTags(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "addSecurityTags"; + final String assetGUIDParameterName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof SecurityTagsProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + handler.addSecurityTags(userId, + elementGUID, + assetGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + properties.getSecurityLabels(), + properties.getSecurityProperties(), + properties.getAccessGroups(), + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(SecurityTagsProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the security tags classification from an element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of element + * @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 + */ + @SuppressWarnings(value = "unused") + public VoidResponse removeSecurityTags(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "removeSecurityTags"; + final String assetGUIDParameterName = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeSecurityTags(userId, + elementGUID, + assetGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeSecurityTags(userId, + elementGUID, + assetGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + 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. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID element to link it to - its type must inherit from Referenceable. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public VoidResponse addOwnership(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "addOwnership"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof OwnerProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + handler.addOwner(userId, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + properties.getOwner(), + properties.getOwnerTypeName(), + properties.getOwnerPropertyName(), + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(OwnerProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the ownership classification from an element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID element where the classification needs to be removed. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public VoidResponse clearOwnership(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "clearOwnership"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeOwner(userId, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeOwner(userId, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + 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. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param assetGUID element to link it to - its type must inherit from Asset. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request * * @return void or * InvalidParameterException full path or userId is null or * PropertyServerException problem accessing property server or * UserNotAuthorizedException security access problem */ - public VoidResponse addSecurityTags(String serverName, - String userId, - String elementGUID, - SecurityTagsProperties requestBody) + public VoidResponse addAssetOrigin(String serverName, + String userId, + String assetGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { - final String methodName = "addSecurityTags"; - final String assetGUIDParameterName = "elementGUID"; + final String methodName = "addAssetOrigin"; + final String elementGUIDParameter = "assetGUID"; + final String organizationGUIDParameter = "properties.organizationGUID"; + final String businessCapabilityGUIDParameter = "properties.businessCapabilityGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -66,22 +1179,34 @@ public VoidResponse addSecurityTags(String serverName, try { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + if (requestBody != null) { - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof AssetOriginProperties properties) + { + DataAssetExchangeHandler handler = instanceHandler.getDataAssetExchangeHandler(userId, serverName, methodName); - handler.addSecurityTags(userId, - elementGUID, - assetGUIDParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - requestBody.getSecurityLabels(), - requestBody.getSecurityProperties(), - requestBody.getAccessGroups(), - false, - false, - new Date(), - methodName); + handler.addAssetOrigin(userId, + assetGUID, + elementGUIDParameter, + properties.getOrganizationGUID(), + organizationGUIDParameter, + properties.getBusinessCapabilityGUID(), + businessCapabilityGUIDParameter, + properties.getOtherOriginValues(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + false, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(AssetOriginProperties.class.getName(), methodName); + } } else { @@ -99,26 +1224,517 @@ public VoidResponse addSecurityTags(String serverName, /** - * Remove the security tags classification from an element. + * Remove the origin classification from an asset. * * @param serverName name of the server instance to connect to - * @param userId calling user - * @param elementGUID unique identifier of element - * @param requestBody null request body + * @param userId calling user + * @param assetGUID element where the classification needs to be removed. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request * * @return void or * InvalidParameterException full path or userId is null or * PropertyServerException problem accessing property server or * UserNotAuthorizedException security access problem */ - @SuppressWarnings(value = "unused") - public VoidResponse removeSecurityTags(String serverName, - String userId, - String elementGUID, - NullRequestBody requestBody) + public VoidResponse clearAssetOrigin(String serverName, + String userId, + String assetGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) { - final String methodName = "removeSecurityTags"; - final String assetGUIDParameterName = "elementGUID"; + final String methodName = "clearAssetOrigin"; + final String elementGUIDParameter = "assetGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + DataAssetExchangeHandler handler = instanceHandler.getDataAssetExchangeHandler(userId, serverName, methodName); + + if (requestBody != null) + { + handler.removeAssetOrigin(userId, + assetGUID, + elementGUIDParameter, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeAssetOrigin(userId, + assetGUID, + elementGUIDParameter, + 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. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public VoidResponse addElementToSubjectArea(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "addElementToSubjectArea"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof SubjectAreaMemberProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody.getMetadataCorrelationProperties() != null) + { + handler.addSubjectAreaClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + properties.getSubjectAreaName(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.addSubjectAreaClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + properties.getSubjectAreaName(), + forLineage, + forDuplicateProcessing, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + requestBody.getEffectiveTime(), + methodName); + } + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(SubjectAreaMemberProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + /** + * Remove the subject area designation from the identified element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + public VoidResponse removeElementFromSubjectArea(String serverName, + String userId, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + ClassificationRequestBody requestBody) + { + final String methodName = "removeElementFromSubjectArea"; + final String elementGUIDParameter = "elementGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody == null) + { + handler.removeSubjectAreaClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + else if (requestBody.getMetadataCorrelationProperties() == null) + { + handler.removeSubjectAreaClassification(userId, + null, + null, + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + handler.removeSubjectAreaClassification(userId, + requestBody.getMetadataCorrelationProperties().getAssetManagerGUID(), + requestBody.getMetadataCorrelationProperties().getAssetManagerName(), + elementGUID, + elementGUIDParameter, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + 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. + * + * @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 glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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 VoidResponse setupSemanticAssignment(String serverName, + String userId, + String elementGUID, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + RelationshipRequestBody requestBody) + { + final String methodName = "setupSemanticAssignment"; + final String elementGUIDParameterName = "elementGUID"; + final String glossaryTermGUIDParameterName = "glossaryTermGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof SemanticAssignmentProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + handler.saveSemanticAssignment(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + elementGUID, + elementGUIDParameterName, + glossaryTermGUID, + glossaryTermGUIDParameterName, + properties.getDescription(), + properties.getExpression(), + properties.getStatus().getOpenTypeOrdinal(), + properties.getConfidence(), + properties.getCreatedBy(), + properties.getSteward(), + properties.getSource(), + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(SemanticAssignmentProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove a semantic assignment relationship between an element and its glossary term. + * + * @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 glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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 VoidResponse clearSemanticAssignment(String serverName, + String userId, + String elementGUID, + String glossaryTermGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "clearSemanticAssignment"; + final String elementGUIDParameterName = "elementGUID"; + final String glossaryTermGUIDParameterName = "glossaryTermGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + if (requestBody == null) + { + handler.removeSemanticAssignment(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + glossaryTermGUID, + glossaryTermGUIDParameterName, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + else + { + handler.removeSemanticAssignment(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + elementGUID, + elementGUIDParameterName, + glossaryTermGUID, + glossaryTermGUIDParameterName, + 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. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to link + * @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 VoidResponse addGovernanceDefinitionToElement(String serverName, + String userId, + String definitionGUID, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + RelationshipRequestBody requestBody) + { + final String methodName = "addGovernanceDefinitionToElement"; + final String elementGUIDParameterName = "elementGUID"; + final String definitionGUIDParameterName = "definitionGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof SemanticAssignmentProperties properties) + { + SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); + + handler.addGovernedBy(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + definitionGUID, + definitionGUIDParameterName, + elementGUID, + elementGUIDParameterName, + properties.getEffectiveFrom(), + properties.getEffectiveTo(), + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(SemanticAssignmentProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + + /** + * Remove the GovernedBy relationship between a governance definition and an element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to update + * @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 VoidResponse removeGovernanceDefinitionFromElement(String serverName, + String userId, + String definitionGUID, + String elementGUID, + boolean forLineage, + boolean forDuplicateProcessing, + EffectiveTimeQueryRequestBody requestBody) + { + final String methodName = "removeGovernanceDefinitionFromElement"; + final String elementGUIDParameterName = "elementGUID"; + final String definitionGUIDParameterName = "definitionGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -130,14 +1746,34 @@ public VoidResponse removeSecurityTags(String serverName, auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); SoftwareCapabilityHandler handler = instanceHandler.getAssetManagerHandler(userId, serverName, methodName); - handler.removeSecurityTags(userId, - elementGUID, - assetGUIDParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - false, - false, - new Date(), - methodName); + if (requestBody == null) + { + handler.removeGovernedBy(userId, + null, + null, + elementGUID, + elementGUIDParameterName, + definitionGUID, + definitionGUIDParameterName, + forLineage, + forDuplicateProcessing, + null, + methodName); + } + else + { + handler.removeGovernedBy(userId, + requestBody.getAssetManagerGUID(), + requestBody.getAssetManagerName(), + elementGUID, + elementGUIDParameterName, + definitionGUID, + definitionGUIDParameterName, + forLineage, + forDuplicateProcessing, + requestBody.getEffectiveTime(), + methodName); + } } catch (Exception error) { 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 a1fee892c8d..4e82a98cf77 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 @@ -5,15 +5,17 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import org.odpi.openmetadata.accessservices.assetmanager.properties.CommentProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.FeedbackProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.LikeProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.RatingProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.TagProperties; import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementResponse; import org.odpi.openmetadata.accessservices.assetmanager.rest.CommentElementsResponse; -import org.odpi.openmetadata.accessservices.assetmanager.rest.InformalTagUpdateRequestBody; +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; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ReferenceableUpdateRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.server.CollaborationExchangeRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDListResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; @@ -59,8 +61,10 @@ public CollaborationExchangeResource() * * @param serverName name of the server instances for this request. * @param userId String - userId of user making request. - * @param elementGUID String - unique id of element that this chain of comments is linked. * @param commentGUID String - unique id for an existing comment. Used to add a reply to a comment. + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody containing type of comment enum and the text of the comment. * * @return elementGUID for new comment object or @@ -69,20 +73,24 @@ public CollaborationExchangeResource() * the metadata repository or * UserNotAuthorizedException the requesting user is not authorized to issue this request. */ - @PostMapping(path = "/elements/{elementGUID}/comments/{commentGUID}/replies") + @PostMapping(path = "/comments/{commentGUID}/replies") @Operation(summary="addCommentReply", description="Adds a reply to a comment.", externalDocs=@ExternalDocumentation(description="Element Feedback", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback")) - public GUIDResponse addCommentReply(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @PathVariable String commentGUID, - @RequestBody CommentProperties requestBody) + public GUIDResponse addCommentReply(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String commentGUID, + @RequestParam boolean isPublic, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.addCommentReply(serverName, userId, elementGUID, commentGUID, requestBody); + return restAPI.addCommentReply(serverName, userId, commentGUID, isPublic, forLineage, forDuplicateProcessing, requestBody); } @@ -92,6 +100,9 @@ public GUIDResponse addCommentReply(@PathVariable String serverName, * @param serverName name of the server instances for this request. * @param userId String - userId of user making request. * @param elementGUID String - unique id for the element. + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody containing type of comment enum and the text of the comment. * * @return elementGUID for new comment object or @@ -107,12 +118,17 @@ public GUIDResponse addCommentReply(@PathVariable String serverName, externalDocs=@ExternalDocumentation(description="Element Feedback", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback")) - public GUIDResponse addCommentToElement(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @RequestBody CommentProperties requestBody) + public GUIDResponse addCommentToElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam boolean isPublic, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.addCommentToElement(serverName, userId, elementGUID, requestBody); + return restAPI.addCommentToElement(serverName, userId, elementGUID, isPublic, forLineage, forDuplicateProcessing, requestBody); } @@ -122,6 +138,7 @@ public GUIDResponse addCommentToElement(@PathVariable String serverN * @param serverName name of the server instances for this request. * @param userId String - userId of user making request. * @param elementGUID String - unique id for the element. + * @param isPublic is this visible to other people * @param requestBody feedback request body. * * @return void or @@ -137,12 +154,13 @@ public GUIDResponse addCommentToElement(@PathVariable String serverN externalDocs=@ExternalDocumentation(description="Element Feedback", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback")) - public VoidResponse addLikeToElement(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @RequestBody FeedbackProperties requestBody) + public VoidResponse addLikeToElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam boolean isPublic, + @RequestBody LikeProperties requestBody) { - return restAPI.addLikeToElement(serverName, userId, elementGUID, requestBody); + return restAPI.addLikeToElement(serverName, userId, elementGUID, isPublic, requestBody); } @@ -151,7 +169,8 @@ public VoidResponse addLikeToElement(@PathVariable String serverNam * * @param serverName name of the server instances for this request. * @param userId String - userId of user making request. - * @param elementGUID String - unique id for the element. + * @param elementGUID String - unique id for the element. + * @param isPublic is this visible to other people * @param requestBody containing the StarRating and user review of element. * * @return elementGUID for new review object or @@ -166,12 +185,13 @@ public VoidResponse addLikeToElement(@PathVariable String serverNam externalDocs=@ExternalDocumentation(description="Element Feedback", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback")) - public VoidResponse addRatingToElement(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @RequestBody RatingProperties requestBody) + public VoidResponse addRatingToElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam boolean isPublic, + @RequestBody RatingProperties requestBody) { - return restAPI.addRatingToElement(serverName, userId, elementGUID, requestBody); + return restAPI.addRatingToElement(serverName, userId, elementGUID, isPublic, requestBody); } @@ -196,11 +216,11 @@ public VoidResponse addRatingToElement(@PathVariable String serverNam externalDocs=@ExternalDocumentation(description="Element Classifiers", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-classifiers")) - public VoidResponse addTagToElement(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @PathVariable String tagGUID, - @RequestBody FeedbackProperties requestBody) + public VoidResponse addTagToElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String tagGUID, + @RequestBody FeedbackProperties requestBody) { return restAPI.addTagToElement(serverName, userId, elementGUID, tagGUID, requestBody); } @@ -225,9 +245,9 @@ public VoidResponse addTagToElement(@PathVariable String serverName externalDocs=@ExternalDocumentation(description="Informal Tag", url="https://egeria-project.org/concepts/informal-tag/")) - public GUIDResponse createTag(@PathVariable String serverName, - @PathVariable String userId, - @RequestBody TagProperties requestBody) + public GUIDResponse createTag(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody TagProperties requestBody) { return restAPI.createTag(serverName, userId, requestBody); } @@ -286,10 +306,10 @@ public VoidResponse deleteTag(@PathVariable String url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-classifiers")) public GUIDListResponse getElementsByTag(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String tagGUID, - @RequestParam int startFrom, - @RequestParam int pageSize) + @PathVariable String userId, + @PathVariable String tagGUID, + @RequestParam int startFrom, + @RequestParam int pageSize) { return restAPI.getElementsByTag(serverName, userId, tagGUID, startFrom, pageSize); @@ -464,13 +484,18 @@ public InformalTagsResponse findMyTags(@PathVariable String ser externalDocs=@ExternalDocumentation(description="Element Feedback", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback")) - public VoidResponse removeCommentFromElement(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @PathVariable String commentGUID, - @RequestBody(required = false) NullRequestBody requestBody) + public VoidResponse removeCommentFromElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String commentGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + ReferenceableUpdateRequestBody requestBody) { - return restAPI.removeCommentFromElement(serverName, userId, elementGUID, commentGUID, requestBody); + return restAPI.removeCommentFromElement(serverName, userId, elementGUID, commentGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -485,13 +510,19 @@ public VoidResponse removeCommentFromElement(@PathVariable Stri * PropertyServerException there is a problem updating the element properties in the property server. * UserNotAuthorizedException the user does not have permission to perform this request. */ - @GetMapping(path = "/comments/{commentGUID}") - - public CommentElementResponse getComment(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String commentGUID) + @PostMapping(path = "/comments/{commentGUID}") + + public CommentElementResponse getComment(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String commentGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + EffectiveTimeQueryRequestBody requestBody) { - return restAPI.getComment(serverName, userId, commentGUID); + return restAPI.getCommentByGUID(serverName, userId, commentGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -508,15 +539,21 @@ public CommentElementResponse getComment(@PathVariable String serverName, * PropertyServerException there is a problem updating the element properties in the property server. * UserNotAuthorizedException the user does not have permission to perform this request. */ - @GetMapping(path = "/elements/{elementGUID}/comments") - - public CommentElementsResponse getAttachedComments(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @RequestParam int startFrom, - @RequestParam int pageSize) + @PostMapping(path = "/elements/{elementGUID}/comments/retrieve") + + public CommentElementsResponse getAttachedComments(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + EffectiveTimeQueryRequestBody requestBody) { - return restAPI.getAttachedComments(serverName, userId, elementGUID, startFrom, pageSize); + return restAPI.getAttachedComments(serverName, userId, elementGUID, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); } @@ -599,7 +636,7 @@ public VoidResponse removeRatingFromElement(@PathVariable Str externalDocs=@ExternalDocumentation(description="Element classifiers", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-classifiers")) - public VoidResponse removeTagFromElement(@PathVariable String serverName, + public VoidResponse removeTagFromElement(@PathVariable String serverName, @PathVariable String userId, @PathVariable String elementGUID, @PathVariable String tagGUID, @@ -614,8 +651,11 @@ public VoidResponse removeTagFromElement(@PathVariable String * * @param serverName name of the server instances for this request. * @param userId userId of user making request. - * @param elementGUID unique identifier for the element that the comment is attached to (directly or indirectly). * @param commentGUID unique identifier for the comment to change. + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param isPublic is this visible to other people + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody containing type of comment enum and the text of the comment. * * @return void or @@ -623,20 +663,26 @@ public VoidResponse removeTagFromElement(@PathVariable String * PropertyServerException There is a problem updating the element properties in the metadata repository. * UserNotAuthorizedException the requesting user is not authorized to issue this request. */ - @PostMapping(path = "elements/{elementGUID}/comments/{commentGUID}/update") + @PostMapping(path = "/comments/{commentGUID}/update") @Operation(summary="updateComment", description="Update an existing comment.", externalDocs=@ExternalDocumentation(description="Element Feedback", url="https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback")) - public VoidResponse updateComment(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @PathVariable String commentGUID, - @RequestBody CommentProperties requestBody) + public VoidResponse updateComment(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String commentGUID, + @RequestParam (required = false, defaultValue = "false") + boolean isMergeUpdate, + @RequestParam boolean isPublic, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.updateComment(serverName, userId, elementGUID, commentGUID, requestBody); + return restAPI.updateComment(serverName, userId, commentGUID, isMergeUpdate, isPublic, forLineage, forDuplicateProcessing, requestBody); } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/GlossaryExchangeResource.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/GlossaryExchangeResource.java index 83c4fd5c081..8d1d23f619a 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/GlossaryExchangeResource.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/server/spring/GlossaryExchangeResource.java @@ -5,14 +5,16 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; - -import org.odpi.openmetadata.accessservices.assetmanager.properties.MetadataCorrelationProperties; import org.odpi.openmetadata.accessservices.assetmanager.rest.*; import org.odpi.openmetadata.accessservices.assetmanager.server.GlossaryExchangeRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; - -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; /** @@ -52,6 +54,7 @@ public GlossaryExchangeResource() * * @param serverName name of the server to route the request to. * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param requestBody properties to store * * @return unique identifier of the new metadata element or @@ -61,11 +64,13 @@ public GlossaryExchangeResource() */ @PostMapping(path = "/glossaries") - public GUIDResponse createGlossary(@PathVariable String serverName, - @PathVariable String userId, - @RequestBody GlossaryRequestBody requestBody) + public GUIDResponse createGlossary(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, + @RequestBody ReferenceableRequestBody requestBody) { - return restAPI.createGlossary(serverName, userId, requestBody); + return restAPI.createGlossary(serverName, userId, assetManagerIsHome, requestBody); } @@ -78,6 +83,7 @@ public GUIDResponse createGlossary(@PathVariable String serverName, * * @param serverName name of the server to route the request to * @param userId calling user + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param requestBody properties that override the template * @@ -91,9 +97,11 @@ public GUIDResponse createGlossary(@PathVariable String serverName, public GUIDResponse createGlossaryFromTemplate(@PathVariable String serverName, @PathVariable String userId, @PathVariable String templateGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, @RequestBody TemplateRequestBody requestBody) { - return restAPI.createGlossaryFromTemplate(serverName, userId, templateGUID, requestBody); + return restAPI.createGlossaryFromTemplate(serverName, userId, assetManagerIsHome, templateGUID, requestBody); } @@ -104,6 +112,8 @@ public GUIDResponse createGlossaryFromTemplate(@PathVariable String * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to update * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody new properties for this element * * @return void or @@ -111,16 +121,20 @@ public GUIDResponse createGlossaryFromTemplate(@PathVariable String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - @PostMapping(path = "/glossaries/{glossaryGUID}") + @PostMapping(path = "/glossaries/{glossaryGUID}/update") - public VoidResponse updateGlossary(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, + public VoidResponse updateGlossary(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean isMergeUpdate, @RequestParam (required = false, defaultValue = "false") - boolean isMergeUpdate, - @RequestBody GlossaryRequestBody requestBody) + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.updateGlossary(serverName, userId, glossaryGUID, isMergeUpdate, requestBody); + return restAPI.updateGlossary(serverName, userId, glossaryGUID, isMergeUpdate, forLineage, forDuplicateProcessing, requestBody); } @@ -131,6 +145,8 @@ public VoidResponse updateGlossary(@PathVariable String serverName, * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata * * @return void or @@ -140,13 +156,17 @@ public VoidResponse updateGlossary(@PathVariable String serverName, */ @PostMapping(path = "/glossaries/{glossaryGUID}/remove") - public VoidResponse removeGlossary(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, + public VoidResponse removeGlossary(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, @RequestBody(required = false) - MetadataCorrelationProperties requestBody) + ReferenceableUpdateRequestBody requestBody) { - return restAPI.removeGlossary(serverName, userId, glossaryGUID, requestBody); + return restAPI.removeGlossary(serverName, userId, glossaryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -161,6 +181,8 @@ public VoidResponse removeGlossary(@PathVariable String s * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties to help with the mapping of the elements in the external asset manager and open metadata * * @return void or @@ -170,12 +192,16 @@ public VoidResponse removeGlossary(@PathVariable String s */ @PostMapping(path = "/glossaries/{glossaryGUID}/is-taxonomy") - public VoidResponse setGlossaryAsTaxonomy(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, - @RequestBody TaxonomyClassificationRequestBody requestBody) + public VoidResponse setGlossaryAsTaxonomy(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ClassificationRequestBody requestBody) { - return restAPI.setGlossaryAsTaxonomy(serverName, userId, glossaryGUID, requestBody); + return restAPI.setGlossaryAsTaxonomy(serverName, userId, glossaryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -185,6 +211,8 @@ public VoidResponse setGlossaryAsTaxonomy(@PathVariable String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody correlation properties for the external asset manager * * @return void or @@ -194,13 +222,17 @@ public VoidResponse setGlossaryAsTaxonomy(@PathVariable String */ @PostMapping(path = "/glossaries/{glossaryGUID}/is-taxonomy/remove") - public VoidResponse clearGlossaryAsTaxonomy(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, + public VoidResponse clearGlossaryAsTaxonomy(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, @RequestBody(required = false) - MetadataCorrelationProperties requestBody) + ClassificationRequestBody requestBody) { - return restAPI.clearGlossaryAsTaxonomy(serverName, userId, glossaryGUID, requestBody); + return restAPI.clearGlossaryAsTaxonomy(serverName, userId, glossaryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -214,6 +246,8 @@ public VoidResponse clearGlossaryAsTaxonomy(@PathVariable String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody description of the situations where this glossary is relevant. * * @return void or @@ -223,12 +257,16 @@ public VoidResponse clearGlossaryAsTaxonomy(@PathVariable String */ @PostMapping(path = "/glossaries/{glossaryGUID}/is-canonical") - public VoidResponse setGlossaryAsCanonical(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, - @RequestBody CanonicalVocabularyClassificationRequestBody requestBody) + public VoidResponse setGlossaryAsCanonical(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ClassificationRequestBody requestBody) { - return restAPI.setGlossaryAsCanonical(serverName, userId, glossaryGUID, requestBody); + return restAPI.setGlossaryAsCanonical(serverName, userId, glossaryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -238,6 +276,8 @@ public VoidResponse setGlossaryAsCanonical(@PathVariable String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the metadata element to remove + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody correlation properties for the external asset manager * * @return void or @@ -247,13 +287,17 @@ public VoidResponse setGlossaryAsCanonical(@PathVariable String */ @PostMapping(path = "/glossaries/{glossaryGUID}/is-canonical/remove") - public VoidResponse clearGlossaryAsCanonical(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, + public VoidResponse clearGlossaryAsCanonical(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, @RequestBody(required = false) - MetadataCorrelationProperties requestBody) + ClassificationRequestBody requestBody) { - return restAPI.clearGlossaryAsCanonical(serverName, userId, glossaryGUID, requestBody); + return restAPI.clearGlossaryAsCanonical(serverName, userId, glossaryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -266,6 +310,8 @@ public VoidResponse clearGlossaryAsCanonical(@PathVariable String * @param requestBody string to find in the properties * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * * @return list of matching metadata elements or * InvalidParameterException one of the parameters is invalid @@ -274,13 +320,17 @@ public VoidResponse clearGlossaryAsCanonical(@PathVariable String */ @PostMapping(path = "/glossaries/by-search-string") - public GlossaryElementsResponse findGlossaries(@PathVariable String serverName, - @PathVariable String userId, - @RequestParam int startFrom, - @RequestParam int pageSize, - @RequestBody SearchStringRequestBody requestBody) + public GlossaryElementsResponse findGlossaries(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody SearchStringRequestBody requestBody) { - return restAPI.findGlossaries(serverName, userId, startFrom, pageSize, requestBody); + return restAPI.findGlossaries(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); } @@ -292,6 +342,8 @@ public GlossaryElementsResponse findGlossaries(@PathVariable String * @param userId calling user * @param requestBody name to search for * @param startFrom paging start point + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param pageSize maximum results that can be returned * * @return list of matching metadata elements or @@ -301,13 +353,17 @@ public GlossaryElementsResponse findGlossaries(@PathVariable String */ @PostMapping(path = "/glossaries/by-name") - public GlossaryElementsResponse getGlossariesByName(@PathVariable String serverName, - @PathVariable String userId, - @RequestParam int startFrom, - @RequestParam int pageSize, - @RequestBody NameRequestBody requestBody) + public GlossaryElementsResponse getGlossariesByName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody NameRequestBody requestBody) { - return restAPI.getGlossariesByName(serverName, userId, startFrom, pageSize, requestBody); + return restAPI.getGlossariesByName(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); } @@ -318,6 +374,8 @@ public GlossaryElementsResponse getGlossariesByName(@PathVariable String * @param userId calling user * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody asset manager identifiers * * @return list of matching metadata elements or @@ -327,13 +385,17 @@ public GlossaryElementsResponse getGlossariesByName(@PathVariable String */ @PostMapping(path = "/glossaries/by-asset-manager") - public GlossaryElementsResponse getGlossariesForAssetManager(@PathVariable String serverName, - @PathVariable String userId, - @RequestParam int startFrom, - @RequestParam int pageSize, - @RequestBody AssetManagerIdentifiersRequestBody requestBody) + public GlossaryElementsResponse getGlossariesForAssetManager(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startFrom, + @RequestParam int pageSize, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody EffectiveTimeQueryRequestBody requestBody) { - return restAPI.getGlossariesForAssetManager(serverName, userId, startFrom, pageSize, requestBody); + return restAPI.getGlossariesForAssetManager(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); } @@ -343,6 +405,8 @@ public GlossaryElementsResponse getGlossariesForAssetManager(@PathVariable Str * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the requested metadata element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody asset manager identifiers * * @return matching metadata element or @@ -352,13 +416,17 @@ public GlossaryElementsResponse getGlossariesForAssetManager(@PathVariable Str */ @PostMapping(path = "/glossaries/{glossaryGUID}/retrieve") - public GlossaryElementResponse getGlossaryByGUID(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, + public GlossaryElementResponse getGlossaryByGUID(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, @RequestBody(required = false) - AssetManagerIdentifiersRequestBody requestBody) + EffectiveTimeQueryRequestBody requestBody) { - return restAPI.getGlossaryByGUID(serverName, userId, glossaryGUID, requestBody); + return restAPI.getGlossaryByGUID(serverName, userId, glossaryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -373,6 +441,9 @@ public GlossaryElementResponse getGlossaryByGUID(@PathVariable String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the category is located + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties about the glossary category to store * * @return unique identifier of the new glossary category or @@ -382,12 +453,18 @@ public GlossaryElementResponse getGlossaryByGUID(@PathVariable String */ @PostMapping(path = "/glossaries/{glossaryGUID}/categories") - public GUIDResponse createGlossaryCategory(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, - @RequestBody GlossaryCategoryRequestBody requestBody) + public GUIDResponse createGlossaryCategory(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.createGlossaryCategory(serverName, userId, glossaryGUID, requestBody); + return restAPI.createGlossaryCategory(serverName, userId, glossaryGUID, assetManagerIsHome, forLineage, forDuplicateProcessing, requestBody); } @@ -396,6 +473,7 @@ public GUIDResponse createGlossaryCategory(@PathVariable String * * @param serverName name of the server to route the request to * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the category is located * @param templateGUID unique identifier of the metadata element to copy * @param requestBody properties that override the template * @@ -404,14 +482,17 @@ public GUIDResponse createGlossaryCategory(@PathVariable String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - @PostMapping(path = "/glossaries/categories/from-template/{templateGUID}") + @PostMapping(path = "/glossaries/{glossaryGUID}/categories/from-template/{templateGUID}") public GUIDResponse createGlossaryCategoryFromTemplate(@PathVariable String serverName, @PathVariable String userId, + @PathVariable String glossaryGUID, @PathVariable String templateGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, @RequestBody TemplateRequestBody requestBody) { - return restAPI.createGlossaryCategoryFromTemplate(serverName, userId, templateGUID, requestBody); + return restAPI.createGlossaryCategoryFromTemplate(serverName, userId, glossaryGUID, templateGUID, assetManagerIsHome, requestBody); } @@ -421,6 +502,7 @@ public GUIDResponse createGlossaryCategoryFromTemplate(@PathVariable String * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryCategoryGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param forLineage return elements marked with the Memento classification? * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody new properties for the metadata element @@ -430,18 +512,20 @@ public GUIDResponse createGlossaryCategoryFromTemplate(@PathVariable String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - @PostMapping(path = "/glossaries/categories/{glossaryCategoryGUID}") + @PostMapping(path = "/glossaries/categories/{glossaryCategoryGUID}/update") - public VoidResponse updateGlossaryCategory(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryCategoryGUID, + public VoidResponse updateGlossaryCategory(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryCategoryGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean isMergeUpdate, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, - @RequestBody GlossaryCategoryRequestBody requestBody) + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.updateGlossaryCategory(serverName, userId, glossaryCategoryGUID, forLineage, forDuplicateProcessing, requestBody); + return restAPI.updateGlossaryCategory(serverName, userId, glossaryCategoryGUID, isMergeUpdate, forLineage, forDuplicateProcessing, requestBody); } @@ -501,9 +585,9 @@ public VoidResponse clearCategoryParent(@PathVariable String @PathVariable String glossaryParentCategoryGUID, @PathVariable String glossaryChildCategoryGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) EffectiveTimeQueryRequestBody requestBody) { @@ -532,11 +616,11 @@ public VoidResponse removeGlossaryCategory(@PathVariable String @PathVariable String userId, @PathVariable String glossaryCategoryGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ReferenceableUpdateRequestBody requestBody) { return restAPI.removeGlossaryCategory(serverName, userId, glossaryCategoryGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -752,6 +836,9 @@ public GlossaryCategoryElementsResponse getGlossarySubCategories(@PathVariable S * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the term is located + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties for the glossary term * * @return unique identifier of the new metadata element for the glossary term or @@ -761,12 +848,18 @@ public GlossaryCategoryElementsResponse getGlossarySubCategories(@PathVariable S */ @PostMapping(path = "/glossaries/{glossaryGUID}/terms") - public GUIDResponse createGlossaryTerm(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, - @RequestBody GlossaryTermRequestBody requestBody) + public GUIDResponse createGlossaryTerm(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody ReferenceableUpdateRequestBody requestBody) { - return restAPI.createGlossaryTerm(serverName, userId, glossaryGUID, requestBody); + return restAPI.createGlossaryTerm(serverName, userId, glossaryGUID, assetManagerIsHome, forLineage, forDuplicateProcessing, requestBody); } @@ -776,6 +869,9 @@ public GUIDResponse createGlossaryTerm(@PathVariable String ser * @param serverName name of the server to route the request to * @param userId calling user * @param glossaryGUID unique identifier of the glossary where the term is located + * @param assetManagerIsHome ensure that only the asset manager can update this element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody properties for the glossary term * * @return unique identifier of the new metadata element for the glossary term or @@ -788,9 +884,15 @@ public GUIDResponse createGlossaryTerm(@PathVariable String ser public GUIDResponse createControlledGlossaryTerm(@PathVariable String serverName, @PathVariable String userId, @PathVariable String glossaryGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, @RequestBody ControlledGlossaryTermRequestBody requestBody) { - return restAPI.createControlledGlossaryTerm(serverName, userId, glossaryGUID, requestBody); + return restAPI.createControlledGlossaryTerm(serverName, userId, glossaryGUID, assetManagerIsHome, forLineage, forDuplicateProcessing, requestBody); } @@ -799,7 +901,9 @@ public GUIDResponse createControlledGlossaryTerm(@PathVariable String * * @param serverName name of the server to route the request to * @param userId calling user + * @param glossaryGUID unique identifier of the glossary where the term is located * @param templateGUID unique identifier of the metadata element to copy + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param requestBody properties that override the template * * @return unique identifier of the new metadata element for the glossary term or @@ -807,14 +911,17 @@ public GUIDResponse createControlledGlossaryTerm(@PathVariable String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - @PostMapping(path = "/glossaries/terms/from-template/{templateGUID}") + @PostMapping(path = "/glossaries/{glossaryGUID}/terms/from-template/{templateGUID}") public GUIDResponse createGlossaryTermFromTemplate(@PathVariable String serverName, @PathVariable String userId, + @PathVariable String glossaryGUID, @PathVariable String templateGUID, + @RequestParam (required = false, defaultValue = "false") + boolean assetManagerIsHome, @RequestBody TemplateRequestBody requestBody) { - return restAPI.createGlossaryTermFromTemplate(serverName, userId, templateGUID, requestBody); + return restAPI.createGlossaryTermFromTemplate(serverName, userId, glossaryGUID, templateGUID, assetManagerIsHome, requestBody); } @@ -834,7 +941,7 @@ public GUIDResponse createGlossaryTermFromTemplate(@PathVariable String * UserNotAuthorizedException the user is not authorized to issue this request * PropertyServerException there is a problem reported in the open metadata server(s) */ - @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}") + @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/update") public VoidResponse updateGlossaryTerm(@PathVariable String serverName, @PathVariable String userId, @@ -845,7 +952,7 @@ public VoidResponse updateGlossaryTerm(@PathVariable String ser boolean forLineage, @RequestParam (required = false, defaultValue = "false") boolean forDuplicateProcessing, - @RequestBody GlossaryTermRequestBody requestBody) + @RequestBody ReferenceableUpdateRequestBody requestBody) { return restAPI.updateGlossaryTerm(serverName, userId, glossaryTermGUID, isMergeUpdate, forLineage, forDuplicateProcessing, requestBody); } @@ -932,14 +1039,14 @@ public VoidResponse setupTermCategory(@PathVariable String serv */ @PostMapping(path = "/glossaries/categories/{glossaryCategoryGUID}/terms/{glossaryTermGUID}/remove") - public VoidResponse clearTermCategory(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryCategoryGUID, - @PathVariable String glossaryTermGUID, + public VoidResponse clearTermCategory(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryCategoryGUID, + @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) { @@ -966,11 +1073,11 @@ public VoidResponse clearTermCategory(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermOneGUID}/relationships/{relationshipTypeName}/terms/{glossaryTermTwoGUID}") - public VoidResponse setupTermRelationship(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermOneGUID, - @PathVariable String relationshipTypeName, - @PathVariable String glossaryTermTwoGUID, + public VoidResponse setupTermRelationship(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermOneGUID, + @PathVariable String relationshipTypeName, + @PathVariable String glossaryTermTwoGUID, @RequestParam (required = false, defaultValue = "false") boolean forLineage, @RequestParam (required = false, defaultValue = "false") @@ -1000,11 +1107,11 @@ public VoidResponse setupTermRelationship(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermOneGUID}/relationships/{relationshipTypeName}/terms/{glossaryTermTwoGUID}/update") - public VoidResponse updateTermRelationship(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermOneGUID, - @PathVariable String relationshipTypeName, - @PathVariable String glossaryTermTwoGUID, + public VoidResponse updateTermRelationship(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermOneGUID, + @PathVariable String relationshipTypeName, + @PathVariable String glossaryTermTwoGUID, @RequestParam (required = false, defaultValue = "false") boolean forLineage, @RequestParam (required = false, defaultValue = "false") @@ -1034,15 +1141,15 @@ public VoidResponse updateTermRelationship(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermOneGUID}/relationships/{relationshipTypeName}/terms/{glossaryTermTwoGUID}/remove") - public VoidResponse clearTermRelationship(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermOneGUID, - @PathVariable String relationshipTypeName, - @PathVariable String glossaryTermTwoGUID, + public VoidResponse clearTermRelationship(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermOneGUID, + @PathVariable String relationshipTypeName, + @PathVariable String glossaryTermTwoGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) EffectiveTimeQueryRequestBody requestBody) { @@ -1071,11 +1178,11 @@ public VoidResponse setTermAsAbstractConcept(@PathVariable String @PathVariable String userId, @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setTermAsAbstractConcept(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1098,15 +1205,15 @@ public VoidResponse setTermAsAbstractConcept(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-abstract-concept/remove") - public VoidResponse clearTermAsAbstractConcept(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse clearTermAsAbstractConcept(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsAbstractConcept(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1132,11 +1239,11 @@ public VoidResponse setTermAsDataValue(@PathVariable String @PathVariable String userId, @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setTermAsDataValue(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1159,15 +1266,15 @@ public VoidResponse setTermAsDataValue(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-data-value/remove") - public VoidResponse clearTermAsDataValue(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse clearTermAsDataValue(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsDataValue(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1190,14 +1297,14 @@ public VoidResponse clearTermAsDataValue(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-activity") - public VoidResponse setTermAsActivity(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse setTermAsActivity(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, - @RequestBody ActivityTermClassificationRequestBody requestBody) + boolean forDuplicateProcessing, + @RequestBody ClassificationRequestBody requestBody) { return restAPI.setTermAsActivity(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1220,15 +1327,15 @@ public VoidResponse setTermAsActivity(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-activity/remove") - public VoidResponse clearTermAsActivity(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse clearTermAsActivity(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsActivity(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1251,14 +1358,14 @@ public VoidResponse clearTermAsActivity(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-context-definition") - public VoidResponse setTermAsContext(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse setTermAsContext(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, - @RequestBody ContextDefinitionClassificationRequestBody requestBody) + boolean forDuplicateProcessing, + @RequestBody ClassificationRequestBody requestBody) { return restAPI.setTermAsContext(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1281,15 +1388,15 @@ public VoidResponse setTermAsContext(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-context-definition/remove") - public VoidResponse clearTermAsContext(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse clearTermAsContext(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsContext(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1312,15 +1419,15 @@ public VoidResponse clearTermAsContext(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-spine-object") - public VoidResponse setTermAsSpineObject(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse setTermAsSpineObject(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setTermAsSpineObject(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1351,7 +1458,7 @@ public VoidResponse clearTermAsSpineObject(@PathVariable String @RequestParam (required = false, defaultValue = "false") boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsSpineObject(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1382,7 +1489,7 @@ public VoidResponse setTermAsSpineAttribute(@PathVariable String @RequestParam (required = false, defaultValue = "false") boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setTermAsSpineAttribute(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1413,7 +1520,7 @@ public VoidResponse clearTermAsSpineAttribute(@PathVariable String @RequestParam (required = false, defaultValue = "false") boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsSpineAttribute(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1436,15 +1543,15 @@ public VoidResponse clearTermAsSpineAttribute(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/is-object-identifier") - public VoidResponse setTermAsObjectIdentifier(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse setTermAsObjectIdentifier(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.setTermAsObjectIdentifier(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1475,7 +1582,7 @@ public VoidResponse clearTermAsObjectIdentifier(@PathVariable String @RequestParam (required = false, defaultValue = "false") boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ClassificationRequestBody requestBody) { return restAPI.clearTermAsObjectIdentifier(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1557,15 +1664,15 @@ public VoidResponse archiveGlossaryTerm(@PathVariable String */ @PostMapping(path = "/glossaries/terms/{glossaryTermGUID}/remove") - public VoidResponse removeGlossaryTerm(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryTermGUID, + public VoidResponse removeGlossaryTerm(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryTermGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) - UpdateRequestBody requestBody) + ReferenceableUpdateRequestBody requestBody) { return restAPI.removeGlossaryTerm(serverName, userId, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -1595,9 +1702,9 @@ public GlossaryTermElementsResponse findGlossaryTerms(@PathVariable String @RequestParam int startFrom, @RequestParam int pageSize, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody GlossarySearchStringRequestBody requestBody) { return restAPI.findGlossaryTerms(serverName, userId, startFrom, pageSize, forLineage, forDuplicateProcessing, requestBody); @@ -1623,15 +1730,15 @@ public GlossaryTermElementsResponse findGlossaryTerms(@PathVariable String */ @PostMapping(path = "/glossaries/{glossaryGUID}/terms/retrieve") - public GlossaryTermElementsResponse getTermsForGlossary(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String glossaryGUID, - @RequestParam int startFrom, - @RequestParam int pageSize, + public GlossaryTermElementsResponse getTermsForGlossary(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String glossaryGUID, + @RequestParam int startFrom, + @RequestParam int pageSize, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) EffectiveTimeQueryRequestBody requestBody) { @@ -1828,9 +1935,9 @@ public VoidResponse updateExternalGlossaryLink(@PathVariable String @PathVariable String userId, @PathVariable String externalLinkGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody ExternalGlossaryLinkRequestBody requestBody) { return restAPI.updateExternalGlossaryLink(serverName, userId, externalLinkGUID, forLineage, forDuplicateProcessing, requestBody); @@ -1854,13 +1961,13 @@ public VoidResponse updateExternalGlossaryLink(@PathVariable String */ @PostMapping(path = "/glossaries/external-links/{externalLinkGUID}/remove") - public VoidResponse removeExternalGlossaryLink(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String externalLinkGUID, + public VoidResponse removeExternalGlossaryLink(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String externalLinkGUID, @RequestParam (required = false, defaultValue = "false") - boolean forLineage, + boolean forLineage, @RequestParam (required = false, defaultValue = "false") - boolean forDuplicateProcessing, + boolean forDuplicateProcessing, @RequestBody(required = false) EffectiveTimeQueryRequestBody requestBody) { 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 7539e67bd42..aa25f5007a1 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,14 +4,16 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; -import org.odpi.openmetadata.accessservices.assetmanager.properties.SecurityTagsProperties; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.EffectiveTimeQueryRequestBody; +import org.odpi.openmetadata.accessservices.assetmanager.rest.RelationshipRequestBody; import org.odpi.openmetadata.accessservices.assetmanager.server.StewardshipExchangeRESTServices; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.VoidResponse; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -37,7 +39,268 @@ public class StewardshipExchangeResource public StewardshipExchangeResource() { } - + + + /** + * Classify/reclassify the element (typically an asset) to indicate the level of confidence that the organization + * has that the data is complete, accurate and up-to-date. The level of confidence is expressed by the + * levelIdentifier property. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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/{elementGUID}/confidence") + + public VoidResponse setConfidenceClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.setConfidenceClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidence to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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/{elementGUID}/confidence/remove") + + public VoidResponse clearConfidenceClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.clearConfidenceClassification(serverName, userId, elementGUID, 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. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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/{elementGUID}/criticality") + + public VoidResponse setCriticalityClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.setCriticalityClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the criticality classification from the element. This normally occurs when the organization has lost track of the level of + * criticality to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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/{elementGUID}/criticality/remove") + + public VoidResponse clearCriticalityClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.clearCriticalityClassification(serverName, userId, elementGUID, 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 + * of confidentiality is a suggestion for any element linked to the glossary term via the SemanticAssignment classification. + * The level of confidence is expressed by the levelIdentifier property. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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/{elementGUID}/confidentiality") + + public VoidResponse setConfidentialityClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.setConfidentialityClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the confidence classification from the element. This normally occurs when the organization has lost track of the level of + * confidentiality to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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/{elementGUID}/confidentiality/remove") + + public VoidResponse clearConfidentialityClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.clearConfidentialityClassification(serverName, userId, elementGUID, 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 + * property. The dates after which the element/resource is archived and then deleted are specified in the archiveAfter and deleteAfter + * properties respectively. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to classify + * @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/{elementGUID}/retention") + + public VoidResponse setRetentionClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.setRetentionClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the retention classification from the element. This normally occurs when the organization has lost track of, or no longer needs to + * track the retention period to assign to the element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to unclassify + * @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/{elementGUID}/retention/remove") + + public VoidResponse clearRetentionClassification(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.clearRetentionClassification(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + /** * Add or replace the security tags for an element. @@ -45,6 +308,8 @@ public StewardshipExchangeResource() * @param serverName name of the server instance to connect to * @param userId calling user * @param elementGUID unique identifier of element to attach to + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody list of security labels and properties * * @return void or @@ -54,12 +319,17 @@ public StewardshipExchangeResource() */ @PostMapping(path = "/elements/{elementGUID}/security-tags") - public VoidResponse addSecurityTags(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String elementGUID, - @RequestBody SecurityTagsProperties requestBody) + public VoidResponse addSecurityTags(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) { - return restAPI.addSecurityTags(serverName, userId, elementGUID, requestBody); + return restAPI.addSecurityTags(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); } @@ -69,6 +339,8 @@ public VoidResponse addSecurityTags(@PathVariable String serverN * @param serverName name of the server instance to connect to * @param userId calling user * @param elementGUID unique identifier of element + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? * @param requestBody null request body * * @return void or @@ -81,8 +353,332 @@ public VoidResponse addSecurityTags(@PathVariable String serverN public VoidResponse removeSecurityTags(@PathVariable String serverName, @PathVariable String userId, @PathVariable String elementGUID, - @RequestBody NullRequestBody requestBody) + @RequestParam (required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody(required = false) + ClassificationRequestBody requestBody) + { + return restAPI.removeSecurityTags(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Add or replace the ownership classification for an element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID element to link it to - its type must inherit from Referenceable. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification 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/{elementGUID}/ownership") + + public VoidResponse addOwnership(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.addOwnership(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the ownership classification from an element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID element where the classification needs to be removed. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification 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/{elementGUID}/ownership/remove") + + public VoidResponse clearOwnership(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.clearOwnership(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Add or replace the origin classification for an asset. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param assetGUID element to link it to - its type must inherit from Asset. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/assets/{assetGUID}/origin") + + public VoidResponse addAssetOrigin(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String assetGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.addAssetOrigin(serverName, userId, assetGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the origin classification from an asset. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param assetGUID element where the classification needs to be removed. + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification request + * + * @return void or + * InvalidParameterException full path or userId is null or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem + */ + @PostMapping(path = "/assets/{assetGUID}/origin/remove") + + public VoidResponse clearAssetOrigin(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String assetGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.clearAssetOrigin(serverName, userId, assetGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Classify the element to assert that the definitions it represents are part of a subject area definition. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification 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/{elementGUID}/subject-area-member") + + public VoidResponse addElementToSubjectArea(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.addElementToSubjectArea(serverName, userId, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the subject area designation from the identified element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param elementGUID unique identifier of the metadata element to update + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param requestBody properties for classification 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/{elementGUID}/subject-area-member/remove") + + public VoidResponse removeElementFromSubjectArea(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + ClassificationRequestBody requestBody) + { + return restAPI.removeElementFromSubjectArea(serverName, userId, elementGUID, 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. + * + * @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 glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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 + */ + @PostMapping(path = "/elements/{elementGUID}/semantic-assignment/terms/{glossaryTermGUID}") + + public VoidResponse setupSemanticAssignment(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String glossaryTermGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + RelationshipRequestBody requestBody) + { + return restAPI.setupSemanticAssignment(serverName, userId, elementGUID, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove a semantic assignment relationship between an element and its glossary term. + * + * @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 glossaryTermGUID unique identifier of the glossary term that provides the meaning + * @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 + */ + @PostMapping(path = "/elements/{elementGUID}/semantic-assignment/terms/{glossaryTermGUID}/remove") + + public VoidResponse clearSemanticAssignment(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String elementGUID, + @PathVariable String glossaryTermGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + EffectiveTimeQueryRequestBody requestBody) + { + return restAPI.clearSemanticAssignment(serverName, userId, elementGUID, glossaryTermGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Link a governance definition to an element using the GovernedBy relationship. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to link + * @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 + */ + @PostMapping(path = "/elements/{elementGUID}/governed-by/definition/{definitionGUID}") + + public VoidResponse addGovernanceDefinitionToElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String definitionGUID, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + RelationshipRequestBody requestBody) + { + return restAPI.addGovernanceDefinitionToElement(serverName, userId, definitionGUID, elementGUID, forLineage, forDuplicateProcessing, requestBody); + } + + + /** + * Remove the GovernedBy relationship between a governance definition and an element. + * + * @param serverName name of the server instance to connect to + * @param userId calling user + * @param definitionGUID identifier of the governance definition to link + * @param elementGUID unique identifier of the metadata element to update + * @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 + */ + @PostMapping(path = "/elements/{elementGUID}/governed-by/definition/{definitionGUID}/remove") + + public VoidResponse removeGovernanceDefinitionFromElement(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String definitionGUID, + @PathVariable String elementGUID, + @RequestParam(required = false, defaultValue = "false") + boolean forLineage, + @RequestParam (required = false, defaultValue = "false") + boolean forDuplicateProcessing, + @RequestBody (required = false) + EffectiveTimeQueryRequestBody requestBody) { - return restAPI.removeSecurityTags(serverName, userId, elementGUID, requestBody); + return restAPI.removeGovernanceDefinitionFromElement(serverName, userId, definitionGUID, elementGUID, forLineage, forDuplicateProcessing, requestBody); } } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OriginRequestBody.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OriginRequestBody.java index 1608b9392c5..ef8f505707d 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OriginRequestBody.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OriginRequestBody.java @@ -7,6 +7,7 @@ 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; @@ -23,7 +24,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class OriginRequestBody extends AssetOwnerOMASAPIRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String organizationGUID = null; private String businessCapabilityGUID = null; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OwnerRequestBody.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OwnerRequestBody.java index c84c4124bcc..b79e785f121 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OwnerRequestBody.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/OwnerRequestBody.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.frameworks.connectors.properties.beans.OwnerType; +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 OwnerRequestBody extends AssetOwnerOMASAPIRequestBody { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private OwnerType ownerType = null; private String ownerId = null; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java index 21c8769a6c2..6aaf0c76b95 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java @@ -881,6 +881,7 @@ public void addAssetOrigin(String userId, OriginRequestBody requestBody = new OriginRequestBody(); requestBody.setBusinessCapabilityGUID(businessCapabilityGUID); requestBody.setOrganizationGUID(organizationGUID); + requestBody.setOtherOriginValues(otherOriginValues); restClient.callVoidPostRESTCall(methodName, urlTemplate, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java index 253b90a56ea..1eac22b29f2 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/metadataelements/RelatedElement.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.datamanager.properties.RelationshipProperties; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; @@ -25,7 +26,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class RelatedElement implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private ElementHeader relationshipHeader = null; private RelationshipProperties relationshipProperties = null; diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/TemplateRequestBody.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/TemplateRequestBody.java index 016d6fb67de..c66a7cbda19 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/TemplateRequestBody.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/rest/TemplateRequestBody.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.datamanager.properties.TemplateProperties; +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 TemplateRequestBody extends TemplateProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String externalSourceGUID = null; private String externalSourceName = null; 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 0bb0ffbf18f..c70aac01940 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 @@ -10,6 +10,7 @@ import org.odpi.openmetadata.metadatasecurity.server.OpenMetadataServerSecurityVerifier; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; +import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; @@ -169,9 +170,28 @@ public String attachNewComment(String userId, serviceName, serverName); - if (anchorGUID != null) + EntityDetail parentEntity = this.getEntityFromRepository(userId, + parentGUID, + parentGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + null, + null, + forLineage, + forDuplicateProcessing, + supportedZones, + effectiveTime, + methodName); + + String parentAnchorGUID = anchorGUID; + + if (parentEntity != null) { - builder.setAnchors(userId, anchorGUID, methodName); + parentAnchorGUID = this.getAnchorGUIDFromAnchorsClassification(parentEntity, methodName); + } + + if (parentAnchorGUID != null) + { + builder.setAnchors(userId, parentAnchorGUID, methodName); } builder.setEffectivityDates(effectiveFrom, effectiveTo); @@ -187,25 +207,23 @@ public String attachNewComment(String userId, if (commentGUID != null) { - this.linkElementToElement(userId, - externalSourceGUID, - externalSourceName, - parentGUID, - parentGUIDParameterName, - OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, - commentGUID, - commentGUIDParameter, - OpenMetadataAPIMapper.COMMENT_TYPE_NAME, - forLineage, - forDuplicateProcessing, - supportedZones, - OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_GUID, - OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_NAME, - builder.getRelationshipInstanceProperties(methodName), - effectiveFrom, - effectiveTo, - effectiveTime, - methodName); + this.uncheckedLinkElementToElement(userId, + externalSourceGUID, + externalSourceName, + parentGUID, + parentGUIDParameterName, + OpenMetadataAPIMapper.REFERENCEABLE_TYPE_NAME, + commentGUID, + commentGUIDParameter, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_GUID, + OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_NAME, + builder.getRelationshipInstanceProperties(methodName), + effectiveFrom, + methodName); } return commentGUID; @@ -220,9 +238,11 @@ public String attachNewComment(String userId, * @param externalSourceName name of the software capability entity that represented the external source * @param commentGUID unique identifier for the comment to change * @param commentGUIDParameterName name of parameter for commentGUID + * @param qualifiedName unique name of the comment * @param commentType type of comment enum. * @param commentText the text of the comment. * @param isPublic indicates whether the feedback should be shared or only be visible to the originating user + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @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? @@ -234,22 +254,24 @@ public String attachNewComment(String userId, * @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 void updateComment(String userId, - String externalSourceGUID, - String externalSourceName, - String commentGUID, - String commentGUIDParameterName, - int commentType, - String commentText, - boolean isPublic, - Date effectiveFrom, - Date effectiveTo, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public void updateComment(String userId, + String externalSourceGUID, + String externalSourceName, + String commentGUID, + String commentGUIDParameterName, + String qualifiedName, + int commentType, + String commentText, + boolean isPublic, + boolean isMergeUpdate, + Date effectiveFrom, + Date effectiveTo, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { final String textParameter = "commentText"; @@ -264,7 +286,7 @@ public void updateComment(String userId, effectiveTime, methodName); - CommentBuilder builder = new CommentBuilder(null, + CommentBuilder builder = new CommentBuilder(qualifiedName, commentType, commentText, isPublic, @@ -285,7 +307,7 @@ public void updateComment(String userId, forDuplicateProcessing, supportedZones, builder.getInstanceProperties(methodName), - true, + isMergeUpdate, effectiveTime, methodName); @@ -381,70 +403,129 @@ public void removeCommentFromElement(String userId, /** - * Return the comments attached to an entity. + * Link a comment that contains the best answer to a question posed in another comment. * - * @param userId calling user - * @param anchorGUID expected anchorGUID for this element - * @param anchorGUIDParameterName parameter supplying anchorGUID - * @param elementGUID identifier for the entity that the comment is attached to - * @param elementGUIDParameterName name of the parameter providing the element GUID - * @param elementTypeName name of the type of the anchor entity - * @param serviceSupportedZones supported zones for the particular service - * @param startingFrom where to start from in the list - * @param pageSize maximum number of results that can be returned + * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param questionCommentGUID unique identifier of the comment containing the question + * @param questionCommentGUIDParameterName parameter supplying questionCommentGUID + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param answerCommentGUIDParameterName parameter supplying the answerCommentGUID + * @param isPublic who can retrieve the relationship + * @param effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) * @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 list of retrieved objects - * - * @throws InvalidParameterException the input properties are invalid - * @throws UserNotAuthorizedException user not authorized to issue this request - * @throws PropertyServerException problem accessing the property server + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public List getComments(String userId, - String anchorGUID, - String anchorGUIDParameterName, - String elementGUID, - String elementGUIDParameterName, - String elementTypeName, - List serviceSupportedZones, - int startingFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public void setupAcceptedAnswer(String userId, + String externalSourceGUID, + String externalSourceName, + String questionCommentGUID, + String questionCommentGUIDParameterName, + String answerCommentGUID, + String answerCommentGUIDParameterName, + boolean isPublic, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return this.getAttachedElements(userId, - anchorGUID, - anchorGUIDParameterName, - elementGUID, - elementGUIDParameterName, - elementTypeName, - OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_GUID, - OpenMetadataAPIMapper.REFERENCEABLE_TO_COMMENT_TYPE_NAME, - OpenMetadataAPIMapper.COMMENT_TYPE_NAME, - null, - null, - 0, - forLineage, - forDuplicateProcessing, - serviceSupportedZones, - startingFrom, - pageSize, - effectiveTime, - methodName); + InstanceProperties instanceProperties = repositoryHelper.addBooleanPropertyToInstance(serviceName, + null, + OpenMetadataAPIMapper.IS_PUBLIC_PROPERTY_NAME, + isPublic, + methodName); + this.linkElementToElement(userId, + externalSourceGUID, + externalSourceName, + questionCommentGUID, + questionCommentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + answerCommentGUID, + answerCommentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.ANSWER_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.ANSWER_RELATIONSHIP_TYPE_NAME, + instanceProperties, + effectiveFrom, + effectiveTo, + effectiveTime, + methodName); } /** - * Return the comments attached to an entity. (No special security checking is required). + * Unlink a comment that contains an answer to a question posed in another comment. + * + * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param questionCommentGUID unique identifier of the comment containing the question + * @param questionCommentGUIDParameterName parameter supplying questionCommentGUID + * @param answerCommentGUID unique identifier of the comment containing the accepted answer + * @param answerCommentGUIDParameterName parameter supplying answerCommentGUID + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param forLineage return elements marked with the Memento classification? + * @param forDuplicateProcessing do not merge elements marked as duplicates? + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void clearAcceptedAnswer(String userId, + String externalSourceGUID, + String externalSourceName, + String questionCommentGUID, + String questionCommentGUIDParameterName, + String answerCommentGUID, + String answerCommentGUIDParameterName, + Date effectiveTime, + boolean forLineage, + boolean forDuplicateProcessing, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.unlinkElementFromElement(userId, + false, + externalSourceGUID, + externalSourceName, + questionCommentGUID, + questionCommentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + answerCommentGUID, + answerCommentGUIDParameterName, + OpenMetadataAPIMapper.COMMENT_TYPE_GUID, + OpenMetadataAPIMapper.COMMENT_TYPE_NAME, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.ANSWER_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.ANSWER_RELATIONSHIP_TYPE_NAME, + effectiveTime, + methodName); + } + + /** + * Return the comments attached to an entity. * * @param userId calling user + * @param anchorGUID expected anchorGUID for this element + * @param anchorGUIDParameterName parameter supplying anchorGUID * @param elementGUID identifier for the entity that the comment is attached to * @param elementGUIDParameterName name of the parameter providing the element GUID * @param elementTypeName name of the type of the anchor entity @@ -463,6 +544,8 @@ public List getComments(String userId, * @throws PropertyServerException problem accessing the property server */ public List getComments(String userId, + String anchorGUID, + String anchorGUIDParameterName, String elementGUID, String elementGUIDParameterName, String elementTypeName, @@ -477,8 +560,8 @@ public List getComments(String userId, UserNotAuthorizedException { return this.getAttachedElements(userId, - null, - null, + anchorGUID, + anchorGUIDParameterName, elementGUID, elementGUIDParameterName, elementTypeName, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryCategoryHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryCategoryHandler.java index 6ea007ae59d..b2dcefd88ca 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryCategoryHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryCategoryHandler.java @@ -79,6 +79,8 @@ public GlossaryCategoryHandler(OpenMetadataAPIGenericConverter converter, * Create the glossary category object. * * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source * @param glossaryGUID unique identifier of the owning glossary * @param glossaryGUIDParameterName parameter supplying glossaryGUID * @param qualifiedName unique name for the category - used in other configuration @@ -98,6 +100,8 @@ public GlossaryCategoryHandler(OpenMetadataAPIGenericConverter converter, * @throws UserNotAuthorizedException security access problem */ public String createGlossaryCategory(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, String qualifiedName, @@ -142,8 +146,8 @@ public String createGlossaryCategory(String userId, builder.setEffectivityDates(effectiveFrom, effectiveTo); String glossaryCategoryGUID = this.createBeanInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, typeGUID, typeName, builder, @@ -158,8 +162,8 @@ public String createGlossaryCategory(String userId, final String glossaryCategoryGUIDParameterName = "glossaryCategoryGUID"; this.uncheckedLinkElementToElement(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryGUID, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, @@ -184,6 +188,10 @@ public String createGlossaryCategory(String userId, * Create a category from a template. * * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param glossaryGUIDParameterName parameter supplying glossaryGUID * @param templateGUID unique identifier of the metadata element to copy * @param qualifiedName unique name for the category - used in other configuration * @param displayName short display name for the category @@ -197,6 +205,10 @@ public String createGlossaryCategory(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public String createGlossaryCategoryFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String glossaryGUID, + String glossaryGUIDParameterName, String templateGUID, String qualifiedName, String displayName, @@ -219,18 +231,48 @@ public String createGlossaryCategoryFromTemplate(String userId, serviceName, serverName); - return this.createBeanFromTemplate(userId, - null, - null, - templateGUID, - templateGUIDParameterName, - OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_GUID, - OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, - qualifiedName, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - builder, - supportedZones, - methodName); + builder.setAnchors(userId, glossaryGUID, methodName); + + String glossaryCategoryGUID = this.createBeanFromTemplate(userId, + externalSourceGUID, + externalSourceName, + templateGUID, + templateGUIDParameterName, + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_GUID, + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + supportedZones, + methodName); + + if (glossaryCategoryGUID != null) + { + /* + * Link the category to its glossary. This relationship is always effective. + */ + final String glossaryCategoryGUIDParameterName = "glossaryCategoryGUID"; + + this.uncheckedLinkElementToElement(userId, + externalSourceGUID, + externalSourceName, + glossaryGUID, + glossaryGUIDParameterName, + OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, + glossaryCategoryGUID, + glossaryCategoryGUIDParameterName, + OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, + true, + true, + supportedZones, + OpenMetadataAPIMapper.CATEGORY_ANCHOR_TYPE_GUID, + OpenMetadataAPIMapper.CATEGORY_ANCHOR_TYPE_NAME, + null, + null, + methodName); + } + + return glossaryCategoryGUID; } @@ -238,6 +280,8 @@ public String createGlossaryCategoryFromTemplate(String userId, * Update the category. * * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source * @param glossaryCategoryGUID unique identifier for the category to update * @param glossaryCategoryGUIDParameterName parameter supplying the category * @param qualifiedName unique name for the category - used in other configuration @@ -258,6 +302,8 @@ public String createGlossaryCategoryFromTemplate(String userId, * @throws UserNotAuthorizedException security access problem */ public void updateGlossaryCategory(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryCategoryGUID, String glossaryCategoryGUIDParameterName, String qualifiedName, @@ -306,8 +352,8 @@ public void updateGlossaryCategory(String userId, builder.setEffectivityDates(effectiveFrom, effectiveTo); this.updateBeanInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryCategoryGUID, glossaryCategoryGUIDParameterName, typeGUID, @@ -326,6 +372,8 @@ public void updateGlossaryCategory(String userId, * Create a parent-child relationship between two categories. * * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source * @param glossaryParentCategoryGUID unique identifier of the glossary super-category * @param glossaryParentCategoryGUIDParameterName parameter supplying the super-category * @param glossaryChildCategoryGUID unique identifier of the glossary subcategory @@ -342,6 +390,8 @@ public void updateGlossaryCategory(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void setupCategoryParent(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryParentCategoryGUID, String glossaryParentCategoryGUIDParameterName, String glossaryChildCategoryGUID, @@ -356,8 +406,8 @@ public void setupCategoryParent(String userId, PropertyServerException { this.linkElementToElement(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryParentCategoryGUID, glossaryParentCategoryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, @@ -381,6 +431,8 @@ public void setupCategoryParent(String userId, * Remove a parent-child relationship between two categories. * * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source * @param glossaryParentCategoryGUID unique identifier of the glossary super-category * @param glossaryParentCategoryGUIDParameterName parameter supplying the super-category * @param glossaryChildCategoryGUID unique identifier of the glossary subcategory @@ -395,6 +447,8 @@ public void setupCategoryParent(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void clearCategoryParent(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryParentCategoryGUID, String glossaryParentCategoryGUIDParameterName, String glossaryChildCategoryGUID, @@ -408,8 +462,8 @@ public void clearCategoryParent(String userId, { this.unlinkElementFromElement(userId, false, - null, - null, + externalSourceGUID, + externalSourceName, glossaryParentCategoryGUID, glossaryParentCategoryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_NAME, @@ -430,6 +484,8 @@ public void clearCategoryParent(String userId, * Remove the metadata element representing a glossary category. * * @param userId calling user + * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local + * @param externalSourceName name of the software capability entity that represented the external source * @param glossaryCategoryGUID unique identifier of the metadata element to remove * @param glossaryCategoryGUIDParameterName parameter for glossaryCategoryGUID * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) @@ -442,6 +498,8 @@ public void clearCategoryParent(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void removeGlossaryCategory(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryCategoryGUID, String glossaryCategoryGUIDParameterName, Date effectiveTime, @@ -452,8 +510,8 @@ public void removeGlossaryCategory(String userId, PropertyServerException { this.deleteBeanInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryCategoryGUID, glossaryCategoryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_CATEGORY_TYPE_GUID, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryHandler.java index 4e82e8eb140..5e98d4187b4 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryHandler.java @@ -13,6 +13,7 @@ import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; @@ -75,6 +76,8 @@ public GlossaryHandler(OpenMetadataAPIGenericConverter converter, * Create the anchor object that all elements in a glossary (terms and categories) are linked to. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param qualifiedName unique name for the glossary - used in other configuration * @param displayName short display name for the glossary * @param description description of the governance glossary @@ -91,6 +94,8 @@ public GlossaryHandler(OpenMetadataAPIGenericConverter converter, * @throws UserNotAuthorizedException security access problem */ public String createGlossary(String userId, + String externalSourceGUID, + String externalSourceName, String qualifiedName, String displayName, String description, @@ -135,8 +140,8 @@ public String createGlossary(String userId, serverName); return this.createBeanInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, typeGUID, typeName, builder, @@ -153,6 +158,8 @@ public String createGlossary(String userId, * glossary is used as a template, any linked terms and categories are created as well. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param templateGUID unique identifier of the metadata element to copy * @param qualifiedName unique name for the new element - used in other configuration * @param displayName short display name for the new element @@ -166,6 +173,8 @@ public String createGlossary(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public String createGlossaryFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, String templateGUID, String qualifiedName, String displayName, @@ -189,8 +198,8 @@ public String createGlossaryFromTemplate(String userId, serverName); return this.createBeanFromTemplate(userId, - null, - null, + externalSourceGUID, + externalSourceName, templateGUID, templateGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_GUID, @@ -207,6 +216,8 @@ public String createGlossaryFromTemplate(String userId, * Update the anchor object that all elements in a glossary (terms and categories) are linked to. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the glossary to update * @param glossaryGUIDParameterName parameter passing the glossaryGUID * @param qualifiedName unique name for the glossary - used in other configuration @@ -218,6 +229,9 @@ public String createGlossaryFromTemplate(String userId, * @param suppliedTypeName type of glossary * @param extendedProperties properties for a governance glossary subtype * @param isMergeUpdate should the properties be merged with the existing properties or completely over-write them + * @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 * @param methodName calling method * * @throws InvalidParameterException qualifiedName or userId is null @@ -225,6 +239,8 @@ public String createGlossaryFromTemplate(String userId, * @throws UserNotAuthorizedException security access problem */ public void updateGlossary(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, String qualifiedName, @@ -236,6 +252,9 @@ public void updateGlossary(String userId, String suppliedTypeName, Map extendedProperties, boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -273,18 +292,18 @@ public void updateGlossary(String userId, serverName); this.updateBeanInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryGUID, glossaryGUIDParameterName, typeGUID, typeName, - false, - false, + forLineage, + forDuplicateProcessing, supportedZones, builder.getInstanceProperties(methodName), isMergeUpdate, - null, + effectiveTime, methodName); } @@ -293,9 +312,14 @@ public void updateGlossary(String userId, * Mark the glossary as a taxonomy. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param glossaryGUID unique identifier of asset * @param glossaryGUIDParameterName parameter name supplying glossaryGUID * @param organizingPrinciple how the category hierarchy is organized + * @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 * @param methodName calling method * * @throws InvalidParameterException entity not known, null userId or guid @@ -303,9 +327,14 @@ public void updateGlossary(String userId, * @throws UserNotAuthorizedException security access problem */ public void addTaxonomyClassificationToGlossary(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, String organizingPrinciple, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -316,8 +345,8 @@ public void addTaxonomyClassificationToGlossary(String userId, GlossaryBuilder builder = new GlossaryBuilder(repositoryHelper, serviceName, serverName); this.setClassificationInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryGUID, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, @@ -325,9 +354,9 @@ public void addTaxonomyClassificationToGlossary(String userId, OpenMetadataAPIMapper.TAXONOMY_CLASSIFICATION_TYPE_NAME, builder.getTaxonomyProperties(organizingPrinciple, methodName), false, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -336,16 +365,26 @@ public void addTaxonomyClassificationToGlossary(String userId, * Remove the taxonomy designation from a glossary. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param glossaryGUID unique identifier of asset * @param glossaryGUIDParameterName parameter name supplying glossaryGUID + * @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 * @param methodName calling method * @throws InvalidParameterException entity not known, null userId or guid * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ public void removeTaxonomyClassificationFromGlossary(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -354,16 +393,16 @@ public void removeTaxonomyClassificationFromGlossary(String userId, invalidParameterHandler.validateGUID(glossaryGUID, glossaryGUIDParameterName, methodName); this.removeClassificationFromRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryGUID, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, OpenMetadataAPIMapper.TAXONOMY_CLASSIFICATION_TYPE_GUID, OpenMetadataAPIMapper.TAXONOMY_CLASSIFICATION_TYPE_GUID, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -372,9 +411,14 @@ public void removeTaxonomyClassificationFromGlossary(String userId, * Mark the glossary as a canonical vocabulary. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param glossaryGUID unique identifier of asset * @param glossaryGUIDParameterName parameter name supplying glossaryGUID * @param scope how the category hierarchy is organized + * @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 * @param methodName calling method * * @throws InvalidParameterException entity not known, null userId or guid @@ -382,9 +426,14 @@ public void removeTaxonomyClassificationFromGlossary(String userId, * @throws UserNotAuthorizedException security access problem */ public void addCanonicalVocabClassificationToGlossary(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, String scope, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -395,8 +444,8 @@ public void addCanonicalVocabClassificationToGlossary(String userId, GlossaryBuilder builder = new GlossaryBuilder(repositoryHelper, serviceName, serverName); this.setClassificationInRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryGUID, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, @@ -404,9 +453,9 @@ public void addCanonicalVocabClassificationToGlossary(String userId, OpenMetadataAPIMapper.CANONICAL_VOCAB_CLASSIFICATION_TYPE_NAME, builder.getCanonicalVocabularyProperties(scope, methodName), false, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -415,31 +464,41 @@ public void addCanonicalVocabClassificationToGlossary(String userId, * Remove the taxonomy designation from a glossary. * * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller * @param glossaryGUID unique identifier of asset * @param glossaryGUIDParameterName parameter name supplying glossaryGUID + * @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 * @param methodName calling method * @throws InvalidParameterException entity not known, null userId or guid * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ public void removeCanonicalVocabClassificationFromGlossary(String userId, + String externalSourceGUID, + String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { this.removeClassificationFromRepository(userId, - null, - null, + externalSourceGUID, + externalSourceName, glossaryGUID, glossaryGUIDParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, OpenMetadataAPIMapper.CANONICAL_VOCAB_CLASSIFICATION_TYPE_GUID, OpenMetadataAPIMapper.CANONICAL_VOCAB_CLASSIFICATION_TYPE_NAME, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -454,6 +513,9 @@ public void removeCanonicalVocabClassificationFromGlossary(String userId, * @param externalSourceName unique name of software capability representing the caller * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryGUIDParameterName parameter supplying the glossaryGUID + * @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 * @param methodName calling method * * @throws InvalidParameterException one of the parameters is invalid @@ -465,6 +527,9 @@ public void removeGlossary(String userId, String externalSourceName, String glossaryGUID, String glossaryGUIDParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -478,9 +543,9 @@ public void removeGlossary(String userId, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, null, null, - false, - false, - null, + forLineage, + forDuplicateProcessing, + effectiveTime, methodName); } @@ -494,6 +559,9 @@ public void removeGlossary(String userId, * @param searchStringParameterName name of parameter supplying the search string * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @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 * @param methodName calling method * * @return list of matching metadata elements @@ -502,27 +570,30 @@ public void removeGlossary(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) */ - public List findGlossaries(String userId, - String searchString, - String searchStringParameterName, - int startFrom, - int pageSize, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List findGlossaries(String userId, + String searchString, + String searchStringParameterName, + int startFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { return this.findBeans(userId, searchString, searchStringParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_GUID, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, - false, - false, + forLineage, + forDuplicateProcessing, supportedZones, null, startFrom, pageSize, - null, + effectiveTime, methodName); } @@ -536,6 +607,9 @@ public List findGlossaries(String userId, * @param nameParameterName parameter supplying name * @param startFrom paging start point * @param pageSize maximum results that can be returned + * @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 * @param methodName calling method * * @return list of matching metadata elements @@ -549,6 +623,9 @@ public List getGlossariesByName(String userId, String nameParameterName, int startFrom, int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -566,13 +643,13 @@ public List getGlossariesByName(String userId, true, null, null, - false, - false, + forLineage, + forDuplicateProcessing, supportedZones, null, startFrom, pageSize, - null, + effectiveTime, methodName); } @@ -583,6 +660,9 @@ public List getGlossariesByName(String userId, * @param userId calling user * @param guid unique identifier of the requested metadata element * @param guidParameterName parameter name of guid + * @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 * @param methodName calling method * * @return matching metadata element @@ -594,6 +674,9 @@ public List getGlossariesByName(String userId, public B getGlossaryByGUID(String userId, String guid, String guidParameterName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -602,10 +685,10 @@ public B getGlossaryByGUID(String userId, guid, guidParameterName, OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, - false, - false, + forLineage, + forDuplicateProcessing, supportedZones, - null, + effectiveTime, methodName); } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryTermHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryTermHandler.java index 75a57f226e4..4e17811dbcc 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryTermHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/GlossaryTermHandler.java @@ -215,6 +215,8 @@ public String createGlossaryTerm(String userId, * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller + * @param glossaryGUID unique identifier of the owning glossary + * @param glossaryGUIDParameterName parameter supplying glossaryGUID * @param templateGUID unique identifier of the metadata element to copy * @param qualifiedName unique name for the term - used in other configuration * @param displayName short display name for the term @@ -230,6 +232,8 @@ public String createGlossaryTerm(String userId, public String createGlossaryTermFromTemplate(String userId, String externalSourceGUID, String externalSourceName, + String glossaryGUID, + String glossaryGUIDParameterName, String templateGUID, String qualifiedName, String displayName, @@ -252,18 +256,48 @@ public String createGlossaryTermFromTemplate(String userId, serviceName, serverName); - return this.createBeanFromTemplate(userId, - externalSourceGUID, - externalSourceName, - templateGUID, - templateGUIDParameterName, - OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_GUID, - OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, - qualifiedName, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - builder, - supportedZones, - methodName); + builder.setAnchors(userId, glossaryGUID, methodName); + + String glossaryTermGUID = this.createBeanFromTemplate(userId, + externalSourceGUID, + externalSourceName, + templateGUID, + templateGUIDParameterName, + OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_GUID, + OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, + qualifiedName, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + builder, + supportedZones, + methodName); + + if (glossaryTermGUID != null) + { + /* + * Link the term to its glossary. This relationship is always effective. + */ + final String glossaryTermGUIDParameterName = "glossaryTermGUID"; + + this.uncheckedLinkElementToElement(userId, + externalSourceGUID, + externalSourceName, + glossaryGUID, + glossaryGUIDParameterName, + OpenMetadataAPIMapper.GLOSSARY_TYPE_NAME, + glossaryTermGUID, + glossaryTermGUIDParameterName, + OpenMetadataAPIMapper.GLOSSARY_TERM_TYPE_NAME, + false, + false, + supportedZones, + OpenMetadataAPIMapper.TERM_ANCHOR_TYPE_GUID, + OpenMetadataAPIMapper.TERM_ANCHOR_TYPE_NAME, + null, + null, + methodName); + } + + return glossaryTermGUID; } 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 6f2cbbfa6a3..3b2249ed921 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 @@ -1012,6 +1012,266 @@ public void removeSecurityTags(String userId, } + /** + * Add or replace the governance action classification on a referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param beanGUID unique identifier of bean + * @param beanGUIDParameterName name of parameter supplying the beanGUID + * @param beanGUIDTypeName type of bean + * @param classificationTypeName type GUID of governance action classification + * @param classificationTypeName type name of governance action classification + * @param statusIdentifier identifier for the status of the classification + * @param confidence how confident? is this classification right? 0=unknown; 0-100% confident + * @param steward who is responsible for this classification + * @param stewardTypeName what type of element is used to identify the steward + * @param stewardPropertyName what property name is used to identify the steward? guid, qualifiedName etc + * @param source what is the source of the classification + * @param notes any notes from the steward + * @param levelIdentifier what level should the classification be set up as? + * @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 effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName calling method + * + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void addGovernanceActionClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String beanGUID, + String beanGUIDParameterName, + String beanGUIDTypeName, + String classificationTypeGUID, + String classificationTypeName, + int statusIdentifier, + int confidence, + String steward, + String stewardTypeName, + String stewardPropertyName, + String source, + String notes, + int levelIdentifier, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addIntPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.STATUS_IDENTIFIER_PROPERTY_NAME, statusIdentifier, methodName); + properties = repositoryHelper.addIntPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, confidence, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, steward, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, stewardTypeName, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, stewardPropertyName, methodName); + 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.LEVEL_IDENTIFIER_PROPERTY_NAME, levelIdentifier, methodName); + + this.setClassificationInRepository(userId, + externalSourceGUID, + externalSourceName, + beanGUID, + beanGUIDParameterName, + beanGUIDTypeName, + classificationTypeGUID, + classificationTypeName, + this.setUpEffectiveDates(properties, effectiveFrom, effectiveTo), + true, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Remove the governance expectations classification from a referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param beanGUID unique identifier of entity to update + * @param beanGUIDParameterName name of parameter providing beanGUID + * @param beanGUIDTypeName type of bean + * @param classificationTypeName type GUID of governance action classification + * @param classificationTypeName type name of governance action classification + * @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 calling method + * + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void removeGovernanceActionClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String beanGUID, + String beanGUIDParameterName, + String beanGUIDTypeName, + String classificationTypeGUID, + String classificationTypeName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.removeClassificationFromRepository(userId, + externalSourceGUID, + externalSourceName, + beanGUID, + beanGUIDParameterName, + beanGUIDTypeName, + classificationTypeGUID, + classificationTypeName, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Add or replace the governance action classification on a referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param beanGUID unique identifier of bean + * @param beanGUIDParameterName name of parameter supplying the beanGUID + * @param beanGUIDTypeName type of bean + * @param statusIdentifier identifier for the status of the classification + * @param confidence how confident? is this classification right? 0=unknown; 0-100% confident + * @param steward who is responsible for this classification + * @param stewardTypeName what type of element is used to identify the steward + * @param stewardPropertyName what property name is used to identify the steward? guid, qualifiedName etc + * @param source what is the source of the classification + * @param notes any notes from the steward + * @param basisIdentifier what level should the classification be set up as? + * @param associatedGUID unique identifier of policy/rule controlling this retention decision + * @param archiveAfter when should the element be archived? + * @param deleteAfter when should the element be deleted? + * @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 effectiveFrom the time that the relationship element must be effective from (null for any time, new Date() for now) + * @param effectiveTo the time that the relationship must be effective to (null for any time, new Date() for now) + * @param effectiveTime the time that the retrieved elements must be effective for + * @param methodName calling method + * + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void addRetentionClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String beanGUID, + String beanGUIDParameterName, + String beanGUIDTypeName, + int statusIdentifier, + int confidence, + String steward, + String stewardTypeName, + String stewardPropertyName, + String source, + String notes, + int basisIdentifier, + String associatedGUID, + Date archiveAfter, + Date deleteAfter, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveFrom, + Date effectiveTo, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addIntPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.STATUS_IDENTIFIER_PROPERTY_NAME, statusIdentifier, methodName); + properties = repositoryHelper.addIntPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.CONFIDENCE_PROPERTY_NAME, confidence, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, steward, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.STEWARD_TYPE_NAME_PROPERTY_NAME, stewardTypeName, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME_PROPERTY_NAME, stewardPropertyName, methodName); + 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); + + this.setClassificationInRepository(userId, + externalSourceGUID, + externalSourceName, + beanGUID, + beanGUIDParameterName, + beanGUIDTypeName, + OpenMetadataAPIMapper.RETENTION_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.RETENTION_CLASSIFICATION_TYPE_NAME, + this.setUpEffectiveDates(properties, effectiveFrom, effectiveTo), + true, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + + /** + * Remove the governance expectations classification from a referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of the software capability that owns this project + * @param externalSourceName unique name of the software capability that owns this project + * @param beanGUID unique identifier of entity to update + * @param beanGUIDParameterName name of parameter providing beanGUID + * @param beanGUIDTypeName type of bean + * @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 calling method + * + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void removeRetentionClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String beanGUID, + String beanGUIDParameterName, + String beanGUIDTypeName, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + this.removeClassificationFromRepository(userId, + externalSourceGUID, + externalSourceName, + beanGUID, + beanGUIDParameterName, + beanGUIDTypeName, + OpenMetadataAPIMapper.RETENTION_CLASSIFICATION_TYPE_GUID, + OpenMetadataAPIMapper.RETENTION_CLASSIFICATION_TYPE_NAME, + forLineage, + forDuplicateProcessing, + effectiveTime, + methodName); + } + + /** * Add or replace the governance expectations classification to a referenceable. * diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Asset.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Asset.java index ebf287907cd..1553a4f8024 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Asset.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Asset.java @@ -182,6 +182,8 @@ public String toString() ", additionalProperties=" + getAdditionalProperties() + ", owner='" + getOwner() + '\'' + ", ownerType=" + getOwnerType() + + ", ownerTypeName='" + getOwnerTypeName() + '\'' + + ", ownerPropertyName='" + getOwnerPropertyName() + '\'' + ", extendedProperties=" + getExtendedProperties() + ", securityLabels=" + getSecurityLabels() + ", securityProperties=" + getSecurityProperties() + diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Glossary.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Glossary.java index d249404503e..d6bcb88eaee 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Glossary.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Glossary.java @@ -166,6 +166,8 @@ public String toString() ", additionalProperties=" + getAdditionalProperties() + ", owner='" + getOwner() + '\'' + ", ownerType=" + getOwnerType() + + ", ownerTypeName='" + getOwnerTypeName() + '\'' + + ", ownerPropertyName='" + getOwnerPropertyName() + '\'' + ", extendedProperties=" + getExtendedProperties() + ", securityLabels=" + getSecurityLabels() + ", securityProperties=" + getSecurityProperties() + diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationBase.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationBase.java index 013ef785582..961953a883b 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationBase.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationBase.java @@ -15,7 +15,7 @@ /** - * GovernanceClassificationBase defines the common properties for the governance action classifications + * GovernanceClassificationBase defines the common properties for the governance action classifications. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @@ -25,11 +25,13 @@ public class GovernanceClassificationBase implements Serializable @Serial private static final long serialVersionUID = 1L; - private int status = 0; - private int confidence = 0; - private String steward = null; - private String source = null; - private String notes = null; + private int status = 0; + private int confidence = 0; + private String steward = null; + private String stewardTypeName = null; + private String stewardPropertyName = null; + private String source = null; + private String notes = null; /** @@ -50,11 +52,13 @@ public GovernanceClassificationBase(GovernanceClassificationBase template) { if (template != null) { - status = template.getStatus(); + status = template.getStatus(); confidence = template.getConfidence(); - steward = template.getSteward(); - source = template.getSource(); - notes = template.getNotes(); + steward = template.getSteward(); + stewardTypeName = template.getStewardTypeName(); + stewardPropertyName = template.getStewardPropertyName(); + source = template.getSource(); + notes = template.getNotes(); } } @@ -125,6 +129,50 @@ public void setSteward(String steward) } + /** + * Return the type name of the element used to describe the steward. + * + * @return name + */ + public String getStewardTypeName() + { + return stewardTypeName; + } + + + /** + * Set up the type name of the element used to describe the steward. + * + * @param stewardTypeName name + */ + public void setStewardTypeName(String stewardTypeName) + { + this.stewardTypeName = stewardTypeName; + } + + + /** + * Return the name of the property used to identify the steward. + * + * @return name + */ + public String getStewardPropertyName() + { + return stewardPropertyName; + } + + + /** + * Set up the name of the property used to identify the steward. + * + * @param stewardPropertyName name + */ + public void setStewardPropertyName(String stewardPropertyName) + { + this.stewardPropertyName = stewardPropertyName; + } + + /** * Return the source of this classification. * @@ -178,12 +226,14 @@ public void setNotes(String notes) public String toString() { return "GovernanceClassificationBase{" + - "status=" + status + - ", confidence=" + confidence + - ", steward='" + steward + '\'' + - ", source='" + source + '\'' + - ", notes='" + notes + - '}'; + "status=" + status + + ", confidence=" + confidence + + ", steward='" + steward + '\'' + + ", stewardTypeName='" + stewardTypeName + '\'' + + ", stewardPropertyName='" + stewardPropertyName + '\'' + + ", source='" + source + '\'' + + ", notes='" + notes + '\'' + + '}'; } @@ -210,10 +260,12 @@ public boolean equals(Object objectToCompare) } GovernanceClassificationBase that = (GovernanceClassificationBase) objectToCompare; return confidence == that.confidence && - status == that.status && - Objects.equals(steward, that.steward) && - Objects.equals(source, that.source) && - Objects.equals(notes, that.notes); + status == that.status && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(stewardPropertyName, that.stewardPropertyName) && + Objects.equals(source, that.source) && + Objects.equals(notes, that.notes); } @@ -225,6 +277,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), status, confidence, steward, source, notes); + return Objects.hash(super.hashCode(), status, confidence, steward, stewardTypeName, stewardPropertyName, source, notes); } } \ No newline at end of file diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationStatus.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationStatus.java index 86aea3220f2..c752be29bee 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationStatus.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/GovernanceClassificationStatus.java @@ -20,18 +20,45 @@ @JsonIgnoreProperties(ignoreUnknown=true) public enum GovernanceClassificationStatus implements Serializable { + /** + * Discovered - The classification assignment was discovered by an automated process. + */ DISCOVERED (0, 0,"Discovered", "The classification assignment was discovered by an automated process."), + + /** + * Proposed - The classification assignment was proposed by a subject matter expert. + */ PROPOSED (1, 1,"Proposed", "The classification assignment was proposed by a subject matter expert."), + + /** + * Imported - The classification assignment was imported from another metadata system. + */ IMPORTED (2, 2,"Imported", "The classification assignment was imported from another metadata system."), + + /** + * Validated - The classification assignment has been validated and approved by a subject matter expert. + */ VALIDATED (3, 3,"Validated", "The classification assignment has been validated and approved by a subject matter expert."), + + /** + * Deprecated - The classification assignment should no longer be used. + */ DEPRECATED (4, 4,"Deprecated", "The classification assignment should no longer be used."), + + /** + * Obsolete - The classification assignment must no longer be used. + */ OBSOLETE (5, 5,"Obsolete", "The classification assignment must no longer be used."), + + /** + * Other - Another classification assignment status. + */ OTHER (99, 99, "Other", "Another classification assignment status."); diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Referenceable.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Referenceable.java index 544d15dfa61..064ce689a34 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Referenceable.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Referenceable.java @@ -17,24 +17,25 @@ public class Referenceable implements Serializable @Serial private static final long serialVersionUID = 1L; - private String typeGUID = null; - private String typeName = null; - private ReferenceableStatus status = null; + private String typeGUID = null; + private String typeName = null; + private ReferenceableStatus status = null; private String guid = null; private String qualifiedName = null; private Map additionalProperties = null; private Map extendedProperties = null; private String owner = null; private int ownerType = 0; - - private List securityLabels = null; - private Map securityProperties = null; - private Map> accessGroups = null; - private ConfidentialityGovernanceClassification confidentiality = null; - private ConfidenceGovernanceClassification confidence = null; - private CriticalityGovernanceClassification criticality = null; - private ImpactGovernanceClassification impact = null; - private RetentionGovernanceClassification retention = null; + private String ownerTypeName = null; + private String ownerPropertyName = null; + private List securityLabels = null; + private Map securityProperties = null; + private Map> accessGroups = null; + private ConfidentialityGovernanceClassification confidentiality = null; + private ConfidenceGovernanceClassification confidence = null; + private CriticalityGovernanceClassification criticality = null; + private ImpactGovernanceClassification impact = null; + private RetentionGovernanceClassification retention = null; @@ -64,6 +65,8 @@ public Referenceable(Referenceable template) additionalProperties = template.getAdditionalProperties(); owner = template.getOwner(); ownerType = template.getOwnerType(); + ownerTypeName = template.getOwnerTypeName(); + ownerPropertyName = template.getOwnerPropertyName(); securityLabels = template.getSecurityLabels(); securityProperties = template.getSecurityProperties(); accessGroups = template.getAccessGroups(); @@ -264,6 +267,50 @@ public void setOwnerType(int ownerType) } + /** + * Return the type name of the element representing the owner. + * + * @return name + */ + public String getOwnerTypeName() + { + return ownerTypeName; + } + + + /** + * Set up the type name of the element representing the owner. + * + * @param ownerTypeName name + */ + public void setOwnerTypeName(String ownerTypeName) + { + this.ownerTypeName = ownerTypeName; + } + + + /** + * Return the property name of the identifier that is representing the owner. + * + * @return name + */ + public String getOwnerPropertyName() + { + return ownerPropertyName; + } + + + /** + * Set up the property name of the identifier that is representing the owner. + * + * @param ownerPropertyName name + */ + public void setOwnerPropertyName(String ownerPropertyName) + { + this.ownerPropertyName = ownerPropertyName; + } + + /** * Return the properties that have been defined for a subtype of this object that are not supported explicitly * by this bean. @@ -512,6 +559,8 @@ public String toString() ", qualifiedName='" + qualifiedName + '\'' + ", additionalProperties=" + additionalProperties + ", owner='" + owner + '\'' + + ", ownerTypeName='" + ownerTypeName + '\'' + + ", ownerPropertyName='" + ownerPropertyName + '\'' + ", ownerType=" + ownerType + ", extendedProperties=" + extendedProperties + ", securityLabels=" + securityLabels + @@ -549,6 +598,8 @@ public boolean equals(Object objectToCompare) Objects.equals(qualifiedName, that.qualifiedName) && Objects.equals(additionalProperties, that.additionalProperties) && Objects.equals(owner, that.owner) && + Objects.equals(ownerTypeName, that.ownerTypeName) && + Objects.equals(ownerPropertyName, that.ownerPropertyName) && getOwnerType() == that.ownerType && Objects.equals(extendedProperties, that.extendedProperties) && Objects.equals(securityLabels, that.securityLabels) && @@ -569,6 +620,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(typeGUID, typeName, guid, qualifiedName, additionalProperties, owner, ownerType, extendedProperties, securityLabels, securityProperties, confidentiality, confidence, criticality, retention); + return Objects.hash(typeGUID, typeName, guid, qualifiedName, additionalProperties, owner, ownerType, ownerTypeName, ownerPropertyName, extendedProperties, securityLabels, securityProperties, confidentiality, confidence, criticality, retention); } } diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java index cf48bdde02c..85b8c45e30f 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java @@ -81,15 +81,17 @@ public class OpenMetadataServerSecurityVerifier implements OpenMetadataRepositor private static final String RETENTION_CLASSIFICATION_TYPE_NAME = "Retention"; - private static final String GOVERNANCE_CLASSIFICATION_STATUS_PROPERTY_NAME = "status"; - private static final String GOVERNANCE_CLASSIFICATION_CONFIDENCE_PROPERTY_NAME = "confidence"; - private static final String GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME = "steward"; - private static final String GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME = "source"; - private static final String GOVERNANCE_CLASSIFICATION_NOTES_PROPERTY_NAME = "notes"; - - private static final String RETENTION_ASSOCIATED_GUID_PROPERTY_NAME = "associatedGUID"; - private static final String RETENTION_ARCHIVE_AFTER_PROPERTY_NAME = "archiveAfter"; - private static final String RETENTION_DELETE_AFTER_PROPERTY_NAME = "deleteAfter"; + private static final String GOVERNANCE_CLASSIFICATION_STATUS_PROPERTY_NAME = "status"; + private static final String GOVERNANCE_CLASSIFICATION_CONFIDENCE_PROPERTY_NAME = "confidence"; + private static final String GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME = "steward"; + private static final String GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME = "stewardTypeName"; + private static final String GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME = "stewardPropertyName"; + private static final String GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME = "source"; + private static final String GOVERNANCE_CLASSIFICATION_NOTES_PROPERTY_NAME = "notes"; + + private static final String RETENTION_ASSOCIATED_GUID_PROPERTY_NAME = "associatedGUID"; + private static final String RETENTION_ARCHIVE_AFTER_PROPERTY_NAME = "archiveAfter"; + private static final String RETENTION_DELETE_AFTER_PROPERTY_NAME = "deleteAfter"; private static final String SECURITY_TAG_CLASSIFICATION_TYPE_NAME = "SecurityTags"; private static final String SECURITY_LABELS_PROPERTY_NAME = "securityLabels"; @@ -112,6 +114,8 @@ public class OpenMetadataServerSecurityVerifier implements OpenMetadataRepositor private static final String OWNERSHIP_CLASSIFICATION_TYPE_NAME = "Ownership"; private static final String OWNER_PROPERTY_NAME = "owner"; /* from Area 4 */ + private static final String OWNER_TYPE_NAME_PROPERTY_NAME = "ownerTypeName"; /* from Area 4 */ + private static final String OWNER_PROPERTY_NAME_PROPERTY_NAME = "ownerPropertyName"; /* from Area 4 */ private static final String OWNER_TYPE_PROPERTY_NAME = "ownerType"; /* deprecated */ @@ -594,6 +598,14 @@ private void setupAssetBeanWithEntityProperties(Asset assetBean, GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, confidentialityProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + confidentialityProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + confidentialityProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, confidentialityProperties, @@ -624,6 +636,14 @@ private void setupAssetBeanWithEntityProperties(Asset assetBean, GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, confidenceProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + confidenceProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + confidenceProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, confidenceProperties, @@ -654,6 +674,14 @@ private void setupAssetBeanWithEntityProperties(Asset assetBean, GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, criticalityProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + criticalityProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + criticalityProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, criticalityProperties, @@ -684,6 +712,14 @@ private void setupAssetBeanWithEntityProperties(Asset assetBean, GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, impactProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + impactProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + impactProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, impactProperties, @@ -714,6 +750,14 @@ private void setupAssetBeanWithEntityProperties(Asset assetBean, GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, retentionProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + retentionProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + retentionProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, retentionProperties, @@ -746,10 +790,14 @@ private void setupAssetBeanWithEntityProperties(Asset assetBean, OWNER_PROPERTY_NAME, ownershipProperties, methodName)); - assetBean.setOwnerType(repositoryHelper.getEnumPropertyOrdinal(serviceName, - OWNER_TYPE_PROPERTY_NAME, - ownershipProperties, - methodName)); + assetBean.setOwnerTypeName(repositoryHelper.removeStringProperty(serviceName, + OWNER_TYPE_NAME_PROPERTY_NAME, + properties, + methodName)); + assetBean.setOwnerPropertyName(repositoryHelper.removeStringProperty(serviceName, + OWNER_PROPERTY_NAME_PROPERTY_NAME, + properties, + methodName)); } if (zoneProperties != null) @@ -1619,6 +1667,14 @@ private void setupGlossaryBeanWithEntityProperties(Glossary glossary GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, confidentialityProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + confidentialityProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + confidentialityProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, confidentialityProperties, @@ -1649,6 +1705,14 @@ private void setupGlossaryBeanWithEntityProperties(Glossary glossary GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, confidenceProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + confidenceProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + confidenceProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, confidenceProperties, @@ -1679,6 +1743,14 @@ private void setupGlossaryBeanWithEntityProperties(Glossary glossary GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, criticalityProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + criticalityProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + criticalityProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, criticalityProperties, @@ -1709,6 +1781,14 @@ private void setupGlossaryBeanWithEntityProperties(Glossary glossary GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, impactProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + impactProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + impactProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, impactProperties, @@ -1739,6 +1819,14 @@ private void setupGlossaryBeanWithEntityProperties(Glossary glossary GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME, retentionProperties, methodName)); + classification.setStewardTypeName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_TYPE_NAME_PROPERTY_NAME, + retentionProperties, + methodName)); + classification.setStewardPropertyName(repositoryHelper.getStringProperty(serviceName, + GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME_PROPERTY_NAME, + retentionProperties, + methodName)); classification.setSource(repositoryHelper.getStringProperty(serviceName, GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME, retentionProperties, @@ -1771,10 +1859,14 @@ private void setupGlossaryBeanWithEntityProperties(Glossary glossary OWNER_PROPERTY_NAME, ownershipProperties, methodName)); - glossary.setOwnerType(repositoryHelper.getEnumPropertyOrdinal(serviceName, - OWNER_TYPE_PROPERTY_NAME, - ownershipProperties, - methodName)); + glossary.setOwnerTypeName(repositoryHelper.removeStringProperty(serviceName, + OWNER_TYPE_NAME_PROPERTY_NAME, + properties, + methodName)); + glossary.setOwnerPropertyName(repositoryHelper.removeStringProperty(serviceName, + OWNER_PROPERTY_NAME_PROPERTY_NAME, + properties, + methodName)); } } diff --git a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/converters/AssetConverter.java b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/converters/AssetConverter.java index fcbb706fb80..6cfd00aa17f 100644 --- a/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/converters/AssetConverter.java +++ b/open-metadata-implementation/framework-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/frameworkservices/ocf/metadatamanagement/converters/AssetConverter.java @@ -45,6 +45,7 @@ public AssetConverter(OMRSRepositoryHelper repositoryHelper, * @throws PropertyServerException there is a problem instantiating the bean */ @Override + @SuppressWarnings(value="deprecation") public B getNewBean(Class beanClass, EntityDetail entity, String methodName) throws PropertyServerException diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java index 5dd2d81a651..67b991419b2 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CatalogIntegratorContext.java @@ -5,6 +5,17 @@ import org.odpi.openmetadata.accessservices.assetmanager.api.AssetManagerEventListener; import org.odpi.openmetadata.accessservices.assetmanager.client.*; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.CollaborationExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ConnectionExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.DataAssetExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalReferenceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GovernanceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.InfrastructureExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.LineageExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.StewardshipExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ValidValuesExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -38,8 +49,8 @@ public class CatalogIntegratorContext extends IntegrationContext public final static String validValuesExchangeServiceName = "ValidValuesExchangeService"; - private final ExternalAssetManagerClient assetManagerClient; - private final AssetManagerEventClient eventClient; + private final ExternalAssetManagerClient assetManagerClient; + private final AssetManagerEventClient eventClient; private final ConnectorFactoryService connectorFactoryService; private final CollaborationExchangeService collaborationExchangeService; private final ConnectionExchangeService connectionExchangeService; @@ -106,19 +117,19 @@ public CatalogIntegratorContext(String connectorId, String serverName, OpenIntegrationClient openIntegrationClient, OpenMetadataClient openMetadataStoreClient, - ExternalAssetManagerClient assetManagerClient, + ExternalAssetManagerClient assetManagerClient, AssetManagerEventClient eventClient, ConnectedAssetClient connectedAssetClient, - CollaborationExchangeClient collaborationExchangeClient, - ConnectionExchangeClient connectionExchangeClient, - DataAssetExchangeClient dataAssetExchangeClient, + CollaborationExchangeClient collaborationExchangeClient, + ConnectionExchangeClient connectionExchangeClient, + DataAssetExchangeClient dataAssetExchangeClient, ExternalReferenceExchangeClient externalReferenceExchangeClient, - GlossaryExchangeClient glossaryExchangeClient, - GovernanceExchangeClient governanceExchangeClient, - InfrastructureExchangeClient infrastructureExchangeClient, - LineageExchangeClient lineageExchangeClient, - StewardshipExchangeClient stewardshipExchangeClient, - ValidValuesExchangeClient validValuesExchangeClient, + GlossaryExchangeClient glossaryExchangeClient, + GovernanceExchangeClient governanceExchangeClient, + InfrastructureExchangeClient infrastructureExchangeClient, + LineageExchangeClient lineageExchangeClient, + StewardshipExchangeClient stewardshipExchangeClient, + ValidValuesExchangeClient validValuesExchangeClient, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, String integrationConnectorGUID, diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java index 07d1b1cc41d..adcec33ab01 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/CollaborationExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.CollaborationExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.CollaborationExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ConnectionExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ConnectionExchangeService.java index 744c4504960..f14a71cbd76 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ConnectionExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ConnectionExchangeService.java @@ -4,7 +4,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.ConnectionExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ConnectionExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectionElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectorTypeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.EndpointElement; @@ -17,7 +17,6 @@ import java.util.Date; import java.util.List; -import java.util.Map; /** diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/DataAssetExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/DataAssetExchangeService.java index 682f079ef63..80090dade1a 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/DataAssetExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/DataAssetExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.DataAssetExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.DataAssetExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataAssetElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.RelationshipElement; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ExternalReferenceExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ExternalReferenceExchangeService.java index ff540d6c16f..486c656f1fd 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ExternalReferenceExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ExternalReferenceExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalReferenceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalReferenceExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalReferenceLinkElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java index 23ffd5aaafc..d5920ea1a57 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GlossaryExchangeService.java @@ -3,12 +3,13 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ExternalGlossaryLinkElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; +import org.odpi.openmetadata.accessservices.assetmanager.rest.ActivityDescriptionProperties; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -127,6 +128,7 @@ public void setForDuplicateProcessing(boolean forDuplicateProcessing) * to a single glossary. They are owned by this glossary and if the glossary is deleted, any linked terms and * categories are deleted as well. * + * @param assetManagerIsHome ensure that only the asset manager can update this asset * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryProperties properties to store * @@ -136,7 +138,8 @@ public void setForDuplicateProcessing(boolean forDuplicateProcessing) * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public String createGlossary(ExternalIdentifierProperties externalIdentifierProperties, + public String createGlossary(boolean assetManagerIsHome, + ExternalIdentifierProperties externalIdentifierProperties, GlossaryProperties glossaryProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -148,6 +151,7 @@ public String createGlossary(ExternalIdentifierProperties externalIdentifierProp return glossaryManagerClient.createGlossary(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, externalIdentifierProperties, glossaryProperties); } @@ -171,6 +175,7 @@ public String createGlossary(ExternalIdentifierProperties externalIdentifierProp * All categories and terms are linked to a single glossary. They are owned by this glossary and if the * glossary is deleted, any linked terms and categories are deleted as well. * + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -181,7 +186,8 @@ public String createGlossary(ExternalIdentifierProperties externalIdentifierProp * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public String createGlossaryFromTemplate(String templateGUID, + public String createGlossaryFromTemplate(boolean assetManagerIsHome, + String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -194,6 +200,7 @@ public String createGlossaryFromTemplate(String templateGU return glossaryManagerClient.createGlossaryFromTemplate(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, templateGUID, externalIdentifierProperties, templateProperties); @@ -216,7 +223,9 @@ public String createGlossaryFromTemplate(String templateGU * * @param glossaryGUID unique identifier of the metadata element to update * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param glossaryProperties new properties for this element + * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request @@ -224,15 +233,25 @@ public String createGlossaryFromTemplate(String templateGU */ public void updateGlossary(String glossaryGUID, String glossaryExternalIdentifier, - GlossaryProperties glossaryProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + boolean isMergeUpdate, + GlossaryProperties glossaryProperties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "updateGlossary"; if (synchronizationDirection != SynchronizationDirection.TO_THIRD_PARTY) { - glossaryManagerClient.updateGlossary(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, glossaryProperties); + glossaryManagerClient.updateGlossary(userId, + assetManagerGUID, + assetManagerName, + glossaryGUID, + glossaryExternalIdentifier, + isMergeUpdate, glossaryProperties, + effectiveTime, + forLineage, + forDuplicateProcessing); } else { @@ -253,21 +272,23 @@ public void updateGlossary(String glossaryGUID, * * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void removeGlossary(String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + String glossaryExternalIdentifier, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "removeGlossary"; if (synchronizationDirection != SynchronizationDirection.TO_THIRD_PARTY) { - glossaryManagerClient.removeGlossary(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier); + glossaryManagerClient.removeGlossary(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, effectiveTime, forLineage, forDuplicateProcessing); } else { @@ -292,23 +313,25 @@ public void removeGlossary(String glossaryGUID, * * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager - * @param organizingPrinciple description of how the glossary is organized + * @param properties description of how the glossary is organized + * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public void setGlossaryAsTaxonomy(String glossaryGUID, - String glossaryExternalIdentifier, - String organizingPrinciple) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setGlossaryAsTaxonomy(String glossaryGUID, + String glossaryExternalIdentifier, + TaxonomyProperties properties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setGlossaryAsTaxonomy"; if (synchronizationDirection != SynchronizationDirection.TO_THIRD_PARTY) { - glossaryManagerClient.setGlossaryAsTaxonomy(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, organizingPrinciple); + glossaryManagerClient.setGlossaryAsTaxonomy(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, properties, effectiveTime, forLineage, forDuplicateProcessing); } else { @@ -328,21 +351,23 @@ public void setGlossaryAsTaxonomy(String glossaryGUID, * * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void clearGlossaryAsTaxonomy(String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + String glossaryExternalIdentifier, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "clearGlossaryAsTaxonomy"; if (synchronizationDirection != SynchronizationDirection.TO_THIRD_PARTY) { - glossaryManagerClient.clearGlossaryAsTaxonomy(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier); + glossaryManagerClient.clearGlossaryAsTaxonomy(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, effectiveTime, forLineage, forDuplicateProcessing); } else { @@ -366,23 +391,25 @@ public void clearGlossaryAsTaxonomy(String glossaryGUID, * * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager - * @param scope description of the situations where this glossary is relevant. + * @param properties description of the situations where this glossary is relevant. + * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public void setGlossaryAsCanonical(String glossaryGUID, - String glossaryExternalIdentifier, - String scope) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setGlossaryAsCanonical(String glossaryGUID, + String glossaryExternalIdentifier, + CanonicalVocabularyProperties properties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setGlossaryAsCanonical"; if (synchronizationDirection != SynchronizationDirection.TO_THIRD_PARTY) { - glossaryManagerClient.setGlossaryAsCanonical(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, scope); + glossaryManagerClient.setGlossaryAsCanonical(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, properties, effectiveTime, forLineage, forDuplicateProcessing); } else { @@ -402,21 +429,23 @@ public void setGlossaryAsCanonical(String glossaryGUID, * * @param glossaryGUID unique identifier of the metadata element to remove * @param glossaryExternalIdentifier unique identifier of the glossary in the external asset manager + * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public void clearGlossaryAsCanonical(String glossaryGUID, - String glossaryExternalIdentifier) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + String glossaryExternalIdentifier, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "clearGlossaryAsCanonical"; if (synchronizationDirection != SynchronizationDirection.TO_THIRD_PARTY) { - glossaryManagerClient.clearGlossaryAsCanonical(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier); + glossaryManagerClient.clearGlossaryAsCanonical(userId, assetManagerGUID, assetManagerName, glossaryGUID, glossaryExternalIdentifier, effectiveTime, forLineage, forDuplicateProcessing); } else { @@ -438,6 +467,7 @@ public void clearGlossaryAsCanonical(String glossaryGUID, * @param searchString string to find in the properties * @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 * * @return list of matching metadata elements * @@ -447,11 +477,12 @@ public void clearGlossaryAsCanonical(String glossaryGUID, */ public List findGlossaries(String searchString, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + int pageSize, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return glossaryManagerClient.findGlossaries(userId, assetManagerGUID, assetManagerName, searchString, startFrom, pageSize); + return glossaryManagerClient.findGlossaries(userId, assetManagerGUID, assetManagerName, searchString, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); } @@ -462,6 +493,7 @@ public List findGlossaries(String searchString, * @param name name to search for * @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 * * @return list of matching metadata elements * @@ -471,11 +503,12 @@ public List findGlossaries(String searchString, */ public List getGlossariesByName(String name, int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + int pageSize, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return glossaryManagerClient.getGlossariesByName(userId, assetManagerGUID, assetManagerName, name, startFrom, pageSize); + return glossaryManagerClient.getGlossariesByName(userId, assetManagerGUID, assetManagerName, name, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); } @@ -484,6 +517,7 @@ public List getGlossariesByName(String name, * * @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 * * @return list of matching metadata elements * @@ -492,18 +526,20 @@ public List getGlossariesByName(String name, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public List getGlossariesForAssetManager(int startFrom, - int pageSize) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + int pageSize, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return glossaryManagerClient.getGlossariesForAssetManager(userId, assetManagerGUID, assetManagerName, startFrom, pageSize); + return glossaryManagerClient.getGlossariesForAssetManager(userId, assetManagerGUID, assetManagerName, startFrom, pageSize, effectiveTime, forLineage, forDuplicateProcessing); } /** * Retrieve the glossary metadata element with the supplied unique identifier. * - * @param openMetadataGUID unique identifier of the requested metadata element + * @param glossaryGUID unique identifier of the requested metadata element + * @param effectiveTime the time that the retrieved elements must be effective for * * @return matching metadata element * @@ -511,11 +547,12 @@ public List getGlossariesForAssetManager(int startFrom, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public GlossaryElement getGlossaryByGUID(String openMetadataGUID) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public GlossaryElement getGlossaryByGUID(String glossaryGUID, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - return glossaryManagerClient.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, openMetadataGUID); + return glossaryManagerClient.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID, effectiveTime, forLineage, forDuplicateProcessing); } @@ -527,8 +564,10 @@ public GlossaryElement getGlossaryByGUID(String openMetadataGUID) throws Invalid * Create a new metadata element to represent a glossary category. * * @param glossaryGUID unique identifier of anchor glossary + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryCategoryProperties properties about the glossary category to store + * @param effectiveTime the time that the retrieved elements must be effective for * * @return unique identifier of the new glossary category * @@ -537,10 +576,12 @@ public GlossaryElement getGlossaryByGUID(String openMetadataGUID) throws Invalid * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public String createGlossaryCategory(String glossaryGUID, + boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, - GlossaryCategoryProperties glossaryCategoryProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + GlossaryCategoryProperties glossaryCategoryProperties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "createGlossaryCategory"; @@ -549,9 +590,13 @@ public String createGlossaryCategory(String glossaryGUID, return glossaryManagerClient.createGlossaryCategory(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, glossaryGUID, externalIdentifierProperties, - glossaryCategoryProperties); + glossaryCategoryProperties, + effectiveTime, + forLineage, + forDuplicateProcessing); } else { @@ -569,6 +614,8 @@ public String createGlossaryCategory(String glossaryGUID, /** * Create a new metadata element to represent a glossary category using an existing metadata element as a template. * + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -579,7 +626,9 @@ public String createGlossaryCategory(String glossaryGUID, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public String createGlossaryCategoryFromTemplate(String templateGUID, + public String createGlossaryCategoryFromTemplate(String glossaryGUID, + boolean assetManagerIsHome, + String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -592,6 +641,8 @@ public String createGlossaryCategoryFromTemplate(String te return glossaryManagerClient.createGlossaryCategoryFromTemplate(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, + glossaryGUID, templateGUID, externalIdentifierProperties, templateProperties); @@ -1044,9 +1095,11 @@ public List getGlossarySubCategories(String userId, /** * Create a new metadata element to represent a glossary term. * + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryTermProperties properties for the glossary term + * @param effectiveTime the time that the retrieved elements must be effective for * * @return unique identifier of the new metadata element for the glossary term * @@ -1055,10 +1108,12 @@ public List getGlossarySubCategories(String userId, * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ public String createGlossaryTerm(String glossaryGUID, + boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, - GlossaryTermProperties glossaryTermProperties) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + GlossaryTermProperties glossaryTermProperties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "createGlossaryTerm"; @@ -1067,9 +1122,13 @@ public String createGlossaryTerm(String glossaryGUID, return glossaryManagerClient.createGlossaryTerm(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, glossaryGUID, externalIdentifierProperties, - glossaryTermProperties); + glossaryTermProperties, + effectiveTime, + forLineage, + forDuplicateProcessing); } else { @@ -1090,10 +1149,12 @@ public String createGlossaryTerm(String glossaryGUID, * @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 assetManagerIsHome ensure that only the asset manager can update this element * @param glossaryGUID unique identifier of the glossary where the term is located * @param externalIdentifierProperties optional properties used to define an external identifier * @param glossaryTermProperties properties for the glossary term * @param initialStatus glossary term status to use when the object is created + * @param effectiveTime the time that the retrieved elements must be effective for * * @return unique identifier of the new metadata element for the glossary term * @@ -1104,10 +1165,12 @@ public String createGlossaryTerm(String glossaryGUID, public String createControlledGlossaryTerm(String userId, String assetManagerGUID, String assetManagerName, + boolean assetManagerIsHome, String glossaryGUID, ExternalIdentifierProperties externalIdentifierProperties, GlossaryTermProperties glossaryTermProperties, - GlossaryTermStatus initialStatus) throws InvalidParameterException, + GlossaryTermStatus initialStatus, + Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { @@ -1118,10 +1181,14 @@ public String createControlledGlossaryTerm(String userId, return glossaryManagerClient.createControlledGlossaryTerm(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, glossaryGUID, externalIdentifierProperties, glossaryTermProperties, - initialStatus); + initialStatus, + effectiveTime, + forLineage, + forDuplicateProcessing); } else { @@ -1139,6 +1206,8 @@ public String createControlledGlossaryTerm(String userId, /** * Create a new metadata element to represent a glossary term using an existing metadata element as a template. * + * @param glossaryGUID unique identifier of the glossary where the category is located + * @param assetManagerIsHome ensure that only the asset manager can update this element * @param templateGUID unique identifier of the metadata element to copy * @param externalIdentifierProperties optional properties used to define an external identifier * @param templateProperties properties that override the template @@ -1149,7 +1218,9 @@ public String createControlledGlossaryTerm(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) */ - public String createGlossaryTermFromTemplate(String templateGUID, + public String createGlossaryTermFromTemplate(String glossaryGUID, + boolean assetManagerIsHome, + String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, @@ -1162,6 +1233,8 @@ public String createGlossaryTermFromTemplate(String templa return glossaryManagerClient.createGlossaryTermFromTemplate(userId, assetManagerGUID, assetManagerName, + assetManagerIsHome, + glossaryGUID, templateGUID, externalIdentifierProperties, templateProperties); @@ -1691,19 +1764,19 @@ public void clearTermAsDataValue(String glossaryTermGUID, * * @param glossaryTermGUID unique identifier of the metadata element to update * @param glossaryTermExternalIdentifier unique identifier of the glossary term in the external asset manager - * @param activityType type of activity + * @param properties type of activity * @param effectiveTime the time that the retrieved elements must be effective for * * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - public void setTermAsActivity(String glossaryTermGUID, - String glossaryTermExternalIdentifier, - GlossaryTermActivityType activityType, - Date effectiveTime) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void setTermAsActivity(String glossaryTermGUID, + String glossaryTermExternalIdentifier, + ActivityDescriptionProperties properties, + Date effectiveTime) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "setTermAsActivity"; @@ -1714,7 +1787,7 @@ public void setTermAsActivity(String glossaryTermGUID, assetManagerName, glossaryTermGUID, glossaryTermExternalIdentifier, - activityType, + properties, effectiveTime, forLineage, forDuplicateProcessing); diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GovernanceExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GovernanceExchangeService.java index 84b4cf6147e..e3207eaec16 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GovernanceExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/GovernanceExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.GovernanceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GovernanceExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/InfrastructureExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/InfrastructureExchangeService.java index 11ddabaac54..866789ccd44 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/InfrastructureExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/InfrastructureExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.InfrastructureExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.InfrastructureExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/LineageExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/LineageExchangeService.java index 506d165a94c..4215bc135f3 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/LineageExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/LineageExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.LineageExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.LineageExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -14,7 +14,6 @@ import java.util.Date; import java.util.List; -import java.util.Map; /** diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/SchemaExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/SchemaExchangeService.java index 3f23ebeb743..532433c6078 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/SchemaExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/SchemaExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.api.SchemaExchangeInterface; +import org.odpi.openmetadata.accessservices.assetmanager.api.exchange.SchemaExchangeInterface; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaAttributeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaTypeElement; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/StewardshipExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/StewardshipExchangeService.java index 733dd9de235..bda5d8cd4ff 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/StewardshipExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/StewardshipExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.StewardshipExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.StewardshipExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ValidValuesExchangeService.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ValidValuesExchangeService.java index 279b66d6643..81818abdc6d 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ValidValuesExchangeService.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/catalog/connector/ValidValuesExchangeService.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.integrationservices.catalog.connector; -import org.odpi.openmetadata.accessservices.assetmanager.client.ValidValuesExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ValidValuesExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.SynchronizationDirection; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java index fc55b494687..a91a198a8e7 100644 --- a/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/catalog-integrator/catalog-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/catalog/contextmanager/CatalogIntegratorContextManager.java @@ -4,6 +4,17 @@ package org.odpi.openmetadata.integrationservices.catalog.contextmanager; import org.odpi.openmetadata.accessservices.assetmanager.client.*; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.CollaborationExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ConnectionExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.DataAssetExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalReferenceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GovernanceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.InfrastructureExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.LineageExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.StewardshipExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ValidValuesExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -33,18 +44,18 @@ public class CatalogIntegratorContextManager extends IntegrationContextManager private final static String disabledExchangeServicesOption = "disabledExchangeServices"; private ConnectedAssetClient connectedAssetClient; - private OpenMetadataStoreClient openMetadataStoreClient; - private ExternalAssetManagerClient assetManagerClient; - private CollaborationExchangeClient collaborationExchangeClient; - private ConnectionExchangeClient connectionExchangeClient; - private DataAssetExchangeClient dataAssetExchangeClient; - private ExternalReferenceExchangeClient externalReferenceExchangeClient; - private GlossaryExchangeClient glossaryExchangeClient; - private GovernanceExchangeClient governanceExchangeClient; - private InfrastructureExchangeClient infrastructureExchangeClient; - private LineageExchangeClient lineageExchangeClient; - private StewardshipExchangeClient stewardshipExchangeClient; - private ValidValuesExchangeClient validValuesExchangeClient; + private OpenMetadataStoreClient openMetadataStoreClient; + private ExternalAssetManagerClient assetManagerClient; + private CollaborationExchangeClient collaborationExchangeClient; + private ConnectionExchangeClient connectionExchangeClient; + private DataAssetExchangeClient dataAssetExchangeClient; + private ExternalReferenceExchangeClient externalReferenceExchangeClient; + private GlossaryExchangeClient glossaryExchangeClient; + private GovernanceExchangeClient governanceExchangeClient; + private InfrastructureExchangeClient infrastructureExchangeClient; + private LineageExchangeClient lineageExchangeClient; + private StewardshipExchangeClient stewardshipExchangeClient; + private ValidValuesExchangeClient validValuesExchangeClient; /** diff --git a/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/lineage/connector/LineageIntegratorContext.java b/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/lineage/connector/LineageIntegratorContext.java index beb8fbfa493..607e9aefb0b 100644 --- a/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/lineage/connector/LineageIntegratorContext.java +++ b/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/lineage/connector/LineageIntegratorContext.java @@ -5,10 +5,9 @@ import org.odpi.openmetadata.accessservices.assetmanager.api.AssetManagerEventListener; import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerEventClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.DataAssetExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.GovernanceExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.LineageExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.StewardshipExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.DataAssetExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GovernanceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.LineageExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.*; import org.odpi.openmetadata.accessservices.assetmanager.properties.*; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -38,7 +37,6 @@ public class LineageIntegratorContext extends IntegrationContext implements Open private final DataAssetExchangeClient dataAssetExchangeClient; private final LineageExchangeClient lineageExchangeClient; private final GovernanceExchangeClient governanceExchangeClient; - private final StewardshipExchangeClient stewardshipExchangeClient; private final AssetManagerEventClient eventClient; private final String integrationServiceName; private final AuditLog auditLog; @@ -59,7 +57,6 @@ public class LineageIntegratorContext extends IntegrationContext implements Open * @param dataAssetExchangeClient client for data asset requests * @param lineageExchangeClient client for lineage requests * @param governanceExchangeClient client for governance actions and related elements - * @param stewardshipExchangeClient client for attaching governance metadata * @param eventClient client managing listeners for the OMAS OutTopic * @param generateIntegrationReport should the connector generate an integration reports? * @param permittedSynchronization the direction of integration permitted by the integration connector @@ -80,7 +77,6 @@ public LineageIntegratorContext(String connectorId, DataAssetExchangeClient dataAssetExchangeClient, LineageExchangeClient lineageExchangeClient, GovernanceExchangeClient governanceExchangeClient, - StewardshipExchangeClient stewardshipExchangeClient, AssetManagerEventClient eventClient, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, @@ -106,7 +102,6 @@ public LineageIntegratorContext(String connectorId, this.dataAssetExchangeClient = dataAssetExchangeClient; this.lineageExchangeClient = lineageExchangeClient; this.governanceExchangeClient = governanceExchangeClient; - this.stewardshipExchangeClient = stewardshipExchangeClient; this.eventClient = eventClient; this.integrationServiceName = integrationServiceName; this.auditLog = auditLog; @@ -2927,7 +2922,14 @@ public List getDestinationLineageMappings(String sourceEl UserNotAuthorizedException, PropertyServerException { - return lineageExchangeClient.getDestinationLineageMappings(userId, externalSourceGUID, externalSourceName, sourceElementGUID, startFrom, pageSize, effectiveTime, forLineage, + return lineageExchangeClient.getDestinationLineageMappings(userId, + externalSourceGUID, + externalSourceName, + sourceElementGUID, + startFrom, + pageSize, + effectiveTime, + forLineage, forDuplicateProcessing); } @@ -2953,7 +2955,14 @@ public List getSourceLineageMappings(String destinationEl UserNotAuthorizedException, PropertyServerException { - return lineageExchangeClient.getSourceLineageMappings(userId, externalSourceGUID, externalSourceName, destinationElementGUID, startFrom, pageSize, effectiveTime, forLineage, + return lineageExchangeClient.getSourceLineageMappings(userId, + externalSourceGUID, + externalSourceName, + destinationElementGUID, + startFrom, + pageSize, + effectiveTime, + forLineage, forDuplicateProcessing); } @@ -2963,7 +2972,6 @@ public List getSourceLineageMappings(String destinationEl * Classify the element with the Memento classification to indicate that it has been logically deleted for by lineage requests. * * @param elementGUID unique identifier of the metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager * @param effectiveTime optional date for effective time of the query. Null means any effective time * * @throws InvalidParameterException one of the parameters is invalid @@ -2976,14 +2984,14 @@ public void addMementoClassification(String elementGUID, UserNotAuthorizedException, PropertyServerException { - stewardshipExchangeClient.addMementoClassification(userId, - externalSourceGUID, - externalSourceName, - elementGUID, - elementExternalIdentifier, - effectiveTime, - forLineage, - forDuplicateProcessing); + lineageExchangeClient.addMementoClassification(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementExternalIdentifier, + effectiveTime, + forLineage, + forDuplicateProcessing); } @@ -2991,7 +2999,6 @@ public void addMementoClassification(String elementGUID, * Remove the memento designation from the element. * * @param elementGUID unique identifier of the metadata element to update - * @param elementExternalIdentifier unique identifier of the element in the external asset manager * @param effectiveTime optional date for effective time of the query. Null means any effective time * * @throws InvalidParameterException one of the parameters is invalid @@ -3001,17 +3008,17 @@ public void addMementoClassification(String elementGUID, public void clearMementoClassification(String elementGUID, String elementExternalIdentifier, Date effectiveTime) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + UserNotAuthorizedException, + PropertyServerException { - stewardshipExchangeClient.clearMementoClassification(userId, - externalSourceGUID, - externalSourceName, - elementGUID, - elementExternalIdentifier, - effectiveTime, - forLineage, - forDuplicateProcessing); + lineageExchangeClient.clearMementoClassification(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementExternalIdentifier, + effectiveTime, + forLineage, + forDuplicateProcessing); } @@ -3032,14 +3039,14 @@ public void addIncompleteClassification(String elementGUID, UserNotAuthorizedException, PropertyServerException { - stewardshipExchangeClient.addIncompleteClassification(userId, - externalSourceGUID, - externalSourceName, - elementGUID, - elementExternalIdentifier, - effectiveTime, - forLineage, - forDuplicateProcessing); + lineageExchangeClient.addIncompleteClassification(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementExternalIdentifier, + effectiveTime, + forLineage, + forDuplicateProcessing); } @@ -3060,14 +3067,14 @@ public void clearIncompleteClassification(String elementGUID, UserNotAuthorizedException, PropertyServerException { - stewardshipExchangeClient.clearIncompleteClassification(userId, - externalSourceGUID, - externalSourceName, - elementGUID, - elementExternalIdentifier, - effectiveTime, - forLineage, - forDuplicateProcessing); + lineageExchangeClient.clearIncompleteClassification(userId, + externalSourceGUID, + externalSourceName, + elementGUID, + elementExternalIdentifier, + effectiveTime, + forLineage, + forDuplicateProcessing); } diff --git a/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java b/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java index a0d33dd8106..379a90d24a5 100644 --- a/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/lineage-integrator/lineage-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/lineage/contextmanager/LineageIntegratorContextManager.java @@ -7,6 +7,10 @@ import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.ObjectWriter; import org.odpi.openmetadata.accessservices.assetmanager.client.*; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.DataAssetExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GovernanceExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.LineageExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; @@ -40,7 +44,6 @@ public class LineageIntegratorContextManager extends IntegrationContextManager i private DataAssetExchangeClient dataAssetExchangeClient; private LineageExchangeClient lineageExchangeClient; private GovernanceExchangeClient governanceExchangeClient; - private StewardshipExchangeClient stewardshipExchangeClient; private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final ObjectWriter OBJECT_WRITER = OBJECT_MAPPER.writer(); @@ -134,11 +137,6 @@ public void createClients() throws InvalidParameterException maxPageSize, auditLog); - stewardshipExchangeClient = new StewardshipExchangeClient(partnerOMASServerName, - partnerOMASPlatformRootURL, - restClient, - maxPageSize, - auditLog); } @@ -223,7 +221,6 @@ public IntegrationContext setContext(String connectorId, dataAssetExchangeClient, lineageExchangeClient, governanceExchangeClient, - stewardshipExchangeClient, eventClient, generateIntegrationReport, permittedSynchronization, diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/AssetManagerOMASFVTSuite.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/AssetManagerOMASFVTSuite.java index db0446d93a4..b2f6c83ca3b 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/AssetManagerOMASFVTSuite.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/AssetManagerOMASFVTSuite.java @@ -5,7 +5,7 @@ import org.odpi.openmetadata.accessservices.assetmanager.fvt.clientconstructors.ClientConstructorTest; import org.odpi.openmetadata.accessservices.assetmanager.fvt.connections.CreateConnectionTest; import org.odpi.openmetadata.accessservices.assetmanager.fvt.externalidentifiers.ManageExternalIdsTest; -import org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries.CreateGlossaryTest; +import org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries.CreateExchangeGlossaryTest; import org.odpi.openmetadata.accessservices.assetmanager.fvt.errorhandling.InvalidParameterTest; import org.odpi.openmetadata.fvt.utilities.FVTResults; import org.odpi.openmetadata.fvt.utilities.FVTSuiteBase; @@ -93,7 +93,7 @@ public int performFVT(String serverName, } results.printResults(serverName); - results = CreateGlossaryTest.performFVT(serverName, serverPlatformRootURL, userId); + results = CreateExchangeGlossaryTest.performFVT(serverName, serverPlatformRootURL, userId); if (! results.isSuccessful()) { returnCode --; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/clientconstructors/ClientConstructorTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/clientconstructors/ClientConstructorTest.java index eb66c988c22..4c7689ac988 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/clientconstructors/ClientConstructorTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/clientconstructors/ClientConstructorTest.java @@ -4,8 +4,8 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.clientconstructors; import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerEventClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.GlossaryExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.fvt.common.AssetManagerTestBase; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/common/AssetManagerTestBase.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/common/AssetManagerTestBase.java index 0d18ea75dac..f79f34d2bdf 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/common/AssetManagerTestBase.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/common/AssetManagerTestBase.java @@ -3,20 +3,25 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.common; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalAssetManagerClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.management.GlossaryManagementClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.MetadataCorrelationHeader; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.ExternalIdentifierProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.KeyPattern; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; +import java.util.Date; import java.util.List; import java.util.Map; @@ -99,6 +104,37 @@ protected GlossaryExchangeClient getGlossaryExchangeClient(String serverName, } + + /** + * Create and return a glossary management client. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * @param testCaseName name of calling test case + * @return client + * @throws FVTUnexpectedCondition the test case failed + */ + protected GlossaryManagementClient getGlossaryManagementClient(String serverName, + String serverPlatformRootURL, + AuditLog auditLog, + String testCaseName) throws FVTUnexpectedCondition + { + final String activityName = "getGlossaryManagementClient"; + + try + { + AssetManagerRESTClient restClient = new AssetManagerRESTClient(serverName, serverPlatformRootURL); + + return new GlossaryManagementClient(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + /** * Create an asset manager entity and return its GUID. * @@ -330,6 +366,7 @@ protected String getGlossary(GlossaryExchangeClient client, String glossaryGUID = client.createGlossary(userId, assetManagerGUID, assetManagerName, + true, externalIdentifierProperties, properties); @@ -338,7 +375,7 @@ protected String getGlossary(GlossaryExchangeClient client, throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create)"); } - GlossaryElement retrievedElement = client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID); + GlossaryElement retrievedElement = client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID, new Date(), true, true); if (retrievedElement == null) { @@ -374,7 +411,7 @@ protected String getGlossary(GlossaryExchangeClient client, 1); - List glossaryList = client.getGlossariesByName(userId, assetManagerGUID, assetManagerName, glossaryName, 0, maxPageSize); + List glossaryList = client.getGlossariesByName(userId, assetManagerGUID, assetManagerName, glossaryName, 0, maxPageSize, new Date(), true, true); if (glossaryList == null) { @@ -432,4 +469,289 @@ else if (glossaryList.size() != 1) throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); } } + + + /** + * Create a new glossary object. The identifier may be null. The glossary is retrieved and the return values tested to + * be sure the new element was created correctly. + * + * @param client glossary client + * @param testCaseName calling test case + * @param activityName calling activity within the test case + * @param userId calling user + * @param glossaryName qualified name of glossary + * @param glossaryDisplayName display name for glossary + * @param glossaryDescription description of glossary + * @param glossaryUsage expected usage of the glossary + * @param glossaryLanguage language used in the glossary + * @return unique identifier of the new glossary + * @throws FVTUnexpectedCondition error + */ + protected String getGlossary(GlossaryManagementClient client, + String testCaseName, + String activityName, + String userId, + String glossaryName, + String glossaryDisplayName, + String glossaryDescription, + String glossaryUsage, + String glossaryLanguage) throws FVTUnexpectedCondition + { + try + { + GlossaryProperties properties = new GlossaryProperties(); + + properties.setQualifiedName(glossaryName); + properties.setDisplayName(glossaryDisplayName); + properties.setDescription(glossaryDescription); + properties.setUsage(glossaryUsage); + properties.setLanguage(glossaryLanguage); + + String glossaryGUID = client.createGlossary(userId, properties); + + if (glossaryGUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for Create)"); + } + + GlossaryElement retrievedElement = client.getGlossaryByGUID(userId, glossaryGUID, null, false, false); + + if (retrievedElement == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryElement from Retrieve)"); + } + + validateElementHeader(retrievedElement.getElementHeader(), + testCaseName, + activityName, + glossaryGUID, + GLOSSARY_TYPE_NAME); + + validateGlossaryProperties(retrievedElement.getGlossaryProperties(), + testCaseName, + activityName, + glossaryName, + glossaryDisplayName, + glossaryDescription, + glossaryUsage, + glossaryLanguage); + + + List glossaryList = client.getGlossariesByName(userId, glossaryName, 0, maxPageSize, null, false, false); + + if (glossaryList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Glossary for RetrieveByName)"); + } + else if (glossaryList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty Glossary list for RetrieveByName)"); + } + else if (glossaryList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(Glossary list for RetrieveByName contains" + glossaryList.size() + + " elements)"); + } + + retrievedElement = glossaryList.get(0); + + validateElementHeader(retrievedElement.getElementHeader(), + testCaseName, + activityName, + glossaryGUID, + GLOSSARY_TYPE_NAME); + + validateGlossaryProperties(retrievedElement.getGlossaryProperties(), + testCaseName, + activityName, + glossaryName, + glossaryDisplayName, + glossaryDescription, + glossaryUsage, + glossaryLanguage); + + return glossaryGUID; + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + + /** + * Verify that an element returned is as expected. + * + * @param testCaseName calling test case + * @param activityName which test + * @param stepName which step in test + * @param retrievedElement element to test + * @param glossaryTermGUID guid of element of interest + * @param typeName name of type of glossary term + * @param qualifiedName expected qualified name + * @param displayName expected display name + * @param description expected description + * @param extendedProperties additional properties for subtype + * @param status expected status + * @return boolean to indicate that the element matched the supplied GUID + * @throws FVTUnexpectedCondition something was wrong. + */ + protected boolean validateGlossaryTermElement(String testCaseName, + String activityName, + String stepName, + GlossaryTermElement retrievedElement, + String glossaryTermGUID, + String typeName, + String qualifiedName, + String displayName, + String description, + Map extendedProperties, + ElementStatus status) throws FVTUnexpectedCondition + { + ElementHeader retrievedHeader = retrievedElement.getElementHeader(); + + if (retrievedHeader == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryTerm header from " + stepName + ")" + retrievedElement.toString()); + } + + if (! glossaryTermGUID.equals(retrievedHeader.getGUID())) + { + /* + * Not this element + */ + return false; + } + + if (! typeName.equals(retrievedHeader.getType().getTypeName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad GlossaryTerm type of " + retrievedHeader.getType().getTypeName() + " rather than " + typeName + " from " + stepName + ")"); + } + + if (retrievedHeader.getOrigin().getHomeMetadataCollectionId() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Null GlossaryTerm metadata collection id from " + stepName + ")"); + } + + GlossaryTermProperties retrievedTerm = retrievedElement.getGlossaryTermProperties(); + + if (status != retrievedHeader.getStatus()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad GlossaryTerm status of " + retrievedHeader.getStatus() + " rather than " + status + " from " + stepName + ")"); + } + + if (retrievedTerm == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(No GlossaryTerm from " + stepName + ")"); + } + + if (! qualifiedName.equals(retrievedTerm.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from " + stepName + ": " + retrievedTerm.getQualifiedName() + " rather than " + qualifiedName + ")"); + } + if (! displayName.equals(retrievedTerm.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from " + stepName + ": " + retrievedTerm.getDisplayName() + " rather than " + displayName + ")"); + } + if (! description.equals(retrievedTerm.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from " + stepName + ": " + retrievedTerm.getDescription() + " rather than " + description + ")"); + } + + if (extendedProperties != null) + { + if (retrievedTerm.getExtendedProperties() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Missing extended properties " + stepName + ")"); + } + + if (extendedProperties.size() != retrievedTerm.getExtendedProperties().size()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Wrong number of extended properties " + stepName + ": " + retrievedTerm.getExtendedProperties() + " rather than " + extendedProperties + ")"); + } + + for (String extendedPropertyName : extendedProperties.keySet()) + { + if (retrievedTerm.getExtendedProperties().get(extendedPropertyName) == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Missing " + extendedPropertyName + " extended property " + stepName + ": " + retrievedTerm.getExtendedProperties() + " rather than " + extendedProperties + ")"); + } + + if (! extendedProperties.get(extendedPropertyName).equals(retrievedTerm.getExtendedProperties().get(extendedPropertyName))) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Mismatched " + extendedPropertyName + " extended property " + stepName + ": " + retrievedTerm.getExtendedProperties() + " rather than " + extendedProperties + ")"); + } + } + } + else + { + if (retrievedTerm.getExtendedProperties() != null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Unexpected extended properties " + stepName + ": " + retrievedTerm.getExtendedProperties() + ")"); + } + } + + return true; + } + + + + /** + * Validate a returned list of glossary term elements. + * + * @param testCaseName calling test case + * @param activityName which test + * @param stepName which step in test + * @param retrievedElements elements retrieved from the repository + * @param glossaryTermGUID unique identifier of the element to focus on + * @param typeName name of type of glossary term + * @param qualifiedName expected qualified name + * @param displayName expected display name + * @param description expected description + * @param extendedProperties additional properties for subtype + * @param status expected status + * @throws FVTUnexpectedCondition something was wrong. + */ + protected void validateGlossaryTermElements(String testCaseName, + String activityName, + String stepName, + List retrievedElements, + String glossaryTermGUID, + String typeName, + String qualifiedName, + String displayName, + String description, + Map extendedProperties, + ElementStatus status) throws FVTUnexpectedCondition + { + if (retrievedElements == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryTerm for " + stepName + ")"); + } + else if (retrievedElements.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty GlossaryTerm list for " + stepName + ")"); + } + + boolean elementFound = false; + + for (GlossaryTermElement termElement : retrievedElements) + { + if (validateGlossaryTermElement(testCaseName, activityName, stepName, termElement, glossaryTermGUID, typeName, qualifiedName, displayName, description, extendedProperties, status)) + { + elementFound = true; + } + } + + if (! elementFound) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Element " + glossaryTermGUID + " not found for " + stepName + ") " + retrievedElements.size() + " elements retrieved: " + retrievedElements.toString()); + } + } } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/connections/CreateConnectionTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/connections/CreateConnectionTest.java index 72ea3398509..77f03c4d888 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/connections/CreateConnectionTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/connections/CreateConnectionTest.java @@ -3,8 +3,8 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.connections; -import org.odpi.openmetadata.accessservices.assetmanager.client.ConnectionExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ConnectionExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectorTypeElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.ConnectionElement; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/dataassets/CreateDatabaseTest.java.inprogress b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/dataassets/CreateDatabaseTest.java.inprogress index b604a76e6a4..57a209fa816 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/dataassets/CreateDatabaseTest.java.inprogress +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/dataassets/CreateDatabaseTest.java.inprogress @@ -3,8 +3,8 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.dataassets; -import org.odpi.openmetadata.accessservices.assetmanager.client.DataAssetExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.DataAssetExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.DataAssetElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.SchemaAttributeElement; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/errorhandling/InvalidParameterTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/errorhandling/InvalidParameterTest.java index aa53e0e4b05..f37a718b433 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/errorhandling/InvalidParameterTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/errorhandling/InvalidParameterTest.java @@ -4,8 +4,8 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.errorhandling; import org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerEventClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.GlossaryExchangeClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.client.rest.AssetManagerRESTClient; import org.odpi.openmetadata.accessservices.assetmanager.properties.AssetManagerProperties; import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryProperties; @@ -469,6 +469,7 @@ private void testCreateGlossaryNoUserId(GlossaryExchangeClient client) throws FV client.createGlossary(null, assetManagerGUID, assetManagerName, + true, null, properties); @@ -503,6 +504,7 @@ private void testCreateGlossaryNoProperties(GlossaryExchangeClient client, client.createGlossary(userId, assetManagerGUID, assetManagerName, + true, null, null); throw new FVTUnexpectedCondition(testCaseName, activityName); @@ -537,6 +539,7 @@ private void testCreateGlossaryNoQualifiedName(GlossaryExchangeClient client, client.createGlossary(userId, assetManagerGUID, assetManagerName, + true, null, properties); throw new FVTUnexpectedCondition(testCaseName, activityName); diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/externalidentifiers/ManageExternalIdsTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/externalidentifiers/ManageExternalIdsTest.java index a090d3e436b..2f3ad727e80 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/externalidentifiers/ManageExternalIdsTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/externalidentifiers/ManageExternalIdsTest.java @@ -3,8 +3,8 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.externalidentifiers; -import org.odpi.openmetadata.accessservices.assetmanager.client.ExternalAssetManagerClient; -import org.odpi.openmetadata.accessservices.assetmanager.client.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExternalAssetManagerClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.fvt.common.AssetManagerTestBase; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.MetadataCorrelationHeader; @@ -159,7 +159,7 @@ private void testOneToOne(String serverPlatformRootURL, throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for getGlossary)"); } - GlossaryElement retrievedElement = client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerOneName, glossaryGUID); + GlossaryElement retrievedElement = client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerOneName, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -225,11 +225,11 @@ private void testOneToOne(String serverPlatformRootURL, throw new FVTUnexpectedCondition(testCaseName, activityName + "(bad assetManagerName)"); } - client.removeGlossary(userId, assetManagerGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne); + client.removeGlossary(userId, assetManagerGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne, null, false, false); try { - client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerOneName, glossaryGUID); + client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerOneName, glossaryGUID, null, false, false); throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); } @@ -324,7 +324,7 @@ private void testMultipleAssetManagers(String serverPlatformRootURL, /* * Retrieve element for just asset manager two */ - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerTwoGUID, assetManagerTwoName, glossaryGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerTwoGUID, assetManagerTwoName, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -383,7 +383,7 @@ private void testMultipleAssetManagers(String serverPlatformRootURL, /* * Retrieve element for just asset manager one */ - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -442,7 +442,7 @@ private void testMultipleAssetManagers(String serverPlatformRootURL, /* * Retrieve correlation headers for all asset managers */ - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, null, null, glossaryGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, null, null, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -466,11 +466,11 @@ private void testMultipleAssetManagers(String serverPlatformRootURL, throw new FVTUnexpectedCondition(testCaseName, activityName + "(Wrong number of Correlation properties from Retrieve) " + metadataCorrelationHeaders); } - glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne); + glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne, null, false, false); try { - glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID); + glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, null, false, false); throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); } @@ -567,7 +567,7 @@ private void testMultipleAssetManagersSameExtID(String serverPlatformRootURL, /* * Retrieve from asset manager two */ - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerTwoGUID, assetManagerTwoName, glossaryGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerTwoGUID, assetManagerTwoName, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -627,7 +627,7 @@ private void testMultipleAssetManagersSameExtID(String serverPlatformRootURL, /* * Retrieve from asset manager one */ - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -686,7 +686,7 @@ private void testMultipleAssetManagersSameExtID(String serverPlatformRootURL, /* * Retrieve from all asset managers. */ - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, null, null, glossaryGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, null, null, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -711,11 +711,11 @@ private void testMultipleAssetManagersSameExtID(String serverPlatformRootURL, } - glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne); + glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne, null, false, false); try { - glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID); + glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, null, false, false); throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); } @@ -800,7 +800,7 @@ private void testOneToMany(String serverPlatformRootURL, GLOSSARY_TYPE_NAME, externalIdentifierProperties); - GlossaryElement retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID); + GlossaryElement retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, null, false, false); if (retrievedElement == null) { @@ -824,11 +824,11 @@ private void testOneToMany(String serverPlatformRootURL, throw new FVTUnexpectedCondition(testCaseName, activityName + "(Wrong number of Correlation properties from Retrieve)"); } - glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne); + glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, externalGlossaryIdentifierOne, null, false, false); try { - glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID); + glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryGUID, null, false, false); throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); } @@ -917,7 +917,7 @@ private void testManyToOne(String serverPlatformRootURL, throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for getGlossary Two)"); } - GlossaryElement retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryOneGUID); + GlossaryElement retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryOneGUID, null, false, false); if (retrievedElement == null) { @@ -974,7 +974,7 @@ private void testManyToOne(String serverPlatformRootURL, } - retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryTwoGUID); + retrievedElement = glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryTwoGUID, null, false, false); if (retrievedElement == null) { @@ -1026,11 +1026,11 @@ private void testManyToOne(String serverPlatformRootURL, } - glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryOneGUID, externalGlossaryIdentifierOne); + glossaryExchangeClient.removeGlossary(userId, assetManagerOneGUID, assetManagerOneName, glossaryOneGUID, externalGlossaryIdentifierOne, null, false, false); try { - glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryOneGUID); + glossaryExchangeClient.getGlossaryByGUID(userId, assetManagerOneGUID, assetManagerOneName, glossaryOneGUID, null, false, false); throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateGlossaryTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateExchangeGlossaryTest.java similarity index 81% rename from open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateGlossaryTest.java rename to open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateExchangeGlossaryTest.java index ce804354e6b..69ad1e7c2b6 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateGlossaryTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateExchangeGlossaryTest.java @@ -3,7 +3,7 @@ package org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries; -import org.odpi.openmetadata.accessservices.assetmanager.client.GlossaryExchangeClient; +import org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GlossaryExchangeClient; import org.odpi.openmetadata.accessservices.assetmanager.fvt.common.AssetManagerTestBase; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; @@ -23,12 +23,12 @@ import java.util.Map; /** - * CreateGlossaryTest calls the GlossaryExchangeClient to create a glossary with categories and terms + * CreateExchangeGlossaryTest calls the GlossaryExchangeClient to create a glossary with categories and terms * and then retrieve the results. */ -public class CreateGlossaryTest extends AssetManagerTestBase +public class CreateExchangeGlossaryTest extends AssetManagerTestBase { - private final static String testCaseName = "CreateGlossaryTest"; + private final static String testCaseName = "CreateExchangeGlossaryTest"; private final static int maxPageSize = 100; @@ -98,7 +98,7 @@ public static FVTResults performFVT(String serverName, results.incrementNumberOfTests(); try { - CreateGlossaryTest.runIt(serverPlatformRootURL, serverName, userId, results.getAuditLogDestination()); + CreateExchangeGlossaryTest.runIt(serverPlatformRootURL, serverName, userId, results.getAuditLogDestination()); results.incrementNumberOfSuccesses(); } catch (Exception error) @@ -124,7 +124,7 @@ private static void runIt(String serverPlatformRootURL, String userId, FVTAuditLogDestination auditLogDestination) throws FVTUnexpectedCondition { - CreateGlossaryTest thisTest = new CreateGlossaryTest(); + CreateExchangeGlossaryTest thisTest = new CreateExchangeGlossaryTest(); AuditLog auditLog = new AuditLog(auditLogDestination, AccessServiceDescription.ASSET_MANAGER_OMAS.getAccessServiceCode(), @@ -158,7 +158,7 @@ private static void runIt(String serverPlatformRootURL, try { - GlossaryElement glossaryElement = client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID); + GlossaryElement glossaryElement = client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID, null, false, false); if (glossaryElement == null) { @@ -232,10 +232,14 @@ else if (glossaryElement.getGlossaryProperties() == null) glossaryTermGUID = client.createControlledGlossaryTerm(userId, null, null, + false, glossaryGUID, null, properties, - GlossaryTermStatus.DRAFT); + GlossaryTermStatus.DRAFT, + null, + false, + false); throw new FVTUnexpectedCondition(testCaseName, activityName + " (term created with invalid property " + glossaryTermGUID + ")"); } @@ -250,7 +254,7 @@ else if (glossaryElement.getGlossaryProperties() == null) try { - client.removeGlossary(userId, assetManagerGUID, assetManagerName, glossaryGUID, externalGlossaryIdentifier); + client.removeGlossary(userId, assetManagerGUID, assetManagerName, glossaryGUID, externalGlossaryIdentifier, null, false, false); } catch (Exception unexpectedError) { @@ -259,7 +263,7 @@ else if (glossaryElement.getGlossaryProperties() == null) try { - client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID); + client.getGlossaryByGUID(userId, assetManagerGUID, assetManagerName, glossaryGUID, null, false, false); throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); } @@ -275,6 +279,44 @@ else if (glossaryElement.getGlossaryProperties() == null) { throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); } + + try + { + client.getGlossaryTermByGUID(userId, assetManagerGUID, assetManagerName, glossaryTermGUID, null, false, false); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary term not deleted)"); + } + catch (InvalidParameterException notFound) + { + // all well + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + + try + { + client.getGlossaryCategoryByGUID(userId, assetManagerGUID, assetManagerName, glossaryCategoryGUID, null, false, false); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary category not deleted)"); + } + catch (InvalidParameterException notFound) + { + // all well + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } } @@ -315,9 +357,13 @@ private String getGlossaryCategory(GlossaryExchangeClient client, String glossaryCategoryGUID = client.createGlossaryCategory(userId, assetManagerGUID, assetManagerName, + true, glossaryGUID, externalIdentifierProperties, - properties); + properties, + null, + false, + false); if (glossaryCategoryGUID == null) { @@ -437,7 +483,8 @@ private void addTermToCategory(GlossaryExchangeClient client, List glossaryTermList = client.getTermsForGlossaryCategory(userId, null, null, glossaryCategoryGUID, 0 , 0, null, false, false); - this.validateGlossaryTermElements(activityName, + this.validateGlossaryTermElements(testCaseName, + activityName, "RetrieveByCategory", glossaryTermList, glossaryTermGUID, @@ -496,9 +543,13 @@ private String getGlossaryTerm(GlossaryExchangeClient client, String glossaryTermGUID = client.createGlossaryTerm(userId, assetManagerGUID, assetManagerName, + true, glossaryGUID, externalIdentifierProperties, - properties); + properties, + null, + false, + false); if (glossaryTermGUID == null) { @@ -563,10 +614,14 @@ private String getControlledGlossaryTerm(GlossaryExchangeClient client, String glossaryTermGUID = client.createControlledGlossaryTerm(userId, null, null, + false, glossaryGUID, null, properties, - GlossaryTermStatus.DRAFT); + GlossaryTermStatus.DRAFT, + null, + false, + false); if (glossaryTermGUID == null) { @@ -744,7 +799,8 @@ private void validateGlossaryTerm(GlossaryExchangeClient client, throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryTerm from Retrieve)"); } - validateGlossaryTermElement(activityName, + validateGlossaryTermElement(testCaseName, + activityName, "Retrieve", retrievedElement, glossaryTermGUID, @@ -757,7 +813,8 @@ private void validateGlossaryTerm(GlossaryExchangeClient client, List glossaryTermList = client.getGlossaryTermsByName(userId, assetManagerGUID, assetManagerName, null, qualifiedName, null,0, maxPageSize, null, false, false); - validateGlossaryTermElements(activityName, + validateGlossaryTermElements(testCaseName, + activityName, "RetrieveByQualifiedName", glossaryTermList, glossaryTermGUID, @@ -770,7 +827,8 @@ private void validateGlossaryTerm(GlossaryExchangeClient client, glossaryTermList = client.getGlossaryTermsByName(userId, assetManagerGUID, assetManagerName, null, displayName, null, 0, 0, null, false, false); - validateGlossaryTermElements(activityName, + validateGlossaryTermElements(testCaseName, + activityName, "RetrieveTermsByGlossary", glossaryTermList, glossaryTermGUID, @@ -783,7 +841,8 @@ private void validateGlossaryTerm(GlossaryExchangeClient client, glossaryTermList = client.getTermsForGlossary(userId, null, null, glossaryGUID, 0, 0, null, false, false); - validateGlossaryTermElements(activityName, + validateGlossaryTermElements(testCaseName, + activityName, "RetrieveTermsByGlossary", glossaryTermList, glossaryTermGUID, @@ -805,168 +864,4 @@ private void validateGlossaryTerm(GlossaryExchangeClient client, } - /** - * Validate a returned list of glossary term elements. - * - * @param activityName which test - * @param stepName which step in test - * @param retrievedElements elements retrieved from the repository - * @param glossaryTermGUID unique identifier of the element to focus on - * @param typeName name of type of glossary term - * @param qualifiedName expected qualified name - * @param displayName expected display name - * @param description expected description - * @param extendedProperties additional properties for subtype - * @param status expected status - * @throws FVTUnexpectedCondition something was wrong. - */ - private void validateGlossaryTermElements(String activityName, - String stepName, - List retrievedElements, - String glossaryTermGUID, - String typeName, - String qualifiedName, - String displayName, - String description, - Map extendedProperties, - ElementStatus status) throws FVTUnexpectedCondition - { - if (retrievedElements == null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryTerm for " + stepName + ")"); - } - else if (retrievedElements.isEmpty()) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty GlossaryTerm list for " + stepName + ")"); - } - - boolean elementFound = false; - - for (GlossaryTermElement termElement : retrievedElements) - { - if (validateGlossaryTermElement(activityName, stepName, termElement, glossaryTermGUID, typeName, qualifiedName, displayName, description, extendedProperties, status)) - { - elementFound = true; - } - } - - if (! elementFound) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Element " + glossaryTermGUID + " not found for " + stepName + ") " + retrievedElements.size() + " elements retrieved: " + retrievedElements.toString()); - } - } - - - /** - * Verify that an element returned is as expected. - * - * @param activityName which test - * @param stepName which step in test - * @param retrievedElement element to test - * @param glossaryTermGUID guid of element of interest - * @param typeName name of type of glossary term - * @param qualifiedName expected qualified name - * @param displayName expected display name - * @param description expected description - * @param extendedProperties additional properties for subtype - * @param status expected status - * @return boolean to indicate that the element matched the supplied GUID - * @throws FVTUnexpectedCondition something was wrong. - */ - private boolean validateGlossaryTermElement(String activityName, - String stepName, - GlossaryTermElement retrievedElement, - String glossaryTermGUID, - String typeName, - String qualifiedName, - String displayName, - String description, - Map extendedProperties, - ElementStatus status) throws FVTUnexpectedCondition - { - ElementHeader retrievedHeader = retrievedElement.getElementHeader(); - - if (retrievedHeader == null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryTerm header from " + stepName + ")" + retrievedElement.toString()); - } - - if (! glossaryTermGUID.equals(retrievedHeader.getGUID())) - { - /* - * Not this element - */ - return false; - } - - if (! typeName.equals(retrievedHeader.getType().getTypeName())) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad GlossaryTerm type of " + retrievedHeader.getType().getTypeName() + " rather than " + typeName + " from " + stepName + ")"); - } - - if (retrievedHeader.getOrigin().getHomeMetadataCollectionId() == null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Null GlossaryTerm metadata collection id from " + stepName + ")"); - } - - GlossaryTermProperties retrievedTerm = retrievedElement.getGlossaryTermProperties(); - - if (status != retrievedHeader.getStatus()) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad GlossaryTerm status of " + retrievedHeader.getStatus() + " rather than " + status + " from " + stepName + ")"); - } - - if (retrievedTerm == null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(No GlossaryTerm from " + stepName + ")"); - } - - if (! qualifiedName.equals(retrievedTerm.getQualifiedName())) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from " + stepName + ": " + retrievedTerm.getQualifiedName() + " rather than " + qualifiedName + ")"); - } - if (! displayName.equals(retrievedTerm.getDisplayName())) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from " + stepName + ": " + retrievedTerm.getDisplayName() + " rather than " + displayName + ")"); - } - if (! description.equals(retrievedTerm.getDescription())) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from " + stepName + ": " + retrievedTerm.getDescription() + " rather than " + description + ")"); - } - - if (extendedProperties != null) - { - if (retrievedTerm.getExtendedProperties() == null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Missing extended properties " + stepName + ")"); - } - - if (extendedProperties.size() != retrievedTerm.getExtendedProperties().size()) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Wrong number of extended properties " + stepName + ": " + retrievedTerm.getExtendedProperties() + " rather than " + extendedProperties + ")"); - } - - for (String extendedPropertyName : extendedProperties.keySet()) - { - if (retrievedTerm.getExtendedProperties().get(extendedPropertyName) == null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Missing " + extendedPropertyName + " extended property " + stepName + ": " + retrievedTerm.getExtendedProperties() + " rather than " + extendedProperties + ")"); - } - - if (! extendedProperties.get(extendedPropertyName).equals(retrievedTerm.getExtendedProperties().get(extendedPropertyName))) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Mismatched " + extendedPropertyName + " extended property " + stepName + ": " + retrievedTerm.getExtendedProperties() + " rather than " + extendedProperties + ")"); - } - } - } - else - { - if (retrievedTerm.getExtendedProperties() != null) - { - throw new FVTUnexpectedCondition(testCaseName, activityName + "(Unexpected extended properties " + stepName + ": " + retrievedTerm.getExtendedProperties() + ")"); - } - } - - return true; - } } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateManagementGlossaryTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateManagementGlossaryTest.java new file mode 100644 index 00000000000..319f4482ed8 --- /dev/null +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/glossaries/CreateManagementGlossaryTest.java @@ -0,0 +1,740 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries; + +import org.odpi.openmetadata.accessservices.assetmanager.client.management.GlossaryManagementClient; +import org.odpi.openmetadata.accessservices.assetmanager.fvt.common.AssetManagerTestBase; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryCategoryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryElement; +import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryCategoryProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermCategorization; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermProperties; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermRelationshipStatus; +import org.odpi.openmetadata.accessservices.assetmanager.properties.GlossaryTermStatus; +import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStatus; +import org.odpi.openmetadata.fvt.utilities.FVTResults; +import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; +import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * CreateExchangeGlossaryTest calls the GlossaryManagementClient to create a glossary with categories and terms + * and then retrieve the results. + */ +public class CreateManagementGlossaryTest extends AssetManagerTestBase +{ + private final static String testCaseName = "CreateManagementGlossaryTest"; + + private final static int maxPageSize = 100; + + private final static String glossaryName = "ManagementTestGlossaryCreate"; + private final static String glossaryDisplayName = "ManagementGlossary displayName"; + private final static String glossaryDescription = "ManagementGlossary description"; + private final static String glossaryUsage = "ManagementGlossary usage"; + private final static String glossaryLanguage = "ManagementGlossary language"; + + private final static String glossaryCategoryName = "ManagementTestGlossaryCreateCategory"; + private final static String glossaryCategoryDisplayName = "ManagementGlossaryCategory displayName"; + private final static String glossaryCategoryDescription = "ManagementGlossaryCategory description"; + + private final static String glossaryTermName = "ManagementTestGlossaryCreateTerm"; + private final static String glossaryTermDisplayName = "ManagementGlossaryTerm displayName"; + private final static String glossaryTermDescription = "ManagementGlossaryTerm description"; + + + private final static String controlledGlossaryTermName = "ManagementTestGlossaryCreateControlledTerm"; + private final static String controlledGlossaryTermDisplayName = "ManagementControlledGlossaryTerm displayName"; + private final static String controlledGlossaryTermDescription = "ManagementControlledGlossaryTerm description"; + private final static String controlledGlossaryTermStatus = "Truly Awesome"; + + + + /** + * Run all the defined tests and capture the results. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param userId calling user + * @return results of running test + */ + public static FVTResults performFVT(String serverName, + String serverPlatformRootURL, + String userId) + { + FVTResults results = new FVTResults(testCaseName); + + results.incrementNumberOfTests(); + try + { + CreateManagementGlossaryTest.runIt(serverPlatformRootURL, serverName, userId, results.getAuditLogDestination()); + results.incrementNumberOfSuccesses(); + } + catch (Exception error) + { + results.addCapturedError(error); + } + + return results; + } + + + /** + * Run all the tests in this class. + * + * @param serverPlatformRootURL root url of the server + * @param serverName name of the server + * @param userId calling user + * @param auditLogDestination logging destination + * @throws FVTUnexpectedCondition the test case failed + */ + private static void runIt(String serverPlatformRootURL, + String serverName, + String userId, + FVTAuditLogDestination auditLogDestination) throws FVTUnexpectedCondition + { + CreateManagementGlossaryTest thisTest = new CreateManagementGlossaryTest(); + + AuditLog auditLog = new AuditLog(auditLogDestination, + AccessServiceDescription.ASSET_MANAGER_OMAS.getAccessServiceCode(), + AccessServiceDescription.ASSET_MANAGER_OMAS.getAccessServiceDevelopmentStatus(), + AccessServiceDescription.ASSET_MANAGER_OMAS.getAccessServiceName(), + AccessServiceDescription.ASSET_MANAGER_OMAS.getAccessServiceDescription(), + AccessServiceDescription.ASSET_MANAGER_OMAS.getAccessServiceWiki()); + + GlossaryManagementClient client = thisTest.getGlossaryManagementClient(serverName, serverPlatformRootURL, auditLog, testCaseName); + + String activityName = "getGlossary("+ glossaryName + ")"; + String glossaryGUID = thisTest.getGlossary(client, + testCaseName, + activityName, + userId, + glossaryName, + glossaryDisplayName, + glossaryDescription, + glossaryUsage, + glossaryLanguage); + + try + { + GlossaryElement glossaryElement = client.getGlossaryByGUID(userId, glossaryGUID, null, false, false); + + if (glossaryElement == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no glossary element)"); + } + else if (glossaryElement.getElementHeader() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no glossary header) " + glossaryElement.toString()); + } + else if (glossaryElement.getGlossaryProperties() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no glossary properties) " + glossaryElement.toString()); + } + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + + String glossaryCategoryGUID = thisTest.getGlossaryCategory(client, glossaryGUID, userId); + + String glossaryTermGUID = thisTest.getGlossaryTerm(client, glossaryGUID, userId); + String controlledGlossaryTermGUID = thisTest.getControlledGlossaryTerm(client, glossaryGUID, userId); + + thisTest.addTermToCategory(client, + glossaryCategoryGUID, + glossaryTermGUID, + userId, + "GlossaryTerm", + glossaryTermName, + glossaryTermDisplayName, + glossaryTermDescription, + null, + ElementStatus.ACTIVE); + + Map extendedProperties = new HashMap<>(); + + extendedProperties.put("userDefinedStatus", controlledGlossaryTermStatus); + + thisTest.addTermToCategory(client, + glossaryCategoryGUID, + controlledGlossaryTermGUID, + userId, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.DRAFT); + + activityName = "Bad property("+ glossaryName + ")"; + + try + { + GlossaryTermProperties properties = new GlossaryTermProperties(); + extendedProperties = new HashMap<>(); + + extendedProperties.put("badPropertyName", controlledGlossaryTermStatus); + + properties.setQualifiedName(controlledGlossaryTermName); + properties.setDisplayName(controlledGlossaryTermDisplayName); + properties.setDescription(controlledGlossaryTermDescription); + properties.setExtendedProperties(extendedProperties); + + glossaryTermGUID = client.createControlledGlossaryTerm(userId, + glossaryGUID, + properties, + GlossaryTermStatus.DRAFT, + null, + false, + false); + + throw new FVTUnexpectedCondition(testCaseName, activityName + " (term created with invalid property " + glossaryTermGUID + ")"); + } + catch (InvalidParameterException unexpectedError) + { + // all good + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + " => " + glossaryGUID, unexpectedError); + } + + try + { + client.removeGlossary(userId, glossaryGUID, null, false, false); + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + " => " + glossaryGUID, unexpectedError); + } + + try + { + client.getGlossaryByGUID(userId, glossaryGUID, null, false, false); + + throw new FVTUnexpectedCondition(testCaseName, activityName + "(glossary not deleted)"); + } + catch (InvalidParameterException notFound) + { + // all well + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Create a glossary category and return its GUID. + * + * @param client interface to Asset Manager OMAS + * @param glossaryGUID unique id of the glossary + * @param userId calling user + * @return GUID of glossary + * @throws FVTUnexpectedCondition the test case failed + */ + private String getGlossaryCategory(GlossaryManagementClient client, + String glossaryGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "getGlossaryCategory"; + + try + { + GlossaryCategoryProperties properties = new GlossaryCategoryProperties(); + + properties.setQualifiedName(glossaryCategoryName); + properties.setDisplayName(glossaryCategoryDisplayName); + properties.setDescription(glossaryCategoryDescription); + + String glossaryCategoryGUID = client.createGlossaryCategory(userId, + glossaryGUID, + properties, + null, + false, + false); + + if (glossaryCategoryGUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for schemaCreate)"); + } + + GlossaryCategoryElement retrievedElement = client.getGlossaryCategoryByGUID(userId, glossaryCategoryGUID, null, false, false); + GlossaryCategoryProperties retrievedCategory = retrievedElement.getGlossaryCategoryProperties(); + + if (retrievedCategory == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryCategory from Retrieve) " + retrievedElement.toString()); + } + + if (retrievedElement.getElementHeader() == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no Header from Retrieve) " + retrievedElement.toString()); + } + + if (! glossaryCategoryName.equals(retrievedCategory.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve)"); + } + if (! glossaryCategoryDisplayName.equals(retrievedCategory.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from Retrieve)"); + } + if (! glossaryCategoryDescription.equals(retrievedCategory.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from Retrieve)"); + } + + + List glossaryCategoryList = client.getGlossaryCategoriesByName(userId, null, glossaryCategoryName, 0, maxPageSize, null, false, false); + + if (glossaryCategoryList == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryCategory for RetrieveByName)"); + } + else if (glossaryCategoryList.isEmpty()) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Empty GlossaryCategory list for RetrieveByName)"); + } + else if (glossaryCategoryList.size() != 1) + { + throw new FVTUnexpectedCondition(testCaseName, + activityName + "(GlossaryCategory list for RetrieveByName contains" + glossaryCategoryList.size() + + " elements)"); + } + + retrievedElement = glossaryCategoryList.get(0); + retrievedCategory = retrievedElement.getGlossaryCategoryProperties(); + + if (! glossaryCategoryName.equals(retrievedCategory.getQualifiedName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from RetrieveByName)"); + } + if (! glossaryCategoryDisplayName.equals(retrievedCategory.getDisplayName())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad displayName from RetrieveByName)"); + } + if (! glossaryCategoryDescription.equals(retrievedCategory.getDescription())) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad description from RetrieveByName)"); + } + + return glossaryCategoryGUID; + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Add the term to the category and then retrieve the categories terms and check that the term is there. + * + * @param client interface to Asset Manager OMAS + * @param glossaryCategoryGUID unique id of the glossary category + * @param glossaryTermGUID unique id of the glossary term + * @param userId calling user id + * @param typeName expected type name of the glossary term + * @param qualifiedName expected qualified name of the glossary term + * @param displayName expected display name of the glossary term + * @param description expected description of the glossary term + * @param extendedProperties additional properties for subtype + * @param status expected status of the glossary term + * @throws FVTUnexpectedCondition the test case failed + */ + private void addTermToCategory(GlossaryManagementClient client, + String glossaryCategoryGUID, + String glossaryTermGUID, + String userId, + String typeName, + String qualifiedName, + String displayName, + String description, + Map extendedProperties, + ElementStatus status) throws FVTUnexpectedCondition + { + final String activityName = "addTermToCategory"; + + try + { + GlossaryTermCategorization categorizationProperties = new GlossaryTermCategorization(); + categorizationProperties.setDescription("Category for " + glossaryTermGUID); + categorizationProperties.setStatus(GlossaryTermRelationshipStatus.ACTIVE); + + client.setupTermCategory(userId, glossaryCategoryGUID, glossaryTermGUID, categorizationProperties, null, false, false); + + List glossaryTermList = client.getTermsForGlossaryCategory(userId, glossaryCategoryGUID, 0 , 0, null, false, false); + + this.validateGlossaryTermElements(testCaseName, + activityName, + "RetrieveByCategory", + glossaryTermList, + glossaryTermGUID, + typeName, + qualifiedName, + displayName, + description, + extendedProperties, + status); + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Create a glossary term and return its GUID. + * + * @param client interface to Asset Manager OMAS + * @param glossaryGUID unique id of the glossaryCategory + * @param userId calling user + * @return GUID of glossary + * @throws FVTUnexpectedCondition the test case failed + */ + private String getGlossaryTerm(GlossaryManagementClient client, + String glossaryGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "getGlossaryTerm"; + + try + { + GlossaryTermProperties properties = new GlossaryTermProperties(); + + properties.setQualifiedName(glossaryTermName); + properties.setDisplayName(glossaryTermDisplayName); + properties.setDescription(glossaryTermDescription); + + Map mappingProperties = new HashMap<>(); + mappingProperties.put("prop1", "One"); + mappingProperties.put("prop2", "Two"); + + String glossaryTermGUID = client.createGlossaryTerm(userId, + glossaryGUID, + properties, + null, + false, + false); + + if (glossaryTermGUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for GlossaryTerm Create)"); + } + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "GlossaryTerm", + glossaryTermName, + glossaryTermDisplayName, + glossaryTermDescription, + null, + ElementStatus.ACTIVE); + + return glossaryTermGUID; + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + + /** + * Create a local cohort controlled glossary term and return its GUID. + * + * @param client interface to Asset Manager OMAS + * @param glossaryGUID unique id of the glossaryCategory + * @param userId calling user + * @return GUID of glossary + * @throws FVTUnexpectedCondition the test case failed + */ + private String getControlledGlossaryTerm(GlossaryManagementClient client, + String glossaryGUID, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "getControlledGlossaryTerm"; + + try + { + GlossaryTermProperties properties = new GlossaryTermProperties(); + Map extendedProperties = new HashMap<>(); + + extendedProperties.put("userDefinedStatus", controlledGlossaryTermStatus); + + properties.setQualifiedName(controlledGlossaryTermName); + properties.setDisplayName(controlledGlossaryTermDisplayName); + properties.setDescription(controlledGlossaryTermDescription); + properties.setExtendedProperties(extendedProperties); + + + String glossaryTermGUID = client.createControlledGlossaryTerm(userId, + glossaryGUID, + properties, + GlossaryTermStatus.DRAFT, + null, + false, + false); + + if (glossaryTermGUID == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GUID for ControlledGlossaryTerm Create)"); + } + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.DRAFT); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.PROPOSED, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.PROPOSED); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.APPROVED, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.APPROVED); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.ACTIVE, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.ACTIVE); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.PREPARED, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.PREPARED); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.REJECTED, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.REJECTED); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.OTHER, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.OTHER); + + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.DEPRECATED, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.DEPRECATED); + + /* + * Set the state back to draft for subsequent tests + */ + client.updateGlossaryTermStatus(userId, glossaryTermGUID, GlossaryTermStatus.DRAFT, null, false, false); + + validateGlossaryTerm(client, + userId, + activityName, + glossaryGUID, + glossaryTermGUID, + "ControlledGlossaryTerm", + controlledGlossaryTermName, + controlledGlossaryTermDisplayName, + controlledGlossaryTermDescription, + extendedProperties, + ElementStatus.DRAFT); + + return glossaryTermGUID; + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + private void validateGlossaryTerm(GlossaryManagementClient client, + String userId, + String activityName, + String glossaryGUID, + String glossaryTermGUID, + String typeName, + String qualifiedName, + String displayName, + String description, + Map extendedProperties, + ElementStatus status) throws FVTUnexpectedCondition + { + try + { + GlossaryTermElement retrievedElement = client.getGlossaryTermByGUID(userId, glossaryTermGUID, null, false, false); + + if (retrievedElement == null) + { + throw new FVTUnexpectedCondition(testCaseName, activityName + "(no GlossaryTerm from Retrieve)"); + } + + validateGlossaryTermElement(testCaseName, + activityName, + "Retrieve", + retrievedElement, + glossaryTermGUID, + typeName, + qualifiedName, + displayName, + description, + extendedProperties, + status); + + List glossaryTermList = client.getGlossaryTermsByName(userId, null, qualifiedName, null,0, maxPageSize, null, false, false); + + validateGlossaryTermElements(testCaseName, + activityName, + "RetrieveByQualifiedName", + glossaryTermList, + glossaryTermGUID, + typeName, + qualifiedName, + displayName, + description, + extendedProperties, + status); + + glossaryTermList = client.getGlossaryTermsByName(userId, null, displayName, null, 0, 0, null, false, false); + + validateGlossaryTermElements(testCaseName, + activityName, + "RetrieveTermsByGlossary", + glossaryTermList, + glossaryTermGUID, + typeName, + qualifiedName, + displayName, + description, + extendedProperties, + status); + + glossaryTermList = client.getTermsForGlossary(userId, glossaryGUID, 0, 0, null, false, false); + + validateGlossaryTermElements(testCaseName, + activityName, + "RetrieveTermsByGlossary", + glossaryTermList, + glossaryTermGUID, + typeName, + qualifiedName, + displayName, + description, + extendedProperties, + status); + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } +} diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/execution/AssetManagerOMASCreateGlossaryIT.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/execution/AssetManagerOMASCreateGlossaryIT.java index dde57876962..667cbfa5c9f 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/execution/AssetManagerOMASCreateGlossaryIT.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-manager-fvt/src/test/java/org/odpi/openmetadata/accessservices/assetmanager/fvt/execution/AssetManagerOMASCreateGlossaryIT.java @@ -6,7 +6,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.apache.commons.lang3.StringUtils; -import org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries.CreateGlossaryTest; +import org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries.CreateExchangeGlossaryTest; +import org.odpi.openmetadata.accessservices.assetmanager.fvt.glossaries.CreateManagementGlossaryTest; import org.odpi.openmetadata.fvt.utilities.FVTConstants; import org.odpi.openmetadata.fvt.utilities.FVTResults; import org.odpi.openmetadata.http.HttpHelper; @@ -14,7 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * AssetManagerOMASCreateGlossaryIT is the failsafe wrapper for CreateGlossaryTest. + * AssetManagerOMASCreateGlossaryIT is the failsafe wrapper for CreateExchangeGlossaryTest and CreateManagementGlossaryTest. */ public class AssetManagerOMASCreateGlossaryIT { @@ -25,9 +26,19 @@ public static void disableStrictSSL(){ @ParameterizedTest @ValueSource(strings = {FVTConstants.IN_MEMORY_SERVER}) - public void testGlossary(String serverName) + public void testExchangeGlossary(String serverName) { - FVTResults results = CreateGlossaryTest.performFVT(serverName, StringUtils.defaultIfEmpty(System.getProperty("fvt.url"),FVTConstants.SERVER_PLATFORM_URL_ROOT), FVTConstants.USERID); + FVTResults results = CreateExchangeGlossaryTest.performFVT(serverName, StringUtils.defaultIfEmpty(System.getProperty("fvt.url"), FVTConstants.SERVER_PLATFORM_URL_ROOT), FVTConstants.USERID); + + results.printResults(serverName); + assertTrue(results.isSuccessful()); + } + + @ParameterizedTest + @ValueSource(strings = {FVTConstants.IN_MEMORY_SERVER}) + public void testManagementGlossary(String serverName) + { + FVTResults results = CreateManagementGlossaryTest.performFVT(serverName, StringUtils.defaultIfEmpty(System.getProperty("fvt.url"), FVTConstants.SERVER_PLATFORM_URL_ROOT), FVTConstants.USERID); results.printResults(serverName); assertTrue(results.isSuccessful());