From cf69a97eb81b16abc8400c00c2f0f31eec8cb597 Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Thu, 23 Mar 2023 09:14:01 +0000 Subject: [PATCH 1/2] Extend reference data value relationship Signed-off-by: Mandy Chessell --- .../properties/GlossaryProperties.java | 4 +- .../ReferenceValueAssignmentProperties.java | 38 +++- .../server/ValidValuesRESTServices.java | 2 + .../ReferenceValueAssignmentProperties.java | 38 +++- .../server/ValidValuesRESTServices.java | 2 + .../api/ManageReferenceData.java | 19 +- .../ReferenceValueAssignmentProperties.java | 38 +++- .../client/ReferenceDataManager.java | 25 +-- ...nceValueAssignmentDefinitionConverter.java | 1 + ...ReferenceValueAssignmentItemConverter.java | 1 + .../server/ReferenceDataRESTServices.java | 5 +- .../mappers/entities/GlossaryMapper.java | 2 +- .../OpenMetadataAPIGenericConverter.java | 22 ++ .../OpenMetadataAPIMapper.java | 3 +- .../generichandlers/ValidValuesHandler.java | 8 + .../OpenMetadataGlossarySecurity.java | 116 ++++++++++ .../metadatasecurity/properties/Asset.java | 4 +- .../properties/AssetAuditHeader.java | 4 +- .../ConfidenceGovernanceClassification.java | 4 +- ...nfidentialityGovernanceClassification.java | 4 +- .../properties/Connection.java | 4 +- .../CriticalityGovernanceClassification.java | 4 +- .../metadatasecurity/properties/Glossary.java | 208 ++++++++++++++++++ .../GovernanceClassificationBase.java | 4 +- .../GovernanceClassificationStatus.java | 8 +- .../ImpactGovernanceClassification.java | 4 +- .../properties/Referenceable.java | 4 +- .../properties/ReferenceableStatus.java | 8 +- .../RetentionGovernanceClassification.java | 4 +- .../opentypes/OpenMetadataTypesArchive.java | 116 ++++++++++ 30 files changed, 641 insertions(+), 63 deletions(-) create mode 100644 open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/OpenMetadataGlossarySecurity.java create mode 100644 open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Glossary.java diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryProperties.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryProperties.java index 3b3fccc1bb6..556c96ac1c2 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryProperties.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-api/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/properties/GlossaryProperties.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 GlossaryProperties 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/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java index 6448aadbb62..8e9ad002828 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ReferenceValueAssignmentProperties.java @@ -8,6 +8,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,8 +24,10 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ReferenceValueAssignmentProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; + private String attributeName = null; private int confidence = 0; private String steward = null; private String stewardTypeName = null; @@ -51,6 +54,7 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem if (template != null) { + attributeName = template.getAttributeName(); confidence = template.getConfidence(); steward = template.getSteward(); stewardTypeName = template.getStewardTypeName(); @@ -60,6 +64,28 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem } + /** + * Return the name of the attribute that this reference data value represents. + * + * @return string + */ + public String getAttributeName() + { + return attributeName; + } + + + /** + * Set up the name of the attribute that this reference data value represents. + * + * @param attributeName string + */ + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + /** * Return the confidence level (0-100) that the mapping is correct. * @@ -180,6 +206,7 @@ public String toString() { return "ReferenceValueAssignmentProperties{" + "confidence=" + confidence + + ", attributeName='" + attributeName + '\'' + ", steward='" + steward + '\'' + ", stewardTypeName='" + stewardTypeName + '\'' + ", stewardPropertyName='" + stewardPropertyName + '\'' + @@ -213,9 +240,12 @@ public boolean equals(Object objectToCompare) return false; } ReferenceValueAssignmentProperties that = (ReferenceValueAssignmentProperties) objectToCompare; - return confidence == that.confidence && Objects.equals(steward, that.steward) && Objects.equals(stewardTypeName, - that.stewardTypeName) && Objects.equals( - stewardPropertyName, that.stewardPropertyName) && Objects.equals(notes, that.notes); + return confidence == that.confidence && + Objects.equals(attributeName, that.attributeName) && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(stewardPropertyName, that.stewardPropertyName) && + Objects.equals(notes, that.notes); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java index dc11a887cec..19c49c6b92d 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/ValidValuesRESTServices.java @@ -575,6 +575,7 @@ public VoidResponse setupReferenceValueTag(String serverName, requestBody.getExternalSourceName(), validValueGUID, elementGUID, + properties.getAttributeName(), properties.getConfidence(), properties.getSteward(), properties.getStewardTypeName(), @@ -594,6 +595,7 @@ else if (requestBody.getProperties() == null) requestBody.getExternalSourceName(), validValueGUID, elementGUID, + null, 100, null, null, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java index d9ca315e1f6..b8f27aaa82b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReferenceValueAssignmentProperties.java @@ -8,6 +8,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; @@ -22,8 +23,10 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ReferenceValueAssignmentProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; + private String attributeName = null; private int confidence = 0; private String steward = null; private String stewardTypeName = null; @@ -50,6 +53,7 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem if (template != null) { + attributeName = template.getAttributeName(); confidence = template.getConfidence(); steward = template.getSteward(); stewardTypeName = template.getStewardTypeName(); @@ -59,6 +63,28 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem } + /** + * Return the name of the attribute that this reference data value represents. + * + * @return string + */ + public String getAttributeName() + { + return attributeName; + } + + + /** + * Set up the name of the attribute that this reference data value represents. + * + * @param attributeName string + */ + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + /** * Return the confidence level (0-100) that the mapping is correct. * @@ -179,6 +205,7 @@ public String toString() { return "ReferenceValueAssignmentProperties{" + "confidence=" + confidence + + ", attributeName='" + attributeName + '\'' + ", steward='" + steward + '\'' + ", stewardTypeName='" + stewardTypeName + '\'' + ", stewardPropertyName='" + stewardPropertyName + '\'' + @@ -212,9 +239,12 @@ public boolean equals(Object objectToCompare) return false; } ReferenceValueAssignmentProperties that = (ReferenceValueAssignmentProperties) objectToCompare; - return confidence == that.confidence && Objects.equals(steward, that.steward) && Objects.equals(stewardTypeName, - that.stewardTypeName) && Objects.equals( - stewardPropertyName, that.stewardPropertyName) && Objects.equals(notes, that.notes); + return confidence == that.confidence && + Objects.equals(attributeName, that.attributeName) && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(stewardPropertyName, that.stewardPropertyName) && + Objects.equals(notes, that.notes); } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java index 649acdf4ed8..1ea5e70de64 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/ValidValuesRESTServices.java @@ -575,6 +575,7 @@ public VoidResponse setupReferenceValueTag(String serverName, requestBody.getExternalSourceName(), validValueGUID, elementGUID, + properties.getAttributeName(), properties.getConfidence(), properties.getSteward(), properties.getStewardTypeName(), @@ -594,6 +595,7 @@ else if (requestBody.getProperties() == null) requestBody.getExternalSourceName(), validValueGUID, elementGUID, + null, 100, null, null, diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java index 6c47fb729df..47c9625f5e6 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/api/ManageReferenceData.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.accessservices.digitalarchitecture.api; import org.odpi.openmetadata.accessservices.digitalarchitecture.metadataelements.*; +import org.odpi.openmetadata.accessservices.digitalarchitecture.properties.ReferenceValueAssignmentProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; @@ -312,22 +313,18 @@ void unassignValidValueFromConsumer(String userId, * @param userId calling user. * @param validValueGUID unique identifier of the valid value. * @param referenceableGUID unique identifier of the element to link to. - * @param confidence how confident is the steward that this mapping is correct (0-100). - * @param steward identifier of steward - * @param notes additional notes from the steward + * @param properties details of the relationship * * @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. */ - void assignReferenceValueToItem(String userId, - String validValueGUID, - String referenceableGUID, - int confidence, - String steward, - String notes) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + void assignReferenceValueToItem(String userId, + String validValueGUID, + String referenceableGUID, + ReferenceValueAssignmentProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java index a002a7eaa9e..6173df141fd 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-api/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/properties/ReferenceValueAssignmentProperties.java @@ -8,6 +8,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; @@ -22,8 +23,10 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ReferenceValueAssignmentProperties extends RelationshipProperties { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; + private String attributeName = null; private int confidence = 0; private String steward = null; private String stewardTypeName = null; @@ -50,6 +53,7 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem if (template != null) { + attributeName = template.getAttributeName(); confidence = template.getConfidence(); steward = template.getSteward(); stewardTypeName = template.getStewardTypeName(); @@ -59,6 +63,28 @@ public ReferenceValueAssignmentProperties(ReferenceValueAssignmentProperties tem } + /** + * Return the name of the attribute that this reference data value represents. + * + * @return string + */ + public String getAttributeName() + { + return attributeName; + } + + + /** + * Set up the name of the attribute that this reference data value represents. + * + * @param attributeName string + */ + public void setAttributeName(String attributeName) + { + this.attributeName = attributeName; + } + + /** * Return the confidence level (0-100) that the mapping is correct. * @@ -179,6 +205,7 @@ public String toString() { return "ReferenceValueAssignmentProperties{" + "confidence=" + confidence + + ", attributeName='" + attributeName + '\'' + ", steward='" + steward + '\'' + ", stewardTypeName='" + stewardTypeName + '\'' + ", stewardPropertyName='" + stewardPropertyName + '\'' + @@ -212,9 +239,12 @@ public boolean equals(Object objectToCompare) return false; } ReferenceValueAssignmentProperties that = (ReferenceValueAssignmentProperties) objectToCompare; - return confidence == that.confidence && Objects.equals(steward, that.steward) && Objects.equals(stewardTypeName, - that.stewardTypeName) && Objects.equals( - stewardPropertyName, that.stewardPropertyName) && Objects.equals(notes, that.notes); + return confidence == that.confidence && + Objects.equals(attributeName, that.attributeName) && + Objects.equals(steward, that.steward) && + Objects.equals(stewardTypeName, that.stewardTypeName) && + Objects.equals(stewardPropertyName, that.stewardPropertyName) && + Objects.equals(notes, that.notes); } diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java index e0e2837b2c7..2ad76c823fa 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java @@ -696,23 +696,19 @@ public void unassignValidValueFromConsumer(String userId, * @param userId calling user. * @param validValueGUID unique identifier of the valid value. * @param referenceableGUID unique identifier of the element to link to. - * @param confidence how confident is the steward that this mapping is correct (0-100). - * @param steward identifier of steward - * @param notes additional notes from the steward + * @param properties properties for the relationship * * @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. */ @Override - public void assignReferenceValueToItem(String userId, - String validValueGUID, - String referenceableGUID, - int confidence, - String steward, - String notes) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public void assignReferenceValueToItem(String userId, + String validValueGUID, + String referenceableGUID, + ReferenceValueAssignmentProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String methodName = "assignReferenceValueToItem"; final String validValueGUIDParameter = "validValueGUID"; @@ -724,14 +720,9 @@ public void assignReferenceValueToItem(String userId, final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/reference-values/{2}/items/{3}"; - ReferenceValueAssignmentProperties requestBody = new ReferenceValueAssignmentProperties(); - requestBody.setConfidence(confidence); - requestBody.setSteward(steward); - requestBody.setNotes(notes); - restClient.callVoidPostRESTCall(methodName, urlTemplate, - requestBody, + properties, serverName, userId, validValueGUID, diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java index a6c337a1342..56b6f54cc9d 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentDefinitionConverter.java @@ -72,6 +72,7 @@ public B getNewBean(Class beanClass, { InstanceProperties instanceProperties = relationship.getProperties(); + bean.setAttributeName(this.getAttributeName(instanceProperties)); bean.setConfidence(this.getConfidence(instanceProperties)); bean.setSteward(this.getSteward(instanceProperties)); bean.setStewardTypeName(this.getStewardTypeName(instanceProperties)); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java index f91310e6b0b..f461f12f8cb 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/converters/ReferenceValueAssignmentItemConverter.java @@ -92,6 +92,7 @@ public B getNewBean(Class beanClass, { instanceProperties = relationship.getProperties(); + bean.setAttributeName(this.getAttributeName(instanceProperties)); bean.setConfidence(this.getConfidence(instanceProperties)); bean.setSteward(this.getSteward(instanceProperties)); bean.setStewardTypeName(this.getStewardTypeName(instanceProperties)); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java index c58736459e3..c0a01f4d13b 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-server/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/server/ReferenceDataRESTServices.java @@ -23,7 +23,7 @@ * ReferenceDataRESTServices provides the API operations to create and maintain lists of valid * value definitions grouped into a valid value set. Both valid value definitions and valid value sets have * the same attributes and so inherit from ValidValue where all the attributes are defined. - * + *

* A set is just grouping of valid values. Valid value definitions and set can be nested many times in other * valid value sets. */ @@ -871,6 +871,7 @@ public VoidResponse assignReferenceValueToItem(String VoidResponse response = new VoidResponse(); AuditLog auditLog = null; int confidence = 0; + String attributeName = null; String steward = null; String stewardTypeName = null; String stewardPropertyName = null; @@ -878,6 +879,7 @@ public VoidResponse assignReferenceValueToItem(String if (requestBody != null) { + attributeName = requestBody.getAttributeName(); confidence = requestBody.getConfidence(); steward = requestBody.getSteward(); stewardTypeName = requestBody.getStewardTypeName(); @@ -903,6 +905,7 @@ public VoidResponse assignReferenceValueToItem(String null, validValueGUID, referenceableGUID, + attributeName, confidence, steward, stewardTypeName, diff --git a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/server/mappers/entities/GlossaryMapper.java b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/server/mappers/entities/GlossaryMapper.java index 1bd7d528fb5..7a2d6d15234 100644 --- a/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/server/mappers/entities/GlossaryMapper.java +++ b/open-metadata-implementation/access-services/subject-area/subject-area-server/src/main/java/org/odpi/openmetadata/accessservices/subjectarea/server/mappers/entities/GlossaryMapper.java @@ -141,7 +141,7 @@ protected void mapNodeToInstanceProperties(Glossary node, InstanceProperties ins SubjectAreaUtils.setStringPropertyInInstanceProperties(instanceProperties, glossary.getUsage(), OpenMetadataAPIMapper.USAGE_PROPERTY_NAME); } if (node.getName() != null) { - SubjectAreaUtils.setStringPropertyInInstanceProperties(instanceProperties, node.getName(), OpenMetadataAPIMapper.ATTRIBUTE_NAME_PROPERTY_NAME); + SubjectAreaUtils.setStringPropertyInInstanceProperties(instanceProperties, node.getName(), OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME); } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java index 3d53f9e344d..436d501bac3 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericConverter.java @@ -6163,6 +6163,28 @@ protected String getNotes(InstanceProperties instanceProperties) } + /** + * Extract the "attributeName" property from the supplied instance properties. + * + * @param instanceProperties properties from ReferenceValueAssignment relationship + * @return string text or null + */ + protected String getAttributeName(InstanceProperties instanceProperties) + { + final String methodName = "getAttributeName"; + + if (instanceProperties != null) + { + return repositoryHelper.getStringProperty(serviceName, + OpenMetadataAPIMapper.ATTRIBUTE_NAME_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + /** * Extract the pointType property from the supplied instance properties. * diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java index a9931fd0e43..021cc2cd762 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIMapper.java @@ -1445,6 +1445,7 @@ public class OpenMetadataAPIMapper public static final String IMPLEMENTATION_DESCRIPTION_PROPERTY_NAME = "implementationDescription"; /* from GovernanceControl entity */ public static final String NAME_PATTERN_PROPERTY_NAME = "namePattern"; /* from NamingStandardRule entity */ public static final String NOTES_PROPERTY_NAME = "notes"; /* from multiple entities */ + public static final String ATTRIBUTE_NAME_PROPERTY_NAME = "attributeName"; /* from ReferenceValueAssignment relationship */ public static final String RATIONALE_PROPERTY_NAME = "rationale"; /* from GovernanceResponse, GovernanceImplementation relationship */ public static final String GOVERNANCE_PROJECT_CLASSIFICATION_TYPE_GUID = "37142317-4125-4046-9514-71dc5031563f"; @@ -2079,8 +2080,6 @@ public class OpenMetadataAPIMapper public static final String SCHEMA_ATTRIBUTE_TYPE_NAME = "SchemaAttribute"; /* SchemaElement */ - public static final String ATTRIBUTE_NAME_PROPERTY_NAME = "displayName"; /* from SchemaAttribute entity */ - public static final String OLD_ATTRIBUTE_NAME_PROPERTY_NAME = "name"; /* from SchemaAttribute entity */ public static final String ELEMENT_POSITION_PROPERTY_NAME = "position"; /* from SchemaAttribute entity */ public static final String CARDINALITY_PROPERTY_NAME = "cardinality"; /* from SchemaAttribute entity */ public static final String MAX_CARDINALITY_PROPERTY_NAME = "maxCardinality"; /* from SchemaAttribute entity */ diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java index a5ff60208c3..05ecf51b9da 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ValidValuesHandler.java @@ -807,6 +807,7 @@ public void unassignValidValueFromConsumer(String userId, * @param externalSourceName name of the software capability entity that represented the external source * @param validValueGUID unique identifier of the valid value. * @param referenceableGUID unique identifier of the element to link to. + * @param attributeName name of the attribute that this relationship represents * @param confidence how confident is the steward that this mapping is correct (0-100). * @param steward identifier of steward * @param stewardTypeName type of element that represents steward @@ -827,6 +828,7 @@ public void assignReferenceValueToItem(String userId, String externalSourceName, String validValueGUID, String referenceableGUID, + String attributeName, int confidence, String steward, String stewardTypeName, @@ -854,6 +856,12 @@ public void assignReferenceValueToItem(String userId, confidence, methodName); + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, + relationshipProperties, + OpenMetadataAPIMapper.ATTRIBUTE_NAME_PROPERTY_NAME, + attributeName, + methodName); + relationshipProperties = repositoryHelper.addStringPropertyToInstance(serviceName, relationshipProperties, OpenMetadataAPIMapper.STEWARD_PROPERTY_NAME, diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/OpenMetadataGlossarySecurity.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/OpenMetadataGlossarySecurity.java new file mode 100644 index 00000000000..f860b08ca0e --- /dev/null +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/OpenMetadataGlossarySecurity.java @@ -0,0 +1,116 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.metadatasecurity; + +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.metadatasecurity.properties.Glossary; + + +/** + * OpenMetadataGlossarySecurity assures the access to glossary content. + * Glossary categories and terms are anchored to a single glossary. + * Glossary terms may be linked to multiple categories, some in different glossaries. + * This interface allows the security connector to control whether a user can: + * + *

    + *
  • Create a new glossary.
  • + *
  • Update the properties of a glossary.
  • + *
  • Delete a glossary and all of its anchored contents.
  • + *
  • Read glossary terms and categories linked to a glossary.
  • + *
  • Create new terms and categories within (ie anchored to) the glossary.
  • + *
  • Create new term-to-term relationships with a term within (ie anchored to) the glossary.
  • + *
  • Add feedback to terms and categories within (ie anchored to) the glossary.
  • + *
  • Update terms and categories anchored to the glossary.
  • + *
  • Update instance status of a term anchored to the glossary.
  • + *
  • Update term-to-term relationships with a term within (ie anchored to) the glossary.
  • + *
  • Delete terms and categories anchored to the glossary.
  • + *
  • Delete term-to-term relationships with a term within (ie anchored to) the glossary.
  • + *
  • Link a term to a category that is anchored to the glossary.
  • + *
  • Unlink a term from a category that is anchored to the glossary.
  • + *
+ */ +public interface OpenMetadataGlossarySecurity +{ + /** + * Tests for whether a specific user should have the right to create a glossary. + * + * @param userId identifier of user + * @param glossary new glossary details + * @throws UserNotAuthorizedException the user is not authorized to change this glossary + */ + void validateUserForGlossaryCreate(String userId, + Glossary glossary) throws UserNotAuthorizedException; + + + /** + * Tests for whether a specific user should have read access to a specific glossary and its contents. + * + * @param userId identifier of user + * @param glossary glossary details + * @throws UserNotAuthorizedException the user is not authorized to access this glossary + */ + void validateUserForGlossaryRead(String userId, + Glossary glossary) throws UserNotAuthorizedException; + + + /** + * Tests for whether a specific user should have the right to update the properties of a glossary. + * + * @param userId identifier of user + * @param originalGlossary original glossary details + * @param newGlossary new glossary details + * @throws UserNotAuthorizedException the user is not authorized to change this glossary + */ + void validateUserForGlossaryDetailUpdate(String userId, + Glossary originalGlossary, + Glossary newGlossary) throws UserNotAuthorizedException; + + + /** + * Tests for whether a specific user should have the right to update elements attached directly + * to a glossary such as glossary terms and categories. These updates could be to their properties, + * classifications and relationships. It also includes attaching valid values but not semantic assignments + * since they are considered updates to the associated asset. + * + * @param userId identifier of user + * @param glossary glossary details + * @throws UserNotAuthorizedException the user is not authorized to change this glossary + */ + void validateUserForGlossaryMemberUpdate(String userId, + Glossary glossary) throws UserNotAuthorizedException; + + + /** + * Tests for whether a specific user should have the right to update the instance status of a term + * anchored in a glossary. + * + * @param userId identifier of user + * @param glossary glossary details + * @throws UserNotAuthorizedException the user is not authorized to change this glossary + */ + void validateUserForGlossaryMemberStatusUpdate(String userId, + Glossary glossary) throws UserNotAuthorizedException; + + + /** + * Tests for whether a specific user should have the right to attach feedback - such as comments, + * ratings, tags and likes, to the glossary. + * + * @param userId identifier of user + * @param glossary original glossary details + * @throws UserNotAuthorizedException the user is not authorized to change this glossary + */ + void validateUserForGlossaryFeedback(String userId, + Glossary glossary) throws UserNotAuthorizedException; + + + /** + * Tests for whether a specific user should have the right to delete a glossary and all of its contents. + * + * @param userId identifier of user + * @param glossary original glossary details + * @throws UserNotAuthorizedException the user is not authorized to change this glossary + */ + void validateUserForGlossaryDelete(String userId, + Glossary glossary) throws UserNotAuthorizedException; +} 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 9e7412f9a60..9ce30b68bd9 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 @@ -3,6 +3,7 @@ package org.odpi.openmetadata.metadatasecurity.properties; +import java.io.Serial; import java.util.*; /** @@ -11,7 +12,8 @@ */ public class Asset extends Referenceable { - 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/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/AssetAuditHeader.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/AssetAuditHeader.java index 5e6accbabf1..6ae953dcbdd 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/AssetAuditHeader.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/AssetAuditHeader.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.ArrayList; import java.util.Date; @@ -24,7 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class AssetAuditHeader implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String createdBy = null; private String updatedBy = null; diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidenceGovernanceClassification.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidenceGovernanceClassification.java index d5d529ba49e..185ad0b7c01 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidenceGovernanceClassification.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidenceGovernanceClassification.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 ConfidenceGovernanceClassification extends GovernanceClassificationBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int confidenceLevel = 0; diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidentialityGovernanceClassification.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidentialityGovernanceClassification.java index f305b517da7..5af03a30731 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidentialityGovernanceClassification.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ConfidentialityGovernanceClassification.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 ConfidentialityGovernanceClassification extends GovernanceClassificationBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int confidentialityLevel = 0; diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Connection.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Connection.java index 1a2bb302ace..9ce2a9deb94 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Connection.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Connection.java @@ -3,6 +3,7 @@ package org.odpi.openmetadata.metadatasecurity.properties; +import java.io.Serial; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -13,7 +14,8 @@ */ public class Connection extends Referenceable { - 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/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/CriticalityGovernanceClassification.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/CriticalityGovernanceClassification.java index 80360748aba..b5f986eade2 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/CriticalityGovernanceClassification.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/CriticalityGovernanceClassification.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 CriticalityGovernanceClassification extends GovernanceClassificationBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int criticalityLevel = 0; 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 new file mode 100644 index 00000000000..bd577391821 --- /dev/null +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/Glossary.java @@ -0,0 +1,208 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.metadatasecurity.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; + +/** + * GlossaryProperties is a class for representing a generic glossary. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class Glossary extends Referenceable +{ + @Serial + private static final long serialVersionUID = 1L; + + private String displayName = null; + private String description = null; + private String language = null; + private String usage = null; + + /** + * Default constructor + */ + public Glossary() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public Glossary(Glossary template) + { + super(template); + + if (template != null) + { + displayName = template.getDisplayName(); + description = template.getDescription(); + language = template.getLanguage(); + usage = template.getUsage(); + } + } + + + /** + * Return a human memorable name for the glossary. + * + * @return string name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up a human memorable name for the glossary. + * + * @param displayName string name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Return the description of the glossary. + * + * @return string text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the description of the glossary. + * + * @param description string text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the language that the glossary contents are written in. + * + * @return string name + */ + public String getLanguage() + { + return language; + } + + + /** + * Set up the language that the glossary contents are written in. + * + * @param language string name + */ + public void setLanguage(String language) + { + this.language = language; + } + + + /** + * Return the expected usage of the glossary content. + * + * @return string description + */ + public String getUsage() + { + return usage; + } + + + /** + * Set up the expected usage of the glossary content. + * + * @param usage string description + */ + public void setUsage(String usage) + { + this.usage = usage; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "GlossaryProperties{" + + "displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", language='" + language + '\'' + + ", usage='" + usage + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", typeName='" + getTypeName() + '\'' + + ", 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; + } + Glossary that = (Glossary) objectToCompare; + return Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description) && + Objects.equals(language, that.language) && + Objects.equals(usage, that.usage); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), displayName, description, language, usage); + } +} 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 acd08dc8692..013ef785582 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 @@ -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; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class GovernanceClassificationBase implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int status = 0; private int confidence = 0; 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 8a258b244aa..86aea3220f2 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 @@ -38,11 +38,11 @@ public enum GovernanceClassificationStatus implements Serializable public static final String ENUM_TYPE_GUID = "cc540586-ac7c-41ba-8cc1-4da694a6a8e4"; public static final String ENUM_TYPE_NAME = "GovernanceClassificationStatus"; - private int openTypeOrdinal; + private final int openTypeOrdinal; - private int ordinal; - private String name; - private String description; + private final int ordinal; + private final String name; + private final String description; private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ImpactGovernanceClassification.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ImpactGovernanceClassification.java index 715e59be92f..01a8b125988 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ImpactGovernanceClassification.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ImpactGovernanceClassification.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 ImpactGovernanceClassification extends GovernanceClassificationBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int impactSeverityLevel = 0; 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 5ff9cf0ea87..09ff2495b02 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 @@ -3,6 +3,7 @@ package org.odpi.openmetadata.metadatasecurity.properties; +import java.io.Serial; import java.io.Serializable; import java.util.*; @@ -13,7 +14,8 @@ */ public class Referenceable implements Serializable { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private String typeGUID = null; private String typeName = null; diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ReferenceableStatus.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ReferenceableStatus.java index 4c7801d8bbe..ad0b99e422f 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ReferenceableStatus.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/ReferenceableStatus.java @@ -55,10 +55,10 @@ public enum ReferenceableStatus implements Serializable private static final long serialVersionUID = 1L; - private int ordinal; - private int omrsOrdinal; - private String name; - private String description; + private final int ordinal; + private final int omrsOrdinal; + private final String name; + private final String description; /** diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/RetentionGovernanceClassification.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/RetentionGovernanceClassification.java index f7ce7f847e9..a9dd0b97279 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/RetentionGovernanceClassification.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-apis/src/main/java/org/odpi/openmetadata/metadatasecurity/properties/RetentionGovernanceClassification.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.Objects; @@ -21,7 +22,8 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class RetentionGovernanceClassification extends GovernanceClassificationBase { - private static final long serialVersionUID = 1L; + @Serial + private static final long serialVersionUID = 1L; private int retentionBasis = 0; private String associatedGUID = null; diff --git a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java index 93f480d6ca6..8f38c8836a7 100644 --- a/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java +++ b/open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/org/odpi/openmetadata/opentypes/OpenMetadataTypesArchive.java @@ -174,6 +174,7 @@ public void getOriginalTypes() create0464DynamicIntegrationGroups(); update0470IncidentClassifierSet(); update0484AgreementActor(); + update0545ReferenceData(); update0720InformationSupplyChains(); addFormulaTypeAttribute(); } @@ -185,6 +186,7 @@ public void getOriginalTypes() private void update0385ControlledGlossaries() { this.archiveBuilder.addTypeDefPatch(updateControlledGlossaryTermEntity()); + this.archiveBuilder.addRelationshipDef(addGlossaryTermEvolutionRelationship()); } @@ -237,6 +239,78 @@ private TypeDefPatch updateControlledGlossaryTermEntity() return typeDefPatch; } + + private RelationshipDef addGlossaryTermEvolutionRelationship() + { + final String guid = "b323c9cf-f254-49c7-a391-11222e9da70f"; + final String name = "GlossaryTermEvolution"; + final String description = "Links a live glossary term with a future version of ."; + final String descriptionGUID = null; + + final ClassificationPropagationRule classificationPropagationRule = ClassificationPropagationRule.NONE; + + RelationshipDef relationshipDef = archiveHelper.getBasicRelationshipDef(guid, + name, + null, + description, + descriptionGUID, + classificationPropagationRule); + + RelationshipEndDef relationshipEndDef; + + /* + * Set up end 1. + */ + final String end1EntityType = "ControlledGlossaryTerm"; + final String end1AttributeName = "glossaryTermUpdates"; + final String end1AttributeDescription = "A glossary term that contains proposed updates to the live glossary term."; + final String end1AttributeDescriptionGUID = null; + final RelationshipEndCardinality end1Cardinality = RelationshipEndCardinality.ANY_NUMBER; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end1EntityType), + end1AttributeName, + end1AttributeDescription, + end1AttributeDescriptionGUID, + end1Cardinality); + relationshipDef.setEndDef1(relationshipEndDef); + + + /* + * Set up end 2. + */ + final String end2EntityType = "GlossaryTerm"; + final String end2AttributeName = "liveGlossaryTerm"; + final String end2AttributeDescription = "The approved term that is in use."; + final String end2AttributeDescriptionGUID = null; + final RelationshipEndCardinality end2Cardinality = RelationshipEndCardinality.AT_MOST_ONE; + + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(end2EntityType), + end2AttributeName, + end2AttributeDescription, + end2AttributeDescriptionGUID, + end2Cardinality); + relationshipDef.setEndDef2(relationshipEndDef); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "description"; + final String attribute1Description = "Short description of the update."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + relationshipDef.setPropertiesDefinition(properties); + + return relationshipDef; + } + /* * ------------------------------------------------------------------------------------------------------- */ @@ -1097,6 +1171,48 @@ private RelationshipDef addRelatedIntegrationReportRelationship() return relationshipDef; } + /* + * ------------------------------------------------------------------------------------------------------- + */ + + private void update0545ReferenceData() + { + this.archiveBuilder.addTypeDefPatch(updateReferenceValueAssignment()); + } + + + private TypeDefPatch updateReferenceValueAssignment() + { + /* + * Create the Patch + */ + final String typeName = "ReferenceValueAssignment"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "attributeName"; + final String attribute1Description = "The name of the attribute that the reference data assignment represents."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + /* * ------------------------------------------------------------------------------------------------------- */ From 881d8b16028c59058f9185a7955003382c60e3cc Mon Sep 17 00:00:00 2001 From: Mandy Chessell Date: Thu, 23 Mar 2023 09:59:47 +0000 Subject: [PATCH 2/2] Add in getDatabaseManagerName() Signed-off-by: Mandy Chessell --- .../connector/DatabaseIntegratorContext.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/open-metadata-implementation/integration-services/database-integrator/database-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/database/connector/DatabaseIntegratorContext.java b/open-metadata-implementation/integration-services/database-integrator/database-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/database/connector/DatabaseIntegratorContext.java index f7fdc8e9d36..ee2fab6e44d 100644 --- a/open-metadata-implementation/integration-services/database-integrator/database-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/database/connector/DatabaseIntegratorContext.java +++ b/open-metadata-implementation/integration-services/database-integrator/database-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/database/connector/DatabaseIntegratorContext.java @@ -86,6 +86,22 @@ public DatabaseIntegratorContext(String connectorId, this.validValueManagement = validValueManagement; } + /* ======================================================== + * Returning the database manager name from the configuration + */ + + + /** + * Return the qualified name of the database manager that is supplied in the configuration + * document. + * + * @return string name + */ + public String getDatabaseManagerName() + { + return externalSourceName; + } + /* ======================================================== * Register for inbound events from the Data Manager OMAS OutTopic