diff --git a/open-metadata-distribution/open-metadata-assemblies/build.gradle b/open-metadata-distribution/open-metadata-assemblies/build.gradle index faed7a39290..6ab44f2027e 100644 --- a/open-metadata-distribution/open-metadata-assemblies/build.gradle +++ b/open-metadata-distribution/open-metadata-assemblies/build.gradle @@ -66,6 +66,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:data-privacy:data-privacy-client') implementation project(':open-metadata-implementation:access-services:dev-ops:dev-ops-client') implementation project(':open-metadata-implementation:access-services:digital-architecture:digital-architecture-client') + implementation project(':open-metadata-implementation:access-services:digital-service:digital-service-client') implementation project(':open-metadata-implementation:access-services:discovery-engine:discovery-engine-client') implementation project(':open-metadata-implementation:access-services:governance-engine:governance-engine-client') implementation project(':open-metadata-implementation:access-services:governance-program:governance-program-client') diff --git a/open-metadata-distribution/open-metadata-assemblies/pom.xml b/open-metadata-distribution/open-metadata-assemblies/pom.xml index dcd3f27c1ad..229ce624a17 100644 --- a/open-metadata-distribution/open-metadata-assemblies/pom.xml +++ b/open-metadata-distribution/open-metadata-assemblies/pom.xml @@ -238,6 +238,10 @@ org.odpi.egeria digital-architecture-client + + org.odpi.egeria + digital-service-client + org.odpi.egeria discovery-engine-client diff --git a/open-metadata-distribution/open-metadata-packages/open-metadata-client-package/pom.xml b/open-metadata-distribution/open-metadata-packages/open-metadata-client-package/pom.xml index fe5f1aac1d0..d8a8df961f8 100644 --- a/open-metadata-distribution/open-metadata-packages/open-metadata-client-package/pom.xml +++ b/open-metadata-distribution/open-metadata-packages/open-metadata-client-package/pom.xml @@ -63,6 +63,10 @@ org.odpi.egeria digital-architecture-client + + org.odpi.egeria + digital-service-client + org.odpi.egeria it-infrastructure-client diff --git a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/AnalyticsArtifactHandler.java b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/AnalyticsArtifactHandler.java index fee03cf2aef..4c068d3887f 100644 --- a/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/AnalyticsArtifactHandler.java +++ b/open-metadata-implementation/access-services/analytics-modeling/analytics-modeling-server/src/main/java/org/odpi/openmetadata/accessservices/analyticsmodeling/synchronization/AnalyticsArtifactHandler.java @@ -256,7 +256,7 @@ private String createAssetEntity(AnalyticsAsset asset, boolean bModuleAsset) asset.setQualifiedName(qualifiedName); String assetGUID = assetHandler.createAssetInRepository(ctx.getUserId(), ssc.getGUID(), ssc.getSource(), - qualifiedName, asset.getDisplayName(), + qualifiedName, asset.getDisplayName(), null, asset.getDescription(), ctx.getSupportedZones(), // zoneMembership, null, // owner @@ -1127,7 +1127,7 @@ private boolean updateAssetAttributes(AnalyticsAsset asset, boolean bModuleAsset if (!asset.equals(assetRepo)) { assetHandler.updateAsset(ctx.getUserId(), ssc.getGUID(), ssc.getSource(), asset.getGuid(), Constants.PARAM_NAME_ASSET_GUID, - asset.getQualifiedName(), asset.getDisplayName(), asset.getDescription(), + asset.getQualifiedName(), asset.getDisplayName(), null, asset.getDescription(), AnalyticsAssetUtils.buildAdditionalProperties(asset), assetTypeGuid, assetTypeName, null, null,null, false, false, false, new Date(), methodName); return true; diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerAssetInterface.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerAssetInterface.java index cf7d8223813..ee11c448ca0 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerAssetInterface.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerAssetInterface.java @@ -23,7 +23,7 @@ public interface AssetConsumerAssetInterface * @param startFrom starting element (used in paging through large result sets) * @param pageSize maximum number of results to return * - * @return list of assets that match the search string. + * @return list of unique identifiers (GUIDs) for the matching assets * * @throws InvalidParameterException the searchString is invalid * @throws PropertyServerException there is a problem access in the property server @@ -45,7 +45,7 @@ List findAssets(String userId, * @param startFrom starting element (used in paging through large result sets) * @param pageSize maximum number of results to return * - * @return list of unique identifiers of assets with matching name. + * @return list of unique identifiers (GUIDs) of assets with matching name. * * @throws InvalidParameterException the name is invalid * @throws PropertyServerException there is a problem access in the property server @@ -67,7 +67,7 @@ List getAssetsByName(String userId, * @param startFrom starting element (used in paging through large result sets) * @param pageSize maximum number of results to return * - * @return a list of unique identifiers for the matching assets + * @return a list of unique identifiers (GUIDs) for the matching assets * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). @@ -87,7 +87,7 @@ List getAssetsByToken(String userId, * @param userId the userId of the requesting user. * @param connectionGUID unique identifier for the connection. * - * @return unique identifier of asset. + * @return unique identifier (GUID) of asset. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving information from the property server. @@ -105,7 +105,7 @@ String getAssetForConnection(String userId, * @param userId userId of user making request. * @param connectionName this may be the qualifiedName or displayName of the connection. * - * @return unique identifier of asset. + * @return unique identifier (GUID) of asset. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws PropertyServerException there is a problem retrieving information from the property server(s). diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/AssetProperties.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/AssetProperties.java index be17596aa88..513a3159c3b 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/properties/AssetProperties.java @@ -11,7 +11,7 @@ /** * Asset holds asset properties that are used for displaying details of - * an asset in summary lists or hover text. It includes the following properties: + * an asset in summary lists or hover text. The Asset represents a digital resource. It includes the following properties: *
    *
  • type - metadata type information for the asset
  • *
  • guid - globally unique identifier for the asset
  • @@ -19,11 +19,11 @@ *
  • qualifiedName - The official (unique) name for the asset. This is often defined by the IT systems * management organization and should be used (when available) on audit logs and error messages. * (qualifiedName from Referenceable - model 0010)
  • - *
  • displayName - A consumable name for the asset. Often a shortened form of the assetQualifiedName - * for use on user interfaces and messages. The assetDisplayName should only be used for audit logs and error - * messages if the assetQualifiedName is not set. (Sourced from attribute name within Asset - model 0010)
  • + *
  • name - the name of the digital resource. (Sourced from attribute name within Asset - model 0010)
  • + *
  • versionIdentifier - the version of the digital resource. (Sourced from attribute versionIdentifier within Asset - model 0010)
  • + *
  • displayName - A consumable name for the asset. (Sourced from a linked glossary term - model 0395 - or the name property)
  • *
  • shortDescription - short description about the asset. - * (Sourced from assetSummary within ConnectionsToAsset - model 0205)
  • + * (Sourced from assetSummary property within ConnectionsToAsset - model 0205) *
  • description - full description of the asset. * (Sourced from attribute description within Asset - model 0010)
  • *
  • owner - name of the person or organization that owns the asset. @@ -55,6 +55,8 @@ public class AssetProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String name = null; + private String versionIdentifier = null; private String displayName = null; private String description = null; private String owner = null; @@ -86,6 +88,8 @@ public AssetProperties(AssetProperties template) if (template != null) { + name = template.getName(); + versionIdentifier = template.getVersionIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); owner = template.getOwner(); @@ -100,14 +104,68 @@ public AssetProperties(AssetProperties template) } + /** + * Return the name of the resource that this asset represents. + * + * @return string resource name + */ + public String getName() + { + if (name == null) + { + return displayName; + } + + return name; + } + + + /** + * Set up the name of the resource that this asset represents. + * + * @param name string resource name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored display name property for the asset. - * If no display name is available then null is returned. + * If no display name is available then name is returned. * * @return String name */ public String getDisplayName() { + if (displayName == null) + { + return name; + } + return displayName; } @@ -355,12 +413,14 @@ public void setOtherOriginValues(Map otherOriginValues) public String toString() { return "AssetProperties{" + - "displayName='" + displayName + '\'' + + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", owner='" + owner + '\'' + - ", ownerTypeName=" + ownerTypeName + - ", ownerPropertyName=" + ownerPropertyName+ ", ownerType=" + ownerType + + ", ownerTypeName='" + ownerTypeName + '\'' + + ", ownerPropertyName='" + ownerPropertyName + '\'' + ", zoneMembership=" + zoneMembership + ", originOrganizationGUID='" + originOrganizationGUID + '\'' + ", originBusinessCapabilityGUID='" + originBusinessCapabilityGUID + '\'' + @@ -386,25 +446,63 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(owner, that.owner) && - Objects.equals(ownerTypeName, that.ownerTypeName) && - Objects.equals(ownerPropertyName, that.ownerPropertyName) && - ownerType == that.ownerType && - Objects.equals(zoneMembership, that.zoneMembership) && - Objects.equals(originOrganizationGUID, that.originOrganizationGUID) && - Objects.equals(originBusinessCapabilityGUID, that.originBusinessCapabilityGUID) && - Objects.equals(otherOriginValues, that.otherOriginValues); + + if (name != null ? ! name.equals(that.name) : that.name != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (owner != null ? ! owner.equals(that.owner) : that.owner != null) + { + return false; + } + if (ownerType != that.ownerType) + { + return false; + } + if (ownerTypeName != null ? ! ownerTypeName.equals(that.ownerTypeName) : that.ownerTypeName != null) + { + return false; + } + if (ownerPropertyName != null ? ! ownerPropertyName.equals(that.ownerPropertyName) : that.ownerPropertyName != null) + { + return false; + } + if (zoneMembership != null ? ! zoneMembership.equals(that.zoneMembership) : that.zoneMembership != null) + { + return false; + } + if (originOrganizationGUID != null ? ! originOrganizationGUID.equals(that.originOrganizationGUID) : that.originOrganizationGUID != null) + { + return false; + } + if (originBusinessCapabilityGUID != null ? ! originBusinessCapabilityGUID.equals( + that.originBusinessCapabilityGUID) : that.originBusinessCapabilityGUID != null) + { + return false; + } + return otherOriginValues != null ? otherOriginValues.equals(that.otherOriginValues) : that.otherOriginValues == null; } diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java index 6985fcff0ea..6365bc13c68 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-server/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/converters/AssetConverter.java @@ -75,7 +75,8 @@ public B getNewBean(Class beanClass, assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - assetProperties.setDisplayName(this.removeName(instanceProperties)); + assetProperties.setName(this.removeName(instanceProperties)); + assetProperties.setDisplayName(assetProperties.getName()); assetProperties.setDescription(this.removeDescription(instanceProperties)); /* Note this value should be in the classification */ 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 46b5763bfdb..9621160989b 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 @@ -30,6 +30,7 @@ public class AssetProperties extends SupplementaryProperties private static final long serialVersionUID = 1L; private String technicalName = null; + private String versionIdentifier = null; private String technicalDescription = null; /** @@ -52,6 +53,7 @@ public AssetProperties(AssetProperties template) if (template != null) { technicalName = template.getTechnicalName(); + versionIdentifier = template.getVersionIdentifier(); technicalDescription = template.getTechnicalDescription(); } } @@ -81,6 +83,28 @@ public void setTechnicalName(String technicalName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored technical description property for the asset. * If no technical description is provided then null is returned. @@ -114,12 +138,8 @@ public String toString() { return "AssetProperties{" + "technicalName='" + technicalName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", technicalDescription='" + technicalDescription + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", summary='" + getSummary() + '\'' + - ", description='" + getDescription() + '\'' + - ", abbreviation='" + getAbbreviation() + '\'' + - ", usage='" + getUsage() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + @@ -127,6 +147,11 @@ public String toString() ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", displayName='" + getDisplayName() + '\'' + + ", summary='" + getSummary() + '\'' + + ", description='" + getDescription() + '\'' + + ", abbreviation='" + getAbbreviation() + '\'' + + ", usage='" + getUsage() + '\'' + '}'; } @@ -144,17 +169,17 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(getTechnicalName(), that.getTechnicalName()) && - Objects.equals(getTechnicalDescription(), that.getTechnicalDescription()); + return Objects.equals(technicalName, that.technicalName) && Objects.equals(versionIdentifier, that.versionIdentifier) && Objects.equals( + technicalDescription, that.technicalDescription); } @@ -166,6 +191,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), technicalName, technicalDescription); + return Objects.hash(super.hashCode(), technicalName, versionIdentifier, technicalDescription); } } 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 d638ab1cdfa..1b4643f6a1a 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 @@ -87,14 +87,10 @@ public void setIsReferenceAsset(boolean referenceAsset) public String toString() { return "DataAssetProperties{" + - "isReferenceAsset=" + isReferenceAsset + - ", technicalName='" + getTechnicalName() + '\'' + + "technicalName='" + getTechnicalName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", technicalDescription='" + getTechnicalDescription() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", summary='" + getSummary() + '\'' + - ", description='" + getDescription() + '\'' + - ", abbreviation='" + getAbbreviation() + '\'' + - ", usage='" + getUsage() + '\'' + + ", isReferenceAsset=" + isReferenceAsset + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + @@ -102,6 +98,11 @@ public String toString() ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", displayName='" + getDisplayName() + '\'' + + ", summary='" + getSummary() + '\'' + + ", description='" + getDescription() + '\'' + + ", abbreviation='" + getAbbreviation() + '\'' + + ", usage='" + getUsage() + '\'' + '}'; } 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 666e85e1a76..6cb807f6959 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 @@ -77,6 +77,7 @@ public String toString() { return "DataSetProperties{" + "technicalName='" + getTechnicalName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", technicalDescription='" + getTechnicalDescription() + '\'' + ", isReferenceAsset=" + getIsReferenceAsset() + ", formula='" + formula + '\'' + 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 616e273921e..b9e06502208 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 @@ -255,6 +255,7 @@ public String toString() ", encodingProperties=" + encodingProperties + ", isReferenceAsset=" + getIsReferenceAsset() + ", technicalName='" + getTechnicalName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", technicalDescription='" + getTechnicalDescription() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", summary='" + getSummary() + '\'' + 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 48327be3d03..d65a32e9620 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 @@ -103,6 +103,7 @@ public String toString() ", formula='" + formula + '\'' + ", implementationLanguage='" + implementationLanguage + '\'' + ", technicalName='" + getTechnicalName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", technicalDescription='" + getTechnicalDescription() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", summary='" + getSummary() + '\'' + 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 bed88845c06..99710e789ef 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 @@ -24,10 +24,13 @@ public class TemplateProperties implements Serializable { private static final long serialVersionUID = 1L; - private String qualifiedName = null; - private String displayName = null; - private String description = null; - private String networkAddress = null; + private String qualifiedName = null; + private String displayName = null; + private String versionIdentifier = null; + private String description = null; + private String pathName = null; + private String networkAddress = null; + /** * Default constructor @@ -47,10 +50,12 @@ public TemplateProperties(TemplateProperties template) { if (template != null) { - qualifiedName = template.getQualifiedName(); - displayName = template.getDisplayName(); - description = template.getDescription(); - networkAddress = template.getNetworkAddress(); + qualifiedName = template.getQualifiedName(); + displayName = template.getDisplayName(); + versionIdentifier = template.getVersionIdentifier(); + description = template.getDescription(); + pathName = template.getPathName(); + networkAddress = template.getNetworkAddress(); } } @@ -101,6 +106,28 @@ public void setDisplayName(String displayName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored description property for the metadata entity. * If no description is provided then null is returned. @@ -124,6 +151,28 @@ public void setDescription(String description) } + /** + * Return the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @return string name + */ + public String getPathName() + { + return pathName; + } + + + /** + * Set up the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @param pathName string name + */ + public void setPathName(String pathName) + { + this.pathName = pathName; + } + + /** * Return the physical network address of this metadata element (if this makes sense). * @@ -131,7 +180,7 @@ public void setDescription(String description) */ public String getNetworkAddress() { - return networkAddress; + return pathName; } @@ -142,7 +191,7 @@ public String getNetworkAddress() */ public void setNetworkAddress(String networkAddress) { - this.networkAddress = networkAddress; + this.pathName = networkAddress; } @@ -157,7 +206,9 @@ public String toString() return "TemplateProperties{" + "qualifiedName='" + qualifiedName + '\'' + ", displayName='" + displayName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", description='" + description + '\'' + + ", pathName='" + pathName + '\'' + ", networkAddress='" + networkAddress + '\'' + '}'; } @@ -176,15 +227,34 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TemplateProperties)) { return false; } + TemplateProperties that = (TemplateProperties) objectToCompare; - return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(networkAddress, that.networkAddress); + + if (qualifiedName != null ? ! qualifiedName.equals(that.qualifiedName) : that.qualifiedName != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (pathName != null ? ! pathName.equals(that.pathName) : that.pathName != null) + { + return false; + } + return networkAddress != null ? networkAddress.equals(that.networkAddress) : that.networkAddress == null; } @@ -196,6 +266,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, displayName, description, networkAddress); + return Objects.hash(qualifiedName, displayName, versionIdentifier, description, pathName, networkAddress); } } diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java index 9178fc32cc8..e9d93596c25 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/AssetConverter.java @@ -75,6 +75,7 @@ public B getNewBean(Class beanClass, assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); assetProperties.setTechnicalName(this.removeName(instanceProperties)); + assetProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); assetProperties.setTechnicalDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java index d04903925d2..cd353a54ac9 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/converters/ProcessConverter.java @@ -74,6 +74,7 @@ public B getNewBean(Class beanClass, processProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); processProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); processProperties.setTechnicalName(this.removeName(instanceProperties)); + processProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); processProperties.setTechnicalDescription(this.removeDescription(instanceProperties)); processProperties.setFormula(this.removeFormula(instanceProperties)); 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 49ab97ad302..c232986b3fa 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 @@ -210,6 +210,7 @@ public String createDataAsset(String userId, this.getExternalSourceName(correlationProperties, assetManagerIsHome), assetProperties.getQualifiedName(), assetProperties.getTechnicalName(), + assetProperties.getVersionIdentifier(), assetProperties.getTechnicalDescription(), assetProperties.getAdditionalProperties(), typeName, @@ -294,7 +295,9 @@ public String createDataAssetFromTemplate(String userId, templateProperties.getQualifiedName(), qualifiedNameParameterName, templateProperties.getDisplayName(), + templateProperties.getVersionIdentifier(), templateProperties.getDescription(), + templateProperties.getPathName(), templateProperties.getNetworkAddress(), false, false, @@ -372,6 +375,7 @@ public void updateDataAsset(String userId, assetGUIDParameterName, assetProperties.getQualifiedName(), assetProperties.getTechnicalName(), + assetProperties.getVersionIdentifier(), assetProperties.getTechnicalDescription(), assetProperties.getAdditionalProperties(), OpenMetadataAPIMapper.ASSET_TYPE_GUID, diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ProcessExchangeHandler.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ProcessExchangeHandler.java index a097e77ad4f..be8efeec615 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ProcessExchangeHandler.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-server/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/handlers/ProcessExchangeHandler.java @@ -299,6 +299,7 @@ public String createProcess(String userId, this.getExternalSourceName(correlationProperties, assetManagerIsHome), processProperties.getQualifiedName(), processProperties.getTechnicalName(), + processProperties.getVersionIdentifier(), processProperties.getTechnicalDescription(), processProperties.getFormula(), processProperties.getImplementationLanguage(), @@ -384,6 +385,7 @@ public String createProcessFromTemplate(String userId, templateProperties.getQualifiedName(), qualifiedNameParameterName, templateProperties.getDisplayName(), + templateProperties.getVersionIdentifier(), templateProperties.getDescription(), false, false, @@ -473,12 +475,15 @@ public void updateProcess(String userId, isMergeUpdate, processProperties.getQualifiedName(), processProperties.getTechnicalName(), + processProperties.getVersionIdentifier(), processProperties.getTechnicalDescription(), processProperties.getFormula(), processProperties.getImplementationLanguage(), processProperties.getAdditionalProperties(), typeName, processProperties.getExtendedProperties(), + processProperties.getEffectiveFrom(), + processProperties.getEffectiveTo(), forLineage, forDuplicateProcessing, effectiveTime, diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/AssetProperties.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/AssetProperties.java index acbbe4334cd..8cf1b32dbf2 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/AssetProperties.java @@ -57,6 +57,8 @@ public class AssetProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; + private String name = null; + private String versionIdentifier = null; private String displayName = null; private String description = null; private String owner = null; @@ -88,6 +90,8 @@ public AssetProperties(AssetProperties template) if (template != null) { + name = template.getName(); + versionIdentifier = template.getVersionIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); owner = template.getOwner(); @@ -102,14 +106,68 @@ public AssetProperties(AssetProperties template) } + /** + * Return the name of the resource that this asset represents. + * + * @return string resource name + */ + public String getName() + { + if (name == null) + { + return displayName; + } + + return name; + } + + + /** + * Set up the name of the resource that this asset represents. + * + * @param name string resource name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored display name property for the asset. - * If no display name is available then null is returned. + * If no display name is available then name is returned. * * @return String name */ public String getDisplayName() { + if (displayName == null) + { + return name; + } + return displayName; } @@ -357,12 +415,14 @@ public void setOtherOriginValues(Map otherOriginValues) public String toString() { return "AssetProperties{" + - "displayName='" + displayName + '\'' + + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", owner='" + owner + '\'' + - ", ownerTypeName=" + ownerTypeName + - ", ownerPropertyName=" + ownerPropertyName+ ", ownerType=" + ownerType + + ", ownerTypeName='" + ownerTypeName + '\'' + + ", ownerPropertyName='" + ownerPropertyName + '\'' + ", zoneMembership=" + zoneMembership + ", originOrganizationGUID='" + originOrganizationGUID + '\'' + ", originBusinessCapabilityGUID='" + originBusinessCapabilityGUID + '\'' + @@ -388,25 +448,63 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(owner, that.owner) && - Objects.equals(ownerTypeName, that.ownerTypeName) && - Objects.equals(ownerPropertyName, that.ownerPropertyName) && - ownerType == that.ownerType && - Objects.equals(zoneMembership, that.zoneMembership) && - Objects.equals(originOrganizationGUID, that.originOrganizationGUID) && - Objects.equals(originBusinessCapabilityGUID, that.originBusinessCapabilityGUID) && - Objects.equals(otherOriginValues, that.otherOriginValues); + + if (name != null ? ! name.equals(that.name) : that.name != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (owner != null ? ! owner.equals(that.owner) : that.owner != null) + { + return false; + } + if (ownerType != that.ownerType) + { + return false; + } + if (ownerTypeName != null ? ! ownerTypeName.equals(that.ownerTypeName) : that.ownerTypeName != null) + { + return false; + } + if (ownerPropertyName != null ? ! ownerPropertyName.equals(that.ownerPropertyName) : that.ownerPropertyName != null) + { + return false; + } + if (zoneMembership != null ? ! zoneMembership.equals(that.zoneMembership) : that.zoneMembership != null) + { + return false; + } + if (originOrganizationGUID != null ? ! originOrganizationGUID.equals(that.originOrganizationGUID) : that.originOrganizationGUID != null) + { + return false; + } + if (originBusinessCapabilityGUID != null ? ! originBusinessCapabilityGUID.equals( + that.originBusinessCapabilityGUID) : that.originBusinessCapabilityGUID != null) + { + return false; + } + return otherOriginValues != null ? otherOriginValues.equals(that.otherOriginValues) : that.otherOriginValues == null; } @@ -418,8 +516,7 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, description, owner, ownerTypeName, ownerPropertyName, ownerType, - zoneMembership, originOrganizationGUID, - originBusinessCapabilityGUID, otherOriginValues); + return Objects.hash(super.hashCode(), name, versionIdentifier,displayName, description, owner, ownerTypeName, ownerPropertyName, ownerType, + zoneMembership, originOrganizationGUID, originBusinessCapabilityGUID, otherOriginValues); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataStoreProperties.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataStoreProperties.java index c5a76f6783f..f794250d015 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataStoreProperties.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/DataStoreProperties.java @@ -251,27 +251,33 @@ public void setEncodingProperties(Map encodingProperties) * * @return print out of variables in a JSON-style */ - @Override @SuppressWarnings(value = "deprecation") + @Override public String toString() { return "DataStoreProperties{" + - "pathName=" + pathName + - ", createTime=" + createTime + - ", modifiedTime=" + modifiedTime + - ", encodingType='" + encodingType + '\'' + - ", encodingLanguage='" + encodingLanguage + '\'' + - ", encodingDescription='" + encodingDescription + '\'' + - ", encodingProperties='" + encodingProperties + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", owner='" + getOwner() + '\'' + + ", ownerTypeName='" + getOwnerTypeName() + '\'' + + ", ownerPropertyName='" + getOwnerPropertyName() + '\'' + ", ownerType=" + getOwnerType() + ", zoneMembership=" + getZoneMembership() + - ", origin=" + getOtherOriginValues() + + ", originOrganizationGUID='" + getOriginOrganizationGUID() + '\'' + + ", originBusinessCapabilityGUID='" + getOriginBusinessCapabilityGUID() + '\'' + + ", otherOriginValues=" + getOtherOriginValues() + + ", pathName='" + pathName + '\'' + + ", createTime=" + createTime + + ", modifiedTime=" + modifiedTime + + ", encodingType='" + encodingType + '\'' + + ", encodingLanguage='" + encodingLanguage + '\'' + + ", encodingDescription='" + encodingDescription + '\'' + + ", encodingProperties=" + encodingProperties + + ", typeName='" + getTypeName() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + - ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + '}'; } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/FileProperties.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/FileProperties.java index 000941700fb..e33ce0de16d 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/FileProperties.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/FileProperties.java @@ -87,23 +87,31 @@ public void setFileType(String fileType) public String toString() { return "FileProperties{" + - "fileType='" + fileType + '\'' + - ", createTime=" + getCreateTime() + - ", modifiedTime=" + getModifiedTime() + - ", encodingType='" + getEncodingType() + '\'' + - ", encodingLanguage='" + getEncodingLanguage() + '\'' + - ", encodingDescription='" + getEncodingDescription() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", owner='" + getOwner() + '\'' + - ", ownerType=" + getOwnerType() + - ", zoneMembership=" + getZoneMembership() + - ", origin=" + getOtherOriginValues() + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", owner='" + getOwner() + '\'' + + ", ownerTypeName='" + getOwnerTypeName() + '\'' + + ", ownerPropertyName='" + getOwnerPropertyName() + '\'' + + ", ownerType=" + getOwnerType() + + ", zoneMembership=" + getZoneMembership() + + ", originOrganizationGUID='" + getOriginOrganizationGUID() + '\'' + + ", originBusinessCapabilityGUID='" + getOriginBusinessCapabilityGUID() + '\'' + + ", otherOriginValues=" + getOtherOriginValues() + + ", pathName='" + getPathName() + '\'' + + ", createTime=" + getCreateTime() + + ", modifiedTime=" + getModifiedTime() + + ", encodingType='" + getEncodingType() + '\'' + + ", encodingLanguage='" + getEncodingLanguage() + '\'' + + ", encodingDescription='" + getEncodingDescription() + '\'' + + ", encodingProperties=" + getEncodingProperties() + + ", fileType='" + fileType + '\'' + + ", typeName='" + getTypeName() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", extendedProperties=" + getExtendedProperties() + + '}'; } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/ReferenceableProperties.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/ReferenceableProperties.java index c877d9b7dfd..2cc0a2d2e39 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/ReferenceableProperties.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/ReferenceableProperties.java @@ -30,7 +30,7 @@ @JsonSubTypes.Type(value = EndpointProperties.class, name = "EndpointProperties"), @JsonSubTypes.Type(value = SchemaElementProperties.class, name = "SchemaElementProperties") }) -public abstract class ReferenceableProperties implements Serializable +public class ReferenceableProperties implements Serializable { private static final long serialVersionUID = 1L; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/TemplateProperties.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/TemplateProperties.java index b3143206fc4..d8001f63d07 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/TemplateProperties.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/properties/TemplateProperties.java @@ -24,10 +24,13 @@ public class TemplateProperties implements Serializable { private static final long serialVersionUID = 1L; - private String qualifiedName = null; - private String displayName = null; - private String description = null; - private String networkAddress = null; + private String qualifiedName = null; + private String displayName = null; + private String versionIdentifier = null; + private String description = null; + private String pathName = null; + private String networkAddress = null; + /** * Default constructor @@ -47,10 +50,12 @@ public TemplateProperties(TemplateProperties template) { if (template != null) { - qualifiedName = template.getQualifiedName(); - displayName = template.getDisplayName(); - description = template.getDescription(); - networkAddress = template.getNetworkAddress(); + qualifiedName = template.getQualifiedName(); + displayName = template.getDisplayName(); + versionIdentifier = template.getVersionIdentifier(); + description = template.getDescription(); + pathName = template.getPathName(); + networkAddress = template.getNetworkAddress(); } } @@ -101,6 +106,28 @@ public void setDisplayName(String displayName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored description property for the metadata entity. * If no description is provided then null is returned. @@ -124,6 +151,28 @@ public void setDescription(String description) } + /** + * Return the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @return string name + */ + public String getPathName() + { + return pathName; + } + + + /** + * Set up the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @param pathName string name + */ + public void setPathName(String pathName) + { + this.pathName = pathName; + } + + /** * Return the physical network address of this metadata element (if this makes sense). * @@ -131,7 +180,7 @@ public void setDescription(String description) */ public String getNetworkAddress() { - return networkAddress; + return pathName; } @@ -142,7 +191,7 @@ public String getNetworkAddress() */ public void setNetworkAddress(String networkAddress) { - this.networkAddress = networkAddress; + this.pathName = networkAddress; } @@ -157,7 +206,9 @@ public String toString() return "TemplateProperties{" + "qualifiedName='" + qualifiedName + '\'' + ", displayName='" + displayName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", description='" + description + '\'' + + ", pathName='" + pathName + '\'' + ", networkAddress='" + networkAddress + '\'' + '}'; } @@ -176,15 +227,34 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TemplateProperties)) { return false; } + TemplateProperties that = (TemplateProperties) objectToCompare; - return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(networkAddress, that.networkAddress); + + if (qualifiedName != null ? ! qualifiedName.equals(that.qualifiedName) : that.qualifiedName != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (pathName != null ? ! pathName.equals(that.pathName) : that.pathName != null) + { + return false; + } + return networkAddress != null ? networkAddress.equals(that.networkAddress) : that.networkAddress == null; } @@ -196,6 +266,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, displayName, description, networkAddress); + return Objects.hash(qualifiedName, displayName, versionIdentifier, description, pathName, networkAddress); } } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewCSVFileAssetRequestBody.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewCSVFileAssetRequestBody.java index c26b13fe328..a9907c9e058 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewCSVFileAssetRequestBody.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewCSVFileAssetRequestBody.java @@ -132,7 +132,7 @@ public void setQuoteCharacter(Character quoteCharacter) public String toString() { return "NewCSVFileAssetRequestBody{" + - "displayName='" + getDisplayName() + '\'' + + "displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", fullPath='" + getFullPath() + '\'' + ", columnHeaders=" + columnHeaders + @@ -174,7 +174,7 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(getDisplayName(), getDescription(), getFullPath(), getColumnHeaders(), + return Objects.hash(getName(), getDescription(), getFullPath(), getColumnHeaders(), getDelimiterCharacter(), getQuoteCharacter()); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewFileAssetRequestBody.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewFileAssetRequestBody.java index e56943fa8b5..1ab4a46d133 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewFileAssetRequestBody.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/rest/NewFileAssetRequestBody.java @@ -27,9 +27,11 @@ public class NewFileAssetRequestBody extends AssetOwnerOMASAPIRequestBody { private static final long serialVersionUID = 1L; - private String displayName = null; - private String description = null; - private String fullPath = null; + private String name = null; + private String displayName = null; + private String versionIdentifier = null; + private String description = null; + private String fullPath = null; /** @@ -51,6 +53,7 @@ public NewFileAssetRequestBody(NewFileAssetRequestBody template) if (template != null) { + name = template.getName(); displayName = template.getDisplayName(); description = template.getDescription(); fullPath = template.getFullPath(); @@ -59,20 +62,75 @@ public NewFileAssetRequestBody(NewFileAssetRequestBody template) /** - * Return the display name of the file + * Return the name of the resource that this asset represents. * - * @return string name + * @return string resource name + */ + public String getName() + { + if (name == null) + { + return displayName; + } + + return name; + } + + + /** + * Set up the name of the resource that this asset represents. + * + * @param name string resource name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + + /** + * Returns the stored display name property for the asset. + * If no display name is available then name is returned. + * + * @return String name */ public String getDisplayName() { + if (displayName == null) + { + return name; + } + return displayName; } /** - * Set up the display name of the file. + * Set up the stored display name property for the asset. * - * @param displayName string name + * @param displayName String name */ public void setDisplayName(String displayName) { @@ -133,10 +191,11 @@ public void setFullPath(String fullPath) public String toString() { return "NewFileAssetRequestBody{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", fullPath='" + fullPath + - '}'; + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", description='" + description + '\'' + + ", fullPath='" + fullPath + '\'' + + '}'; } @@ -158,7 +217,7 @@ public boolean equals(Object objectToCompare) return false; } NewFileAssetRequestBody that = (NewFileAssetRequestBody) objectToCompare; - return Objects.equals(getDisplayName(), that.getDisplayName()) && + return Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getFullPath(), that.getFullPath()); } @@ -172,6 +231,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(getDisplayName(), getDescription(), getFullPath()); + return Objects.hash(getName(), getDescription(), getFullPath()); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java index b573365ae63..cbb69be5993 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java @@ -162,7 +162,7 @@ public List addAvroFileToCatalog(String userId, invalidParameterHandler.validateName(fullPath, pathParameter, methodName); NewFileAssetRequestBody requestBody = new NewFileAssetRequestBody(); - requestBody.setDisplayName(displayName); + requestBody.setName(displayName); requestBody.setDescription(description); requestBody.setFullPath(fullPath); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java index 1660c9f8983..8ff53b49e90 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java @@ -187,7 +187,7 @@ public List addCSVFileToCatalog(String userId, invalidParameterHandler.validateName(fullPath, pathParameter, methodName); NewCSVFileAssetRequestBody requestBody = new NewCSVFileAssetRequestBody(); - requestBody.setDisplayName(displayName); + requestBody.setName(displayName); requestBody.setDescription(description); requestBody.setFullPath(fullPath); requestBody.setColumnHeaders(columnHeaders); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java index e1dc94bb292..02b3521b9ac 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java @@ -199,7 +199,7 @@ public String createFileSystemInCatalog(String userId, * "one/two" and the last one called "one/two/three". * * @param userId calling user - * @param anchorGUID root object to connect the folder to + * @param parentGUID root object to connect the folder to * @param pathName pathname of the folder (or folders) * * @return list of GUIDs from the top level to the leaf of the supplied pathname @@ -210,7 +210,7 @@ public String createFileSystemInCatalog(String userId, */ @Override public List createFolderStructureInCatalog(String userId, - String anchorGUID, + String parentGUID, String pathName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException @@ -230,7 +230,7 @@ public List createFolderStructureInCatalog(String userId, requestBody, serverName, userId, - anchorGUID); + parentGUID); return restResult.getGUIDs(); } @@ -384,7 +384,7 @@ public List addDataFileAssetToCatalog(String userId, invalidParameterHandler.validateName(pathName, pathParameter, methodName); NewFileAssetRequestBody requestBody = new NewFileAssetRequestBody(); - requestBody.setDisplayName(displayName); + requestBody.setName(displayName); requestBody.setDescription(description); requestBody.setFullPath(pathName); @@ -434,7 +434,7 @@ public List addDataFolderAssetToCatalog(String userId, invalidParameterHandler.validateName(pathName, pathParameter, methodName); NewFileAssetRequestBody requestBody = new NewFileAssetRequestBody(); - requestBody.setDisplayName(displayName); + requestBody.setName(displayName); requestBody.setDescription(description); requestBody.setFullPath(pathName); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java index 8be5dc1ae56..ae69912dddd 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/AssetConverter.java @@ -72,7 +72,9 @@ public B getNewBean(Class beanClass, assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - assetProperties.setDisplayName(this.removeName(instanceProperties)); + assetProperties.setName(this.removeName(instanceProperties)); + assetProperties.setDisplayName(assetProperties.getName()); + assetProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); assetProperties.setDescription(this.removeDescription(instanceProperties)); /* Note this value should be in the classification */ diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java index 80538395790..88fa7209080 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/DataFileConverter.java @@ -76,7 +76,9 @@ public B getNewBean(Class beanClass, fileProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); fileProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - fileProperties.setDisplayName(this.removeName(instanceProperties)); + fileProperties.setName(this.removeName(instanceProperties)); + fileProperties.setDisplayName(fileProperties.getName()); + fileProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); fileProperties.setDescription(this.removeDescription(instanceProperties)); fileProperties.setPathName(this.removePathName(instanceProperties)); fileProperties.setCreateTime(this.removeStoreCreateTime(instanceProperties)); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java index 6735f842667..ae979c38056 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/FileFolderConverter.java @@ -76,7 +76,9 @@ public B getNewBean(Class beanClass, folderProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); folderProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - folderProperties.setDisplayName(this.removeName(instanceProperties)); + folderProperties.setName(this.removeName(instanceProperties)); + folderProperties.setDisplayName(folderProperties.getName()); + folderProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); folderProperties.setDescription(this.removeDescription(instanceProperties)); folderProperties.setPathName(this.removePathName(instanceProperties)); folderProperties.setCreateTime(this.removeStoreCreateTime(instanceProperties)); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java index 4cecb85d2b5..23eef3a6e3d 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/converters/ReferenceableConverter.java @@ -2,9 +2,8 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.assetowner.converters; -import org.odpi.openmetadata.accessservices.assetowner.metadataelements.AssetElement; -import org.odpi.openmetadata.accessservices.assetowner.properties.AssetProperties; -import org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIMapper; +import org.odpi.openmetadata.accessservices.assetowner.metadataelements.ReferenceableElement; +import org.odpi.openmetadata.accessservices.assetowner.properties.ReferenceableProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties; @@ -16,8 +15,8 @@ /** - * AssetConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) - * EntityDetail object into a bean that inherits from AssetProperties. + * ReferenceableConverter provides common methods for transferring relevant properties from an Open Metadata Repository Services (OMRS) + * EntityDetail object into a bean that inherits from ReferenceableProperties. */ public class ReferenceableConverter extends AssetOwnerOMASConverter { @@ -47,7 +46,6 @@ public ReferenceableConverter(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 @@ -59,10 +57,10 @@ public B getNewBean(Class beanClass, */ B returnBean = beanClass.getDeclaredConstructor().newInstance(); - if (returnBean instanceof AssetElement) + if (returnBean instanceof ReferenceableElement) { - AssetElement bean = (AssetElement) returnBean; - AssetProperties assetProperties = new AssetProperties(); + ReferenceableElement bean = (ReferenceableElement)returnBean; + ReferenceableProperties referenceableProperties = new ReferenceableProperties(); if (entity != null) { @@ -73,45 +71,17 @@ public B getNewBean(Class beanClass, */ InstanceProperties instanceProperties = new InstanceProperties(entity.getProperties()); - assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); - assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - assetProperties.setDisplayName(this.removeName(instanceProperties)); - assetProperties.setDescription(this.removeDescription(instanceProperties)); - - /* Note this value should be in the classification */ - assetProperties.setOwner(this.removeOwner(instanceProperties)); - /* Note this value should be in the classification */ - assetProperties.setOwnerType(this.removeOwnerTypeFromProperties(instanceProperties)); - /* Note this value should be in the classification */ - assetProperties.setZoneMembership(this.removeZoneMembership(instanceProperties)); + referenceableProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); + referenceableProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); /* * Any remaining properties are returned in the extended properties. They are * assumed to be defined in a subtype. */ - assetProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); - assetProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); - - /* - * The values in the classifications override the values in the main properties of the Asset's entity. - * Having these properties in the main entity is deprecated. - */ - instanceProperties = super.getClassificationProperties(OpenMetadataAPIMapper.ASSET_ZONES_CLASSIFICATION_NAME, entity); - - assetProperties.setZoneMembership(this.getZoneMembership(instanceProperties)); - - instanceProperties = super.getClassificationProperties(OpenMetadataAPIMapper.ASSET_OWNERSHIP_CLASSIFICATION_NAME, entity); - - assetProperties.setOwner(this.getOwner(instanceProperties)); - assetProperties.setOwnerType(this.getOwnerTypeFromProperties(instanceProperties)); - - instanceProperties = super.getClassificationProperties(OpenMetadataAPIMapper.ASSET_ORIGIN_CLASSIFICATION_NAME, entity); - - assetProperties.setOriginOrganizationGUID(this.getOriginOrganizationGUID(instanceProperties)); - assetProperties.setOriginBusinessCapabilityGUID(this.getOriginBusinessCapabilityGUID(instanceProperties)); - assetProperties.setOtherOriginValues(this.getOtherOriginValues(instanceProperties)); + referenceableProperties.setTypeName(bean.getElementHeader().getType().getTypeName()); + referenceableProperties.setExtendedProperties(this.getRemainingExtendedProperties(instanceProperties)); - bean.setAssetProperties(assetProperties); + bean.setReferenceableProperties(referenceableProperties); } else { diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerRESTServices.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerRESTServices.java index 61bfd7c2eb9..041c40d3969 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerRESTServices.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/AssetOwnerRESTServices.java @@ -193,7 +193,8 @@ public GUIDResponse addAssetToCatalog(String serverName, null, null, requestBody.getQualifiedName(), - requestBody.getDisplayName(), + requestBody.getName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getZoneMembership(), requestBody.getOwner(), @@ -270,7 +271,9 @@ public GUIDResponse addAssetToCatalogUsingTemplate(String serverNam requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + requestBody.getPathName(), requestBody.getNetworkAddress(), false, false, diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/FileSystemRESTServices.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/FileSystemRESTServices.java index 09a1818f40e..1f2bdb9d4e7 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/FileSystemRESTServices.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-server/src/main/java/org/odpi/openmetadata/accessservices/assetowner/server/FileSystemRESTServices.java @@ -401,7 +401,8 @@ public GUIDListResponse addDataFileAssetToCatalog(String server response.setGUIDs(handler.addDataFileAssetToCatalog(userId, null, null, - requestBody.getDisplayName(), + requestBody.getName(), + null, requestBody.getDescription(), requestBody.getFullPath(), null, @@ -467,7 +468,8 @@ public GUIDListResponse addDataFolderAssetToCatalog(String serv null, null, requestBody.getFullPath(), - requestBody.getDisplayName(), + requestBody.getName(), + null, requestBody.getDescription(), null, null, @@ -1159,7 +1161,8 @@ public GUIDListResponse addAvroFileToCatalog(String serverNam response.setGUIDs(handler.addAvroFileToCatalog(userId, null, null, - requestBody.getDisplayName(), + requestBody.getName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getFullPath(), null, @@ -1223,7 +1226,8 @@ public GUIDListResponse addCSVFileToCatalog(String serverN response.setGUIDs(handler.addCSVFileToCatalog(userId, null, null, - requestBody.getDisplayName(), + requestBody.getName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getFullPath(), requestBody.getColumnHeaders(), diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetProperties.java index 8ae9b768418..89ebae02ce9 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/AssetProperties.java @@ -21,10 +21,11 @@ public class AssetProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; - private String name = null; - private String description = null; - private Date dateAssetCreated = null; - private Date dateAssetLastUpdated = null; + private String name = null; + private String versionIdentifier = null; + private String description = null; + private Date dateAssetCreated = null; + private Date dateAssetLastUpdated = null; /** @@ -48,6 +49,7 @@ public AssetProperties(AssetProperties template) if (template != null) { this.name = template.getName(); + this.versionIdentifier = template.getVersionIdentifier(); this.description = template.getDescription(); this.dateAssetCreated = template.getDateAssetCreated(); this.dateAssetLastUpdated = template.getDateAssetLastUpdated(); @@ -56,7 +58,7 @@ public AssetProperties(AssetProperties template) /** - * Return the name of the asset. + * Return the name of the resource. * * @return string name */ @@ -67,7 +69,7 @@ public String getName() /** - * Set up the name of the asset. + * Set up the name of the resource. * * @param name string name */ @@ -77,6 +79,28 @@ public void setName(String name) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Return the description of the asset. * @@ -168,6 +192,7 @@ public String toString() { return "AssetProperties{" + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", description='" + description + '\'' + ", dateAssetCreated=" + dateAssetCreated + ", dateAssetLastUpdated=" + dateAssetLastUpdated + @@ -195,19 +220,34 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(name, that.name) && - Objects.equals(description, that.description) && - Objects.equals(dateAssetCreated, that.dateAssetCreated) && - Objects.equals(dateAssetLastUpdated, that.dateAssetLastUpdated); + + if (name != null ? ! name.equals(that.name) : that.name != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (dateAssetCreated != null ? ! dateAssetCreated.equals(that.dateAssetCreated) : that.dateAssetCreated != null) + { + return false; + } + return dateAssetLastUpdated != null ? dateAssetLastUpdated.equals(that.dateAssetLastUpdated) : that.dateAssetLastUpdated == null; } @@ -219,7 +259,7 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getName(), getDescription(), getDateAssetCreated(), + return Objects.hash(super.hashCode(), getName(), getVersionIdentifier(), getDescription(), getDateAssetCreated(), getDateAssetLastUpdated(), getExtendedProperties(), getAdditionalProperties()); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/AssetCollectionMemberConverter.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/AssetCollectionMemberConverter.java index 67211d5a8cf..14532dffc76 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/AssetCollectionMemberConverter.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/converters/AssetCollectionMemberConverter.java @@ -79,6 +79,7 @@ public B getNewBean(Class beanClass, assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); assetProperties.setName(this.removeName(instanceProperties)); + assetProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); assetProperties.setDescription(this.removeDescription(instanceProperties)); assetProperties.setEffectiveFrom(instanceProperties.getEffectiveFromTime()); assetProperties.setEffectiveTo(instanceProperties.getEffectiveToTime()); diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/builders/ProcessPropertiesBuilder.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/builders/ProcessPropertiesBuilder.java index 3b949f74be2..dc6d22939d6 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/builders/ProcessPropertiesBuilder.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/builders/ProcessPropertiesBuilder.java @@ -22,7 +22,7 @@ public ProcessPropertiesBuilder(String qualifiedName, String processDisplayName, String typeGUID, String typeName, String formula, String implementationLanguage, Map additionalProperties, OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName) { - super(qualifiedName, technicalName, technicalDescription, additionalProperties, typeGUID, typeName, null, repositoryHelper, + super(qualifiedName, technicalName, null, technicalDescription, additionalProperties, typeGUID, typeName, null, repositoryHelper, serviceName, serverName); this.processDisplayName = processDisplayName; diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandler.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandler.java index 70840a24c8f..051dda06d93 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandler.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandler.java @@ -165,7 +165,7 @@ private String updateFileInRepository(String userId, String externalSourceGuid, TypeDef entityTypeDef = repositoryHelper.getTypeDefByName(userId, DATA_FILE_TYPE_NAME); fileHandler.updateAsset(userId, externalSourceGuid, externalSourceName, fileAsEntity.getGUID(), - CommonMapper.GUID_PROPERTY_NAME, file.getQualifiedName(), file.getDisplayName(), + CommonMapper.GUID_PROPERTY_NAME, file.getQualifiedName(), file.getDisplayName(), null, file.getDescription(), file.getAdditionalProperties(), entityTypeDef.getGUID(), entityTypeDef.getName(), extendedProperties, null, null, true, false, false, dataEngineCommonHandler.getNow(), methodName); @@ -179,7 +179,7 @@ private String createFileInRepository(String typeName, String typeGuid, DataFile int ownerType = dataEngineCommonHandler.getOwnerTypeOrdinal(file.getOwnerType()); return fileHandler.createAssetInRepository(userId, externalSourceGuid, externalSourceName, - file.getQualifiedName(), file.getDisplayName(), file.getDescription(), file.getZoneMembership(), + file.getQualifiedName(), file.getDisplayName(), null, file.getDescription(), file.getZoneMembership(), file.getOwner(), ownerType, file.getOriginOrganizationGUID(), file.getOriginBusinessCapabilityGUID(), file.getOtherOriginValues(), file.getAdditionalProperties(), typeGuid, typeName, extendedProperties, null, null, InstanceStatus.ACTIVE, diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandler.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandler.java index 776e303c0b9..52ab9fc9164 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandler.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandler.java @@ -167,7 +167,7 @@ private String upsertFolder(String externalSourceGuid, String externalSourceName } return folderHandler.createAssetInRepository(userId, externalSourceGuid, externalSourceName, - folder.getQualifiedName(), folder.getDisplayName(), folder.getDescription(), folder.getZoneMembership(), + folder.getQualifiedName(), folder.getDisplayName(), null, folder.getDescription(), folder.getZoneMembership(), folder.getOwner(), folder.getOwnerType().getOpenTypeOrdinal(), null, null, folder.getOtherOriginValues(), folder.getAdditionalProperties(), FILE_FOLDER_TYPE_GUID, FILE_FOLDER_TYPE_NAME, null, null, null, diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandler.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandler.java index 5c2ac16fcbd..c413fd3570a 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandler.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandler.java @@ -98,7 +98,7 @@ public String createProcess(String userId, Process process, String externalSourc String externalSourceGUID = registrationHandler.getExternalDataEngine(userId, externalSourceName); return assetHandler.createAssetInRepository(userId, externalSourceGUID, externalSourceName, process.getQualifiedName(), process.getName(), - process.getDescription(), process.getZoneMembership(), process.getOwner(), + null, process.getDescription(), process.getZoneMembership(), process.getOwner(), dataEngineCommonHandler.getOwnerTypeOrdinal(process.getOwnerType()), process.getOriginBusinessCapabilityGUID(), process.getOriginBusinessCapabilityGUID(), process.getOtherOriginValues(), process.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, buildProcessExtendedProperties(process), null, null, @@ -140,7 +140,7 @@ public void updateProcess(String userId, EntityDetail originalProcessEntity, Pro String externalSourceGUID = registrationHandler.getExternalDataEngine(userId, externalSourceName); assetHandler.updateAsset(userId, externalSourceGUID, externalSourceName, processGUID, PROCESS_GUID_PARAMETER_NAME, - updatedProcess.getQualifiedName(), updatedProcess.getName(), updatedProcess.getDescription(), + updatedProcess.getQualifiedName(), updatedProcess.getName(), null, updatedProcess.getDescription(), updatedProcess.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, buildProcessExtendedProperties(updatedProcess), null, null, true, false, false, dataEngineCommonHandler.getNow(), methodName); diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandler.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandler.java index abc91f5e187..ab0ecac5f79 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandler.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandler.java @@ -109,7 +109,7 @@ public String upsertDatabase(String userId, Database database, String externalSo String databaseGUID; if (originalDatabaseEntity.isEmpty()) { databaseGUID = relationalDataHandler.createDatabase(userId, externalSourceGUID, externalSourceName, database.getQualifiedName(), - database.getDisplayName(), database.getDescription(), database.getOwner(), ownerTypeOrdinal, database.getZoneMembership(), + database.getDisplayName(), null, database.getDescription(), database.getOwner(), ownerTypeOrdinal, database.getZoneMembership(), database.getOriginOrganizationGUID(), database.getOriginBusinessCapabilityGUID(), database.getOtherOriginValues(), database.getPathName(), database.getCreateTime(), database.getModifiedTime(), database.getEncodingType(), database.getEncodingLanguage(), database.getEncodingDescription(), database.getEncodingProperties(), database.getDatabaseType(), @@ -223,7 +223,7 @@ public String upsertDatabaseSchema(String userId, String databaseGUID, DatabaseS Date now = dataEngineCommonHandler.getNow(); if (originalDatabaseSchemaEntity.isEmpty()) { databaseSchemaGUID = relationalDataHandler.createDatabaseSchema(userId, externalSourceGUID, externalSourceName, databaseGUID, - databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), databaseSchema.getDescription(), databaseSchema.getOwner(), + databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), null, databaseSchema.getDescription(), databaseSchema.getOwner(), ownerTypeOrdinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, null, @@ -231,7 +231,7 @@ public String upsertDatabaseSchema(String userId, String databaseGUID, DatabaseS } else { databaseSchemaGUID = originalDatabaseSchemaEntity.get().getGUID(); relationalDataHandler.updateDatabaseSchema(userId, externalSourceGUID, externalSourceName, databaseSchemaGUID, - databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), databaseSchema.getDescription(), databaseSchema.getOwner(), + databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), null, databaseSchema.getDescription(), databaseSchema.getOwner(), ownerTypeOrdinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, null, diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandler.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandler.java index ebd81c1ca74..4239e90b087 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandler.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/main/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandler.java @@ -86,14 +86,14 @@ public String upsertTopic(String userId, Topic topic, String externalSourceName) topicHandler.verifyExternalSourceIdentity(userId, externalSourceGUID, externalSourceName, false, false, null, methodName); topicGUID = topicHandler.createAssetInRepository(userId, externalSourceGUID, externalSourceName, topic.getQualifiedName(), - topic.getDisplayName(), topic.getDescription(), topic.getZoneMembership(), topic.getOwner(), ownerTypeOrdinal, + topic.getDisplayName(), null, topic.getDescription(), topic.getZoneMembership(), topic.getOwner(), ownerTypeOrdinal, topic.getOriginOrganizationGUID(), topic.getOriginBusinessCapabilityGUID(), topic.getOtherOriginValues(), topic.getAdditionalProperties(), TOPIC_TYPE_GUID, TOPIC_TYPE_NAME, extendedProperties, null, null, InstanceStatus.ACTIVE, now, methodName); } else { topicGUID = originalTopicEntity.get().getGUID(); topicHandler.updateAsset(userId, externalSourceGUID, externalSourceName, topicGUID, TOPIC_GUID_PARAMETER_NAME, - topic.getQualifiedName(), topic.getDisplayName(), topic.getDescription(), topic.getAdditionalProperties(), + topic.getQualifiedName(), topic.getDisplayName(), null, topic.getDescription(), topic.getAdditionalProperties(), TOPIC_TYPE_GUID, TOPIC_TYPE_NAME, extendedProperties, null, null, true, false, false, now, methodName); } diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandlerTest.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandlerTest.java index 2ef711c8c98..1fdccb8438a 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandlerTest.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineDataFileHandlerTest.java @@ -116,7 +116,7 @@ void insertCsvFileToCatalog() throws InvalidParameterException, PropertyServerEx verify(dataEngineCommonHandler, times(1)).findEntity(USER, QUALIFIED_NAME, FILE_TYPE); verify(fileHandler, times(1)). - createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, QUALIFIED_NAME, NAME, DESCRIPTION, + createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, QUALIFIED_NAME, NAME, null, DESCRIPTION, null, OWNER, 0, null, null, null, null, CSV_FILE_TYPE_GUID, CSV_FILE_TYPE_NAME, getExtendedProperties(), null, null, InstanceStatus.ACTIVE, null, METHOD); @@ -144,7 +144,7 @@ void insertIncompleteCsvFileToCatalog() throws InvalidParameterException, Proper verify(dataEngineCommonHandler, times(1)).findEntity(USER, QUALIFIED_NAME, FILE_TYPE); verify(fileHandler, times(1)). - createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, QUALIFIED_NAME, NAME, DESCRIPTION, + createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, QUALIFIED_NAME, NAME, null, DESCRIPTION, null, OWNER, 0, null, null, null, null, CSV_FILE_TYPE_GUID, CSV_FILE_TYPE_NAME, getExtendedProperties(), null, null, InstanceStatus.ACTIVE, null, METHOD); @@ -178,7 +178,7 @@ void updateCsvFileToCatalog() throws InvalidParameterException, PropertyServerEx verify(dataEngineCommonHandler, times(1)).findEntity(USER, csvFile.getQualifiedName(), csvFile.getFileType()); verify(fileHandler, times(1)). updateAsset(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, GUID_VALUE, CommonMapper.GUID_PROPERTY_NAME, - QUALIFIED_NAME, NAME, DESCRIPTION, null, CSV_FILE_TYPE_GUID, CSV_FILE_TYPE_NAME, + QUALIFIED_NAME, NAME, null, DESCRIPTION, null, CSV_FILE_TYPE_GUID, CSV_FILE_TYPE_NAME, getExtendedProperties(),null, null, true, false, false, null, METHOD); verify(dataEngineSchemaTypeHandler, times(1)).upsertSchemaType(USER, schemaType, EXTERNAL_SOURCE_NAME); verify(dataEngineCommonHandler, times(1)).upsertExternalRelationship(USER, guid, SCHEMA_TYPE_GUID, diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandlerTest.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandlerTest.java index 4c0ca2b944a..aff4b44d857 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandlerTest.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineFolderHierarchyHandlerTest.java @@ -85,13 +85,13 @@ void upsertFolderHierarchy() throws InvalidParameterException, PropertyServerExc verify(dataEngineCommonHandler, times(1)).findEntity(USER, EXTERNAL_SOURCE_NAME + "::/test", FILE_FOLDER_TYPE_NAME); verify(folderHandler, times(1)).createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, - EXTERNAL_SOURCE_NAME, EXTERNAL_SOURCE_NAME + "::/test", "test", null, + EXTERNAL_SOURCE_NAME, EXTERNAL_SOURCE_NAME + "::/test", "test", null, null, null, null, 0, null, null, null, null, FILE_FOLDER_TYPE_GUID, FILE_FOLDER_TYPE_NAME, null, null, null, InstanceStatus.ACTIVE, null, METHOD); verify(folderHandler, times(1)).createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, EXTERNAL_SOURCE_NAME + "::/", "/", null, - null, null, 0, null, null, + null, null, null, 0, null, null, null, null, FILE_FOLDER_TYPE_GUID, FILE_FOLDER_TYPE_NAME, null, null, null, InstanceStatus.ACTIVE, null, METHOD); // verify(dataEngineCommonHandler, times(1)).upsertExternalRelationship(USER, GUID_VALUE_1, GUID_VALUE_2, @@ -135,13 +135,13 @@ private void mockDataEngineCommonHandler() private void mockFolderHandler() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { when(folderHandler.createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, - EXTERNAL_SOURCE_NAME + "::/test", "test", null, null, + EXTERNAL_SOURCE_NAME + "::/test", "test", null, null, null, null, 0, null, null, null, null, FILE_FOLDER_TYPE_GUID, FILE_FOLDER_TYPE_NAME, null, null, null, InstanceStatus.ACTIVE, null, METHOD)). thenReturn(GUID_VALUE_1); when(folderHandler.createAssetInRepository(USER, EXTERNAL_SOURCE_GUID, EXTERNAL_SOURCE_NAME, - EXTERNAL_SOURCE_NAME + "::/", "/", null, null, + EXTERNAL_SOURCE_NAME + "::/", "/", null, null, null, null, 0, null, null, null, null, FILE_FOLDER_TYPE_GUID, FILE_FOLDER_TYPE_NAME, null, null, null, InstanceStatus.ACTIVE, null, METHOD)). diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandlerTest.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandlerTest.java index 496616bd3dc..383e911c5a0 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandlerTest.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineProcessHandlerTest.java @@ -125,7 +125,7 @@ void createProcess() throws UserNotAuthorizedException, PropertyServerException, when(registrationHandler.getExternalDataEngine(USER, EXTERNAL_SOURCE_DE_QUALIFIED_NAME)).thenReturn(EXTERNAL_SOURCE_DE_GUID); when(assetHandler.createAssetInRepository(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_QUALIFIED_NAME, - process.getQualifiedName(), process.getName(), process.getDescription(), process.getZoneMembership(), process.getOwner(), + process.getQualifiedName(), process.getName(), null, process.getDescription(), process.getZoneMembership(), process.getOwner(), process.getOwnerType().getOpenTypeOrdinal(), process.getOriginOrganizationGUID(), process.getOriginBusinessCapabilityGUID(), process.getOtherOriginValues(), process.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, extendedProperties, null, null, InstanceStatus.DRAFT, null, methodName)).thenReturn(GUID); @@ -150,7 +150,7 @@ void createProcess_throwsUserNotAuthorizedException() throws UserNotAuthorizedEx UserNotAuthorizedException mockedException = mockException(UserNotAuthorizedException.class, methodName); doThrow(mockedException).when(assetHandler).createAssetInRepository(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_QUALIFIED_NAME, - process.getQualifiedName(), process.getName(), process.getDescription(), process.getZoneMembership(), process.getOwner(), + process.getQualifiedName(), process.getName(), null, process.getDescription(), process.getZoneMembership(), process.getOwner(), process.getOwnerType().getOpenTypeOrdinal(), process.getOriginOrganizationGUID(), process.getOriginBusinessCapabilityGUID(), process.getOtherOriginValues(), process.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, extendedProperties, null, null, InstanceStatus.DRAFT, null, methodName); @@ -183,7 +183,7 @@ void updateProcess() throws UserNotAuthorizedException, PropertyServerException, processHandler.updateProcess(USER, mockedOriginalProcessEntity, process, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); verify(assetHandler, times(1)).updateAsset(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_QUALIFIED_NAME, - PROCESS_GUID, "processGUID", process.getQualifiedName(), process.getName(), process.getDescription(), + PROCESS_GUID, "processGUID", process.getQualifiedName(), process.getName(), null, process.getDescription(), process.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, extendedProperties, null, null, true, false, false, null, methodName); @@ -211,7 +211,7 @@ void updateProcess_noChanges() throws UserNotAuthorizedException, PropertyServer processHandler.updateProcess(USER, mockedOriginalProcessEntity, process, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); verify(assetHandler, times(0)).updateAsset(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_QUALIFIED_NAME, - PROCESS_GUID, CommonMapper.GUID_PROPERTY_NAME, process.getQualifiedName(), process.getName(), process.getDescription(), + PROCESS_GUID, CommonMapper.GUID_PROPERTY_NAME, process.getQualifiedName(), process.getName(), null, process.getDescription(), process.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, extendedProperties, null,null, true,false, false, null, "updateProcess"); } @@ -246,7 +246,7 @@ void updateProcess_throwsUserNotAuthorizedException() throws UserNotAuthorizedEx UserNotAuthorizedException mockedException = mockException(UserNotAuthorizedException.class, methodName); doThrow(mockedException).when(assetHandler).updateAsset(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_QUALIFIED_NAME, - PROCESS_GUID, "processGUID", process.getQualifiedName(), process.getName(), process.getDescription(), + PROCESS_GUID, "processGUID", process.getQualifiedName(), process.getName(), null, process.getDescription(), process.getAdditionalProperties(), PROCESS_TYPE_GUID, PROCESS_TYPE_NAME, extendedProperties, null, null, true,false, false, null, methodName); diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandlerTest.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandlerTest.java index 794fe86403d..0b6b5d74359 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandlerTest.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineRelationalDataHandlerTest.java @@ -30,7 +30,6 @@ import org.odpi.openmetadata.repositoryservices.ffdc.exception.FunctionNotSupportedException; import java.util.Collections; -import java.util.Date; import java.util.List; import java.util.Optional; @@ -124,7 +123,7 @@ void upsertDatabase_create() throws InvalidParameterException, PropertyServerExc when(registrationHandler.getExternalDataEngine(USER, EXTERNAL_SOURCE_DE_NAME)).thenReturn(EXTERNAL_SOURCE_DE_GUID); when(relationalDataHandler.createDatabase(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, database.getQualifiedName(), - database.getDisplayName(), database.getDescription(), database.getOwner(), database.getOwnerType().getOpenTypeOrdinal(), + database.getDisplayName(), null, database.getDescription(), database.getOwner(), database.getOwnerType().getOpenTypeOrdinal(), database.getZoneMembership(), database.getOriginOrganizationGUID(), database.getOriginBusinessCapabilityGUID(), database.getOtherOriginValues(), database.getPathName(), database.getCreateTime(), database.getModifiedTime(), database.getEncodingType(), database.getEncodingLanguage(), database.getEncodingDescription(), database.getEncodingProperties(), @@ -141,7 +140,7 @@ void upsertDatabase_create() throws InvalidParameterException, PropertyServerExc int ordinal = OwnerType.USER_ID.getOrdinal(); when(relationalDataHandler.createDatabaseSchema(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, DATABASE_GUID, - databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), databaseSchema.getDescription(), + databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), null, databaseSchema.getDescription(), databaseSchema.getOwner(), ordinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, null, @@ -163,7 +162,7 @@ void upsertDatabase_create() throws InvalidParameterException, PropertyServerExc DATABASE_GUID, DATABASE_TYPE_NAME, PROTOCOL, NETWORK_ADDRESS, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, USER); verify(relationalDataHandler, times(1)).createDatabaseSchema(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, DATABASE_GUID, databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), - databaseSchema.getDescription(), databaseSchema.getOwner(), ordinal, databaseSchema.getZoneMembership(), + null, databaseSchema.getDescription(), databaseSchema.getOwner(), ordinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, null, null, null, null, @@ -212,7 +211,7 @@ void upsertDatabaseSchema_create() throws InvalidParameterException, PropertySer int ordinal = OwnerType.USER_ID.getOrdinal(); when(relationalDataHandler.createDatabaseSchema(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, DATABASE_GUID, - databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), databaseSchema.getDescription(), + databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), null, databaseSchema.getDescription(), databaseSchema.getOwner(), ordinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, null, @@ -236,7 +235,7 @@ void upsertDatabaseSchema_create_incomplete() throws InvalidParameterException, int ordinal = OwnerType.USER_ID.getOrdinal(); when(relationalDataHandler.createDatabaseSchema(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, DATABASE_GUID, - databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), databaseSchema.getDescription(), + databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), null, databaseSchema.getDescription(), databaseSchema.getOwner(), ordinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, null, @@ -268,7 +267,7 @@ void upsertDatabaseSchema_update() throws InvalidParameterException, PropertySer int ordinal = OwnerType.USER_ID.getOrdinal(); doNothing().when(relationalDataHandler).updateDatabaseSchema(USER, EXTERNAL_SOURCE_DE_GUID, EXTERNAL_SOURCE_DE_NAME, - SCHEMA_GUID, databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), databaseSchema.getDescription(), + SCHEMA_GUID, databaseSchema.getQualifiedName(), databaseSchema.getDisplayName(), null, databaseSchema.getDescription(), databaseSchema.getOwner(), ordinal, databaseSchema.getZoneMembership(), databaseSchema.getOriginOrganizationGUID(), databaseSchema.getOriginBusinessCapabilityGUID(), databaseSchema.getOtherOriginValues(), databaseSchema.getAdditionalProperties(), DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, diff --git a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandlerTest.java b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandlerTest.java index 23912a1bb49..5571a972087 100644 --- a/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandlerTest.java +++ b/open-metadata-implementation/access-services/data-engine/data-engine-server/src/test/java/org/odpi/openmetadata/accessservices/dataengine/server/handlers/DataEngineTopicHandlerTest.java @@ -68,7 +68,7 @@ void upsertTopic_create() throws InvalidParameterException, PropertyServerExcept dataEngineTopicHandler.upsertTopic(USER, topic, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); verify(topicHandler, times(1)).createAssetInRepository(USER, EXTERNAL_SOURCE_DE_GUID, - EXTERNAL_SOURCE_DE_QUALIFIED_NAME, QUALIFIED_NAME, DISPLAY_NAME, null, null, null, + EXTERNAL_SOURCE_DE_QUALIFIED_NAME, QUALIFIED_NAME, DISPLAY_NAME, null, null, null, null, 0, null, null, null, null, TOPIC_TYPE_GUID, TOPIC_TYPE_NAME, new HashMap<>(), null, null, InstanceStatus.ACTIVE, null, "upsertTopic"); } @@ -82,7 +82,7 @@ void upsertTopic_update() throws InvalidParameterException, PropertyServerExcept dataEngineTopicHandler.upsertTopic(USER, topic, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); verify(topicHandler, times(1)).updateAsset(USER, EXTERNAL_SOURCE_DE_GUID, - EXTERNAL_SOURCE_DE_QUALIFIED_NAME, GUID, TOPIC_GUID_PARAMETER_NAME, QUALIFIED_NAME, DISPLAY_NAME, + EXTERNAL_SOURCE_DE_QUALIFIED_NAME, GUID, TOPIC_GUID_PARAMETER_NAME, QUALIFIED_NAME, DISPLAY_NAME, null, null, null, TOPIC_TYPE_GUID, TOPIC_TYPE_NAME, new HashMap<>(), null, null, true, false, false, null, "upsertTopic"); } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/FilesAndFoldersInterface.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/FilesAndFoldersInterface.java index 849e48e3699..270e787c4aa 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/FilesAndFoldersInterface.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/api/FilesAndFoldersInterface.java @@ -602,7 +602,31 @@ DataFileElement getFileByPathName(String userId, /** - * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx). + * Find data file by a full or partial path name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * pathName property. + * + * @param userId calling user + * @param pathName path name + * @param startFrom starting point in the list + * @param pageSize maximum number of results + * + * @return list of matching file properties + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getFilesByPathName(String userId, + String pathName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * qualifiedName, name and pathName property. * * @param userId calling user * @param pathName path name diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIProperties.java index f0997466584..fb9d9350a86 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/APIProperties.java @@ -47,12 +47,17 @@ public APIProperties(APIProperties template) public String toString() { return "APIProperties{" + - "displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/AssetProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/AssetProperties.java index 2c16583a1f9..8aa8b51894b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/AssetProperties.java @@ -29,8 +29,10 @@ public class AssetProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; - private String displayName = null; - private String description = null; + private String name = null; + private String versionIdentifier = null; + private String displayName = null; + private String description = null; @@ -53,20 +55,76 @@ public AssetProperties(AssetProperties template) if (template != null) { + name = template.getName(); + versionIdentifier = template.getVersionIdentifier(); displayName = template.getDisplayName(); description = template.getDescription(); } } + /** + * Return the name of the resource that this asset represents. + * + * @return string resource name + */ + public String getName() + { + if (name == null) + { + return displayName; + } + + return name; + } + + + /** + * Set up the name of the resource that this asset represents. + * + * @param name string resource name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored display name property for the asset. - * If no display name is available then null is returned. + * If no display name is available then name is returned. * * @return String name */ public String getDisplayName() { + if (displayName == null) + { + return name; + } + return displayName; } @@ -114,14 +172,18 @@ public void setDescription(String description) public String toString() { return "AssetProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", vendorProperties=" + getVendorProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; } @@ -138,19 +200,33 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description); + + if (name != null ? ! name.equals(that.name) : that.name != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + return description != null ? description.equals(that.description) : that.description == null; } + /** * Return hash code based on properties. * @@ -159,6 +235,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, description); + return Objects.hash(super.hashCode(), name, versionIdentifier, displayName, description); } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataFileProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataFileProperties.java index fa883f8acbe..e39d04941b1 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataFileProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataFileProperties.java @@ -81,7 +81,11 @@ public void setFileType(String fileType) public String toString() { return "DataFileProperties{" + - "fileType='" + fileType + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", fileType='" + fileType + '\'' + ", pathName='" + getPathName() + '\'' + ", createTime=" + getCreateTime() + ", modifiedTime=" + getModifiedTime() + @@ -89,10 +93,10 @@ public String toString() ", encodingLanguage='" + getEncodingLanguage() + '\'' + ", encodingDescription='" + getEncodingDescription() + '\'' + ", encodingProperties=" + getEncodingProperties() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + @@ -113,16 +117,18 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof DataFileProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + DataFileProperties that = (DataFileProperties) objectToCompare; - return Objects.equals(fileType, that.fileType); + + return fileType != null ? fileType.equals(that.fileType) : that.fileType == null; } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataSetProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataSetProperties.java index 36266524ac5..da22c352030 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataSetProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataSetProperties.java @@ -58,12 +58,17 @@ public DataSetProperties(DataSetProperties template) public String toString() { return "DataSetProperties{" + - "displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataStoreProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataStoreProperties.java index 677a4e06130..9f5660f1637 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataStoreProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DataStoreProperties.java @@ -255,17 +255,21 @@ public void setEncodingProperties(Map encodingProperties) public String toString() { return "DataStoreProperties{" + - "pathName=" + pathName + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", pathName='" + pathName + '\'' + ", createTime=" + createTime + ", modifiedTime=" + modifiedTime + ", encodingType='" + encodingType + '\'' + ", encodingLanguage='" + encodingLanguage + '\'' + ", encodingDescription='" + encodingDescription + '\'' + - ", encodingProperties='" + encodingProperties + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + + ", encodingProperties=" + encodingProperties + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + @@ -286,22 +290,42 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof DataStoreProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + DataStoreProperties that = (DataStoreProperties) objectToCompare; - return Objects.equals(pathName, that.pathName) && - Objects.equals(createTime, that.createTime) && - Objects.equals(modifiedTime, that.modifiedTime) && - Objects.equals(encodingType, that.encodingType) && - Objects.equals(encodingLanguage, that.encodingLanguage) && - Objects.equals(encodingDescription, that.encodingDescription) && - Objects.equals(encodingProperties, that.encodingProperties); + + if (pathName != null ? ! pathName.equals(that.pathName) : that.pathName != null) + { + return false; + } + if (createTime != null ? ! createTime.equals(that.createTime) : that.createTime != null) + { + return false; + } + if (modifiedTime != null ? ! modifiedTime.equals(that.modifiedTime) : that.modifiedTime != null) + { + return false; + } + if (encodingType != null ? ! encodingType.equals(that.encodingType) : that.encodingType != null) + { + return false; + } + if (encodingLanguage != null ? ! encodingLanguage.equals(that.encodingLanguage) : that.encodingLanguage != null) + { + return false; + } + if (encodingDescription != null ? ! encodingDescription.equals(that.encodingDescription) : that.encodingDescription != null) + { + return false; + } + return encodingProperties != null ? encodingProperties.equals(that.encodingProperties) : that.encodingProperties == null; } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseProperties.java index 931ad3cc12a..a58139e294d 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseProperties.java @@ -150,10 +150,10 @@ public void setDatabaseImportedFrom(String databaseImportedFrom) public String toString() { return "DatabaseProperties{" + - "databaseType='" + databaseType + '\'' + - ", databaseVersion='" + databaseVersion + '\'' + - ", databaseInstance='" + databaseInstance + '\'' + - ", databaseImportedFrom='" + databaseImportedFrom + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + ", pathName='" + getPathName() + '\'' + ", createTime=" + getCreateTime() + ", modifiedTime=" + getModifiedTime() + @@ -161,10 +161,14 @@ public String toString() ", encodingLanguage='" + getEncodingLanguage() + '\'' + ", encodingDescription='" + getEncodingDescription() + '\'' + ", encodingProperties=" + getEncodingProperties() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + + ", databaseType='" + databaseType + '\'' + + ", databaseVersion='" + databaseVersion + '\'' + + ", databaseInstance='" + databaseInstance + '\'' + + ", databaseImportedFrom='" + databaseImportedFrom + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + @@ -185,19 +189,30 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof DatabaseProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + DatabaseProperties that = (DatabaseProperties) objectToCompare; - return Objects.equals(databaseType, that.databaseType) && - Objects.equals(databaseVersion, that.databaseVersion) && - Objects.equals(databaseInstance, that.databaseInstance) && - Objects.equals(databaseImportedFrom, that.databaseImportedFrom); + + if (databaseType != null ? ! databaseType.equals(that.databaseType) : that.databaseType != null) + { + return false; + } + if (databaseVersion != null ? ! databaseVersion.equals(that.databaseVersion) : that.databaseVersion != null) + { + return false; + } + if (databaseInstance != null ? ! databaseInstance.equals(that.databaseInstance) : that.databaseInstance != null) + { + return false; + } + return databaseImportedFrom != null ? databaseImportedFrom.equals(that.databaseImportedFrom) : that.databaseImportedFrom == null; } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaProperties.java index a17baa9a010..5de406020f8 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaProperties.java @@ -47,13 +47,17 @@ public DatabaseSchemaProperties(DatabaseSchemaProperties template) public String toString() { return "DatabaseSchemaProperties{" + - "displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", vendorProperties=" + getVendorProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaTypeProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaTypeProperties.java index 6bd067a6c4d..a8ac69f1edf 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaTypeProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/DatabaseSchemaTypeProperties.java @@ -22,10 +22,6 @@ public class DatabaseSchemaTypeProperties extends ReferenceableProperties { private static final long serialVersionUID = 1L; - private String qualifiedName = null; - - - /** * Default constructor */ @@ -42,34 +38,6 @@ public DatabaseSchemaTypeProperties() public DatabaseSchemaTypeProperties(DatabaseSchemaTypeProperties template) { super(template); - - if (template != null) - { - qualifiedName = template.getQualifiedName(); - } - } - - - /** - * Returns the stored display name property for the asset. - * If no display name is available then null is returned. - * - * @return String name - */ - public String getQualifiedName() - { - return qualifiedName; - } - - - /** - * Set up the stored display name property for the asset. - * - * @param qualifiedName String name - */ - public void setQualifiedName(String qualifiedName) - { - this.qualifiedName = qualifiedName; } @@ -82,7 +50,7 @@ public void setQualifiedName(String qualifiedName) public String toString() { return "DatabaseSchemaTypeProperties{" + - "qualifiedName='" + qualifiedName + '\'' + + "qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + @@ -91,42 +59,4 @@ public String toString() ", 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 DatabaseSchemaTypeProperties)) - { - return false; - } - if (! super.equals(objectToCompare)) - { - return false; - } - DatabaseSchemaTypeProperties that = (DatabaseSchemaTypeProperties) objectToCompare; - return Objects.equals(qualifiedName, that.qualifiedName); - } - - - /** - * Return hash code based on properties. - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), qualifiedName); - } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FileFolderProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FileFolderProperties.java index 8f0a9d36465..6cf6d493ab2 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FileFolderProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FileFolderProperties.java @@ -48,17 +48,21 @@ public FileFolderProperties(FileFolderProperties template) public String toString() { return "FileFolderProperties{" + - "pathName='" + getPathName() + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", pathName='" + getPathName() + '\'' + ", createTime=" + getCreateTime() + ", modifiedTime=" + getModifiedTime() + ", encodingType='" + getEncodingType() + '\'' + ", encodingLanguage='" + getEncodingLanguage() + '\'' + ", encodingDescription='" + getEncodingDescription() + '\'' + ", encodingProperties=" + getEncodingProperties() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FormProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FormProperties.java index d0ff267f6f0..0a6d0f11cfd 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FormProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/FormProperties.java @@ -49,13 +49,17 @@ public FormProperties(FormProperties template) public String toString() { return "FormProperties{" + - "displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", vendorProperties=" + getVendorProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/QueryProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/QueryProperties.java index 28f3f79610a..f6e5d65bfa3 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/QueryProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/QueryProperties.java @@ -49,13 +49,17 @@ public QueryProperties(QueryProperties template) public String toString() { return "QueryProperties{" + - "displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", vendorProperties=" + getVendorProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + '}'; } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReportProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReportProperties.java index 9d7f70ec56d..4cea316e736 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReportProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/ReportProperties.java @@ -201,19 +201,27 @@ public void setLastModifier(String lastModifier) public String toString() { return "ReportProperties{" + - "displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", vendorProperties=" + getVendorProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", vendorProperties=" + getVendorProperties() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + ", id='" + id + '\'' + + ", author='" + author + '\'' + + ", url='" + url + '\'' + + ", createTime=" + createTime + + ", lastModifiedTime=" + lastModifiedTime + + ", lastModifier='" + lastModifier + '\'' + + '}'; } - - /** * Compare the values of the supplied object with those stored in the current object. * @@ -227,21 +235,38 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof ReportProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + ReportProperties that = (ReportProperties) objectToCompare; - return Objects.equals(id, that.id) && - Objects.equals(author, that.author) && - Objects.equals(url, that.url) && - Objects.equals(createTime, that.createTime) && - Objects.equals(lastModifiedTime, that.lastModifiedTime) && - Objects.equals(lastModifier, that.lastModifier); + + if (id != null ? ! id.equals(that.id) : that.id != null) + { + return false; + } + if (author != null ? ! author.equals(that.author) : that.author != null) + { + return false; + } + if (url != null ? ! url.equals(that.url) : that.url != null) + { + return false; + } + if (createTime != null ? ! createTime.equals(that.createTime) : that.createTime != null) + { + return false; + } + if (lastModifiedTime != null ? ! lastModifiedTime.equals(that.lastModifiedTime) : that.lastModifiedTime != null) + { + return false; + } + return lastModifier != null ? lastModifier.equals(that.lastModifier) : that.lastModifier == null; } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TemplateProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TemplateProperties.java index e3062ca92b7..de43c0c43f8 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TemplateProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TemplateProperties.java @@ -24,10 +24,13 @@ public class TemplateProperties implements Serializable { private static final long serialVersionUID = 1L; - private String qualifiedName = null; - private String displayName = null; - private String description = null; - private String networkAddress = null; + private String qualifiedName = null; + private String displayName = null; + private String versionIdentifier = null; + private String description = null; + private String pathName = null; + private String networkAddress = null; + /** * Default constructor @@ -47,10 +50,12 @@ public TemplateProperties(TemplateProperties template) { if (template != null) { - qualifiedName = template.getQualifiedName(); - displayName = template.getDisplayName(); - description = template.getDescription(); - networkAddress = template.getNetworkAddress(); + qualifiedName = template.getQualifiedName(); + displayName = template.getDisplayName(); + versionIdentifier = template.getVersionIdentifier(); + description = template.getDescription(); + pathName = template.getPathName(); + networkAddress = template.getNetworkAddress(); } } @@ -101,6 +106,28 @@ public void setDisplayName(String displayName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored description property for the metadata entity. * If no description is provided then null is returned. @@ -124,6 +151,28 @@ public void setDescription(String description) } + /** + * Return the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @return string name + */ + public String getPathName() + { + return pathName; + } + + + /** + * Set up the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @param pathName string name + */ + public void setPathName(String pathName) + { + this.pathName = pathName; + } + + /** * Return the physical network address of this metadata element (if this makes sense). * @@ -131,7 +180,7 @@ public void setDescription(String description) */ public String getNetworkAddress() { - return networkAddress; + return pathName; } @@ -142,7 +191,7 @@ public String getNetworkAddress() */ public void setNetworkAddress(String networkAddress) { - this.networkAddress = networkAddress; + this.pathName = networkAddress; } @@ -157,7 +206,9 @@ public String toString() return "TemplateProperties{" + "qualifiedName='" + qualifiedName + '\'' + ", displayName='" + displayName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", description='" + description + '\'' + + ", pathName='" + pathName + '\'' + ", networkAddress='" + networkAddress + '\'' + '}'; } @@ -176,15 +227,34 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TemplateProperties)) { return false; } + TemplateProperties that = (TemplateProperties) objectToCompare; - return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(networkAddress, that.networkAddress); + + if (qualifiedName != null ? ! qualifiedName.equals(that.qualifiedName) : that.qualifiedName != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (pathName != null ? ! pathName.equals(that.pathName) : that.pathName != null) + { + return false; + } + return networkAddress != null ? networkAddress.equals(that.networkAddress) : that.networkAddress == null; } @@ -196,6 +266,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, displayName, description, networkAddress); + return Objects.hash(qualifiedName, displayName, versionIdentifier, description, pathName, networkAddress); } } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TopicProperties.java b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TopicProperties.java index bbbf9237cce..efb9b289350 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TopicProperties.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-api/src/main/java/org/odpi/openmetadata/accessservices/datamanager/properties/TopicProperties.java @@ -80,14 +80,18 @@ public void setTopicType(String topicType) public String toString() { return "TopicProperties{" + - "topicType='" + topicType + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", topicType='" + topicType + '\'' + '}'; } @@ -105,16 +109,18 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TopicProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + TopicProperties that = (TopicProperties) objectToCompare; - return Objects.equals(topicType, that.topicType); + + return topicType != null ? topicType.equals(that.topicType) : that.topicType == 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 2bb7660e37f..6fd87ff93ac 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 @@ -143,7 +143,9 @@ public String toString() return "TemplateRequestBody{" + "qualifiedName='" + getQualifiedName() + '\'' + ", displayName='" + getDisplayName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", description='" + getDescription() + '\'' + + ", pathName='" + getPathName() + '\'' + ", networkAddress='" + getNetworkAddress() + '\'' + ", externalSourceGUID='" + externalSourceGUID + '\'' + ", externalSourceName='" + externalSourceName + '\'' + diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/pom.xml b/open-metadata-implementation/access-services/data-manager/data-manager-client/pom.xml index 3c52984b617..6207578ab44 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/pom.xml +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/pom.xml @@ -18,7 +18,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Data Manager OMAS Client diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java index f44d560ec9d..c190bf7670b 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/FilesAndFoldersClient.java @@ -299,18 +299,23 @@ public List addDataFileToCatalog(String userId, UserNotAuthorizedException, PropertyServerException { - final String methodName = "addDataFileToCatalog"; - final String propertiesParameterName = "dataFileProperties"; - final String qualifiedNameParameterName = "qualifiedName"; + final String methodName = "addDataFileToCatalog"; + final String propertiesParameterName = "dataFileProperties"; + final String pathNameParameterName = "pathName"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(dataFileProperties, propertiesParameterName, methodName); - invalidParameterHandler.validateName(dataFileProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + String pathName = this.getPathName(dataFileProperties.getPathName(), + dataFileProperties.getQualifiedName()); + + invalidParameterHandler.validateName(pathName, pathNameParameterName, methodName); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files"; DataFileRequestBody requestBody = new DataFileRequestBody(dataFileProperties); + requestBody.setPathName(pathName); requestBody.setConnectorProviderClassName(connectorProviderName); requestBody.setExternalSourceGUID(fileManagerCapabilityGUID); requestBody.setExternalSourceName(fileManagerCapabilityName); @@ -325,6 +330,28 @@ public List addDataFileToCatalog(String userId, } + /** + * In initial versions of this API, the qualified name was used to pass the path name. The qualified name is now generated by Egeria. + * To accommodate callers passing the path name via the qualified name, it is used as the path name if no explicit path name is supplied. + * + * @param suppliedPathName path name passed explicitly by the caller + * @param suppliedQualifiedName qualified name from the caller + * @return path name to use + */ + private String getPathName(String suppliedPathName, + String suppliedQualifiedName) + { + if (suppliedPathName != null) + { + return suppliedPathName; + } + else + { + return suppliedQualifiedName; + } + } + + /** * Add an asset description a file based on the content of a template object. Link this new asset to the folder structure implied in the path name. * If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. @@ -359,6 +386,10 @@ public List addDataFileToCatalogFromTemplate(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + + String pathName = this.getPathName(templateProperties.getPathName(), + templateProperties.getQualifiedName()); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files/from-template/{2}"; @@ -366,6 +397,7 @@ public List addDataFileToCatalogFromTemplate(String userId, TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); requestBody.setExternalSourceGUID(fileManagerCapabilityGUID); requestBody.setExternalSourceName(fileManagerCapabilityName); + requestBody.setPathName(pathName); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, urlTemplate, @@ -480,7 +512,7 @@ public void archiveDataFileInCatalog(String userId, * @param fileManagerCapabilityGUID unique identifier of the software server capability representing an owning external file manager or null * @param fileManagerCapabilityName unique name of the software server capability representing an owning external file manager or null * @param dataFileGUID unique identifier of the data file asset - * @param fullPathname unique path and file name for file + * @param fullPathname unique path and file name for file (optional) * * @throws InvalidParameterException one of the parameters is null or invalid * @throws PropertyServerException problem accessing property server @@ -497,11 +529,9 @@ public void deleteDataFileFromCatalog(String userId, { final String methodName = "deleteDataFileFromCatalog"; final String dataFileGUIDParameterName = "dataFileGUID"; - final String qualifiedNameParameterName = "fullPathname"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(dataFileGUID, dataFileGUIDParameterName, methodName); - invalidParameterHandler.validateName(fullPathname, qualifiedNameParameterName, methodName); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files/{2}/delete"; @@ -729,7 +759,7 @@ public void archiveDataFolderInCatalog(String userId, * @param fileManagerCapabilityGUID unique identifier of the software server capability representing an owning external file manager or null * @param fileManagerCapabilityName unique name of the software server capability representing an owning external file manager or null * @param dataFolderGUID unique identifier of the data folder asset - * @param fullPathname unique path and file name for file + * @param fullPathname unique path and file name for file (optional) * * @throws InvalidParameterException one of the parameters is null or invalid * @throws PropertyServerException problem accessing property server @@ -746,11 +776,9 @@ public void deleteDataFolderFromCatalog(String userId, { final String methodName = "deleteDataFolderFromCatalog"; final String guidParameterName = "dataFolderGUID"; - final String qualifiedNameParameterName = "fullPathname"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(dataFolderGUID, guidParameterName, methodName); - invalidParameterHandler.validateName(fullPathname, qualifiedNameParameterName, methodName); final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-folders/{2}/delete"; PathNameRequestBody requestBody = new PathNameRequestBody(); @@ -1285,7 +1313,57 @@ public DataFileElement getFileByPathName(String userId, /** - * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx). + * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * pathName property. + * + * @param userId calling user + * @param pathName path name + * @param startFrom starting point in the list + * @param pageSize maximum number of results + * + * @return list of matching file properties + * + * @throws InvalidParameterException one of the parameters is null or invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + @Override + public List getFilesByPathName(String userId, + String pathName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String methodName = "getFilesByPathName"; + final String nameParameterName = "pathName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(pathName, nameParameterName, methodName); + int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); + + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files/by-search-path-name?startFrom={3}&pageSize={4}"; + + PathNameRequestBody requestBody = new PathNameRequestBody(); + + requestBody.setFullPath(pathName); + + DataFilesResponse restResult = restClient.callDataFilesPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + pathName, + startFrom, + validatedPageSize); + + return restResult.getElementList(); + } + + + /** + * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * qualifiedName, name and pathName property. * * @param userId calling user * @param pathName path name @@ -1313,7 +1391,7 @@ public List findFilesByPathName(String userId, invalidParameterHandler.validateName(pathName, nameParameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files/by-search-path-name?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/data-files/by-search-name?startFrom={3}&pageSize={4}"; PathNameRequestBody requestBody = new PathNameRequestBody(); diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java index 94deb1eb291..ff297ab9f88 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/APIConverter.java @@ -72,7 +72,8 @@ public B getNewBean(Class beanClass, apiProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); apiProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - apiProperties.setDisplayName(this.removeName(instanceProperties)); + apiProperties.setName(this.removeName(instanceProperties)); + apiProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); apiProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java index 8e95ac9595b..397314455e3 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DataFileConverter.java @@ -73,7 +73,9 @@ public B getNewBean(Class beanClass, dataFileProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); dataFileProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - dataFileProperties.setDisplayName(this.removeName(instanceProperties)); + dataFileProperties.setName(this.removeName(instanceProperties)); + dataFileProperties.setDisplayName(dataFileProperties.getName()); + dataFileProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); dataFileProperties.setDescription(this.removeDescription(instanceProperties)); dataFileProperties.setPathName(this.removePathName(instanceProperties)); dataFileProperties.setCreateTime(this.removeStoreCreateTime(instanceProperties)); diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java index 3e8d54015fd..ce590a06e61 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseConverter.java @@ -71,7 +71,9 @@ public B getNewBean(Class beanClass, databaseProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); databaseProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - databaseProperties.setDisplayName(this.removeName(instanceProperties)); + databaseProperties.setName(this.removeName(instanceProperties)); + databaseProperties.setDisplayName(databaseProperties.getName()); + databaseProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); databaseProperties.setDescription(this.removeDescription(instanceProperties)); databaseProperties.setPathName(this.removePathName(instanceProperties)); databaseProperties.setCreateTime(this.removeStoreCreateTime(instanceProperties)); diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java index 27e9aa36f9b..03e4f475bc6 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/DatabaseSchemaConverter.java @@ -73,7 +73,9 @@ public B getNewBean(Class beanClass, databaseSchemaProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); databaseSchemaProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - databaseSchemaProperties.setDisplayName(this.removeName(instanceProperties)); + databaseSchemaProperties.setName(this.removeName(instanceProperties)); + databaseSchemaProperties.setDisplayName(databaseSchemaProperties.getName()); + databaseSchemaProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); databaseSchemaProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java index aa463209935..fc4e57b2851 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FileFolderConverter.java @@ -73,7 +73,9 @@ public B getNewBean(Class beanClass, fileFolderProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); fileFolderProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - fileFolderProperties.setDisplayName(this.removeName(instanceProperties)); + fileFolderProperties.setName(this.removeName(instanceProperties)); + fileFolderProperties.setDisplayName(fileFolderProperties.getName()); + fileFolderProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); fileFolderProperties.setDescription(this.removeDescription(instanceProperties)); fileFolderProperties.setPathName(this.removePathName(instanceProperties)); fileFolderProperties.setCreateTime(this.removeStoreCreateTime(instanceProperties)); diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java index 92962b87d45..15956950661 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/FormConverter.java @@ -72,7 +72,9 @@ public B getNewBean(Class beanClass, formProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); formProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - formProperties.setDisplayName(this.removeName(instanceProperties)); + formProperties.setName(this.removeName(instanceProperties)); + formProperties.setDisplayName(formProperties.getName()); + formProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); formProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java index ee8292d1bc2..4608621435f 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/QueryConverter.java @@ -72,7 +72,9 @@ public B getNewBean(Class beanClass, queryProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); queryProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - queryProperties.setDisplayName(this.removeName(instanceProperties)); + queryProperties.setName(this.removeName(instanceProperties)); + queryProperties.setDisplayName(queryProperties.getName()); + queryProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); queryProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java index 67eae08fcec..b99c0051ca4 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/ReportConverter.java @@ -72,7 +72,9 @@ public B getNewBean(Class beanClass, reportProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); reportProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - reportProperties.setDisplayName(this.removeName(instanceProperties)); + reportProperties.setName(this.removeName(instanceProperties)); + reportProperties.setDisplayName(reportProperties.getName()); + reportProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); reportProperties.setDescription(this.removeDescription(instanceProperties)); reportProperties.setId(this.removeId(instanceProperties)); diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java index bc91c31fe97..10c7c8ede34 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/converters/TopicConverter.java @@ -72,7 +72,9 @@ public B getNewBean(Class beanClass, topicProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); topicProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - topicProperties.setDisplayName(this.removeName(instanceProperties)); + topicProperties.setName(this.removeName(instanceProperties)); + topicProperties.setDisplayName(topicProperties.getName()); + topicProperties.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); topicProperties.setDescription(this.removeDescription(instanceProperties)); topicProperties.setTopicType(this.removeTopicType(instanceProperties)); diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/APIManagerRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/APIManagerRESTServices.java index 7fcf39a8654..991f7f10e4f 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/APIManagerRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/APIManagerRESTServices.java @@ -108,13 +108,14 @@ public GUIDResponse createAPI(String serverName, handler.getExternalSourceID(apiManagerIsHome, requestBody.getExternalSourceName()), requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), InstanceStatus.ACTIVE, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -235,7 +236,9 @@ public GUIDResponse createAPIFromTemplate(String serverName, requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + null, requestBody.getNetworkAddress(), false, false, @@ -346,6 +349,7 @@ public VoidResponse updateAPI(String serverName, apiGUIDParameterName, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DatabaseManagerRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DatabaseManagerRESTServices.java index 2fd49530c4f..df46df78fee 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DatabaseManagerRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DatabaseManagerRESTServices.java @@ -86,11 +86,18 @@ public GUIDResponse createDatabase(String serverName, { DatabaseProperties databaseProperties = (DatabaseProperties)requestBody.getProperties(); + String name = databaseProperties.getName(); + + if (name == null) + { + name = databaseProperties.getDisplayName(); + } String databaseGUID = handler.createDatabase(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), databaseProperties.getQualifiedName(), - databaseProperties.getDisplayName(), + name, + databaseProperties.getVersionIdentifier(), databaseProperties.getDescription(), databaseProperties.getPathName(), databaseProperties.getCreateTime(), @@ -181,7 +188,9 @@ public GUIDResponse createDatabaseFromTemplate(String serverName, templateGUID, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + requestBody.getPathName(), requestBody.getNetworkAddress(), false, false, @@ -254,7 +263,9 @@ public VoidResponse updateDatabase(String serverName, databaseGUID, databaseProperties.getQualifiedName(), databaseProperties.getDisplayName(), + databaseProperties.getVersionIdentifier(), databaseProperties.getDescription(), + databaseProperties.getPathName(), databaseProperties.getCreateTime(), databaseProperties.getModifiedTime(), databaseProperties.getEncodingType(), @@ -787,6 +798,7 @@ public GUIDResponse createDatabaseSchema(String serverName, requestBody.getParentGUID(), databaseSchemaProperties.getQualifiedName(), databaseSchemaProperties.getDisplayName(), + databaseSchemaProperties.getVersionIdentifier(), databaseSchemaProperties.getDescription(), databaseSchemaProperties.getAdditionalProperties(), databaseSchemaProperties.getTypeName(), @@ -867,6 +879,7 @@ public GUIDResponse createDatabaseSchemaFromTemplate(String serverN requestBody.getParentGUID(), requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), null, null, @@ -941,6 +954,7 @@ public VoidResponse updateDatabaseSchema(String serverName, databaseSchemaGUID, databaseSchemaProperties.getQualifiedName(), databaseSchemaProperties.getDisplayName(), + databaseSchemaProperties.getVersionIdentifier(), databaseSchemaProperties.getDescription(), null, 0, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DisplayApplicationRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DisplayApplicationRESTServices.java index 897403092da..fdab31a19dc 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DisplayApplicationRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/DisplayApplicationRESTServices.java @@ -105,13 +105,14 @@ public GUIDResponse createForm(String serverName, handler.getExternalSourceID(applicationIsHome, requestBody.getExternalSourceName()), requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), InstanceStatus.ACTIVE, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -207,7 +208,9 @@ public GUIDResponse createFormFromTemplate(String serverName, requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + null, requestBody.getNetworkAddress(), false, false, @@ -299,12 +302,13 @@ public VoidResponse updateForm(String serverName, formGUIDParameterName, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), isMergeUpdate, false, false, @@ -838,13 +842,14 @@ public GUIDResponse createReport(String serverName, handler.getExternalSourceID(applicationIsHome, requestBody.getExternalSourceName()), requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, extendedProperties, InstanceStatus.ACTIVE, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -951,7 +956,9 @@ public GUIDResponse createReportFromTemplate(String serverName, requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + null, requestBody.getNetworkAddress(), false, false, @@ -1090,12 +1097,13 @@ public VoidResponse updateReport(String serverName, reportGUIDParameterName, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, extendedProperties, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), isMergeUpdate, false, false, @@ -1587,13 +1595,14 @@ public GUIDResponse createQuery(String serverName, handler.getExternalSourceID(applicationIsHome, requestBody.getExternalSourceName()), requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), InstanceStatus.ACTIVE, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -1700,7 +1709,9 @@ public GUIDResponse createQueryFromTemplate(String serverName, requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + null, requestBody.getNetworkAddress(), false, false, @@ -1797,12 +1808,13 @@ public VoidResponse updateQuery(String serverName, queryGUIDParameterName, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), isMergeUpdate, false, false, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/EventBrokerRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/EventBrokerRESTServices.java index 60dd7423798..2a996210d52 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/EventBrokerRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/EventBrokerRESTServices.java @@ -117,13 +117,14 @@ public GUIDResponse createTopic(String serverName, requestBody.getExternalSourceName(), requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, extendedProperties, InstanceStatus.ACTIVE, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -156,13 +157,14 @@ public GUIDResponse createTopic(String serverName, null, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, extendedProperties, InstanceStatus.ACTIVE, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -267,7 +269,9 @@ public GUIDResponse createTopicFromTemplate(String serverName, requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + null, requestBody.getNetworkAddress(), false, false, @@ -377,12 +381,13 @@ public VoidResponse updateTopic(String serverName, topicGUIDParameterName, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, extendedProperties, - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), isMergeUpdate, false, false, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java index 167b86db749..c6420d7e2a0 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-server/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/FilesRESTServices.java @@ -276,11 +276,19 @@ public GUIDListResponse addDataFileToCatalog(String serverName, FilesAndFoldersHandler handler = instanceHandler.getFilesAndFoldersHandler(userId, serverName, methodName); + String pathName = requestBody.getPathName(); + + if (pathName == null) + { + pathName = requestBody.getQualifiedName(); + } + response.setGUIDs(handler.addFileToCatalog(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), - requestBody.getQualifiedName(), + pathName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getPathName(), requestBody.getCreateTime(), @@ -355,12 +363,20 @@ public GUIDListResponse addDataFileToCatalogFromTemplate(String ser FilesAndFoldersHandler handler = instanceHandler.getFilesAndFoldersHandler(userId, serverName, methodName); + String pathName = requestBody.getPathName(); + + if (pathName == null) + { + pathName = requestBody.getQualifiedName(); + } + response.setGUIDs(handler.addFileToCatalogFromTemplate(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), templateGUID, - requestBody.getQualifiedName(), + pathName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), false, false, @@ -426,6 +442,7 @@ public VoidResponse updateDataFileInCatalog(String serverName, isMergeUpdate, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getCreateTime(), requestBody.getModifiedTime(), @@ -561,7 +578,6 @@ public VoidResponse deleteDataFileFromCatalog(String serverName, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), dataFileGUID, - requestBody.getFullPath(), false, false, new Date(), @@ -621,11 +637,13 @@ public GUIDListResponse addDataFolderAssetToCatalog(String server FilesAndFoldersHandler handler = instanceHandler.getFilesAndFoldersHandler(userId, serverName, methodName); + response.setGUIDs(handler.addDataFolderAssetToCatalog(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), requestBody.getQualifiedName(), - requestBody.getDisplayName(), + requestBody.getName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getCreateTime(), requestBody.getModifiedTime(), @@ -637,8 +655,8 @@ public GUIDListResponse addDataFolderAssetToCatalog(String server requestBody.getConnectorProviderClassName(), requestBody.getTypeName(), requestBody.getExtendedProperties(), - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), false, false, new Date(), @@ -706,6 +724,7 @@ public GUIDListResponse addDataFolderToCatalogFromTemplate(String s templateGUID, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), false, false, @@ -769,8 +788,9 @@ public VoidResponse updateDataFolderInCatalog(String serverName, requestBody.getExternalSourceName(), dataFolderGUID, isMergeUpdate, - requestBody.getQualifiedName(), + requestBody.getPathName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getCreateTime(), requestBody.getModifiedTime(), @@ -906,7 +926,6 @@ public VoidResponse deleteDataFolderFromCatalog(String serverName, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), dataFolderGUID, - requestBody.getFullPath(), false, false, new Date(), @@ -1746,6 +1765,69 @@ public DataFileResponse getDataFileByPathName(String serverName, } + + /** + * Find data file by a full or partial path name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * pathName property. + * + * @param serverName name of calling server + * @param userId calling user + * @param startingFrom starting point in the list + * @param maxPageSize maximum number of results + * @param requestBody path name + * + * @return data file properties or + * InvalidParameterException one of the parameters is null or invalid or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem. + */ + public DataFilesResponse getDataFilesByPathName(String serverName, + String userId, + int startingFrom, + int maxPageSize, + PathNameRequestBody requestBody) + { + final String methodName = "getDataFileByPathName"; + final String nameParameterName = "fullPath"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + DataFilesResponse response = new DataFilesResponse(); + AuditLog auditLog = null; + + try + { + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + FilesAndFoldersHandler handler = + instanceHandler.getFilesAndFoldersHandler(userId, serverName, methodName); + + List dataFiles = handler.findDataFilesByPathName(userId, + requestBody.getFullPath(), + nameParameterName, + startingFrom, + maxPageSize, + false, + false, + new Date(), + methodName); + + response.setElementList(dataFiles); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } + + restCallLogger.logRESTCallReturn(token, response.toString()); + + return response; + } + + /** * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx). * diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/FilesResource.java b/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/FilesResource.java index 5db009bda1a..d3be003a6f6 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/FilesResource.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/datamanager/server/spring/FilesResource.java @@ -734,6 +734,33 @@ public DataFileResponse getDataFileByPathName(@PathVariable String */ @PostMapping(path = "/data-files/by-search-path-name") + public DataFilesResponse getDataFilesByPathName(@PathVariable String serverName, + @PathVariable String userId, + @RequestParam int startingFrom, + @RequestParam int maxPageSize, + @RequestBody PathNameRequestBody requestBody) + { + return restAPI.getDataFilesByPathName(serverName, userId, startingFrom, maxPageSize, requestBody); + } + + + + /** + * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx). + * + * @param serverName name of calling server + * @param userId calling user + * @param startingFrom starting point in the list + * @param maxPageSize maximum number of results + * @param requestBody path name + * + * @return data file properties or + * InvalidParameterException one of the parameters is null or invalid or + * PropertyServerException problem accessing property server or + * UserNotAuthorizedException security access problem. + */ + @PostMapping(path = "/data-files/by-search-name") + public DataFilesResponse findDataFilesByPathName(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startingFrom, diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/AssetProperties.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/AssetProperties.java index 68749c34dde..0828ef82511 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/AssetProperties.java @@ -31,8 +31,9 @@ public class AssetProperties extends ConfigurationItemProperties { private static final long serialVersionUID = 1L; - private String displayName = null; - private String description = null; + private String name = null; + private String versionIdentifier = null; + private String description = null; /** @@ -54,7 +55,8 @@ public AssetProperties(AssetProperties template) if (template != null) { - displayName = template.getDisplayName(); + name = template.getName(); + versionIdentifier = template.getVersionIdentifier(); description = template.getDescription(); } } @@ -86,23 +88,46 @@ public AssetProperties cloneToAsset(String subTypeName) * * @return String name */ - public String getDisplayName() + public String getName() { - return displayName; + return name; } /** * Set up the stored display name property for the asset. * - * @param displayName String name + * @param name String name */ - public void setDisplayName(String displayName) + public void setName(String name) { - this.displayName = displayName; + this.name = name; } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + + /** * Returns the stored description property for the asset. * If no description is provided then null is returned. @@ -135,7 +160,8 @@ public void setDescription(String description) public String toString() { return "AssetProperties{" + - "displayName='" + displayName + '\'' + + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", description='" + description + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + @@ -161,19 +187,27 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } - AssetProperties asset = (AssetProperties) objectToCompare; - return Objects.equals(getDisplayName(), asset.getDisplayName()) && - Objects.equals(getDescription(), asset.getDescription()); - } + AssetProperties that = (AssetProperties) objectToCompare; + + if (name != null ? ! name.equals(that.name) : that.name != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + return description != null ? description.equals(that.description) : that.description == null; + } /** @@ -184,6 +218,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getDisplayName(), getDescription()); + return Objects.hash(super.hashCode(), getName(), getVersionIdentifier(), getDescription()); } } diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/HostProperties.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/HostProperties.java index 6c72f4d3035..8fb4e63d1f5 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/HostProperties.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/HostProperties.java @@ -86,7 +86,7 @@ public AssetProperties cloneToAsset(String subTypeName) public String toString() { return "HostProperties{" + - "displayName='" + getDisplayName() + '\'' + + "displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/ITInfrastructureProperties.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/ITInfrastructureProperties.java index 8779baa7484..056219bb95f 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/ITInfrastructureProperties.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/ITInfrastructureProperties.java @@ -85,7 +85,7 @@ public AssetProperties cloneToAsset(String subTypeName) public String toString() { return "ITInfrastructureProperties{" + - "displayName='" + getDisplayName() + '\'' + + "displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerPlatformProperties.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerPlatformProperties.java index b1e04b9ee02..5cc3988010b 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerPlatformProperties.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerPlatformProperties.java @@ -271,7 +271,7 @@ public String toString() ", softwareServerVersion='" + getSoftwareServerPlatformVersion() + '\'' + ", softwareServerSource='" + getSoftwareServerPlatformSource() + '\'' + ", softwareServerUserId='" + getSoftwareServerPlatformUserId() + '\'' + - ", displayName='" + getDisplayName() + '\'' + + ", displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerProperties.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerProperties.java index c398080d2a0..bcf9b79da16 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerProperties.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/properties/SoftwareServerProperties.java @@ -265,7 +265,7 @@ public String toString() ", softwareServerVersion='" + softwareServerVersion + '\'' + ", softwareServerSource='" + softwareServerSource + '\'' + ", softwareServerUserId='" + softwareServerUserId + '\'' + - ", displayName='" + getDisplayName() + '\'' + + ", displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/AssetRequestBody.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/AssetRequestBody.java index 55e1bad2444..77866ca61d7 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/AssetRequestBody.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/AssetRequestBody.java @@ -120,7 +120,7 @@ public String toString() return "AssetRequestBody{" + "externalSourceGUID='" + externalSourceGUID + '\'' + ", externalSourceName='" + externalSourceName + '\'' + - ", displayName='" + getDisplayName() + '\'' + + ", displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/HostRequestBody.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/HostRequestBody.java index f1bf1a232ac..117ccea23e5 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/HostRequestBody.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/HostRequestBody.java @@ -120,7 +120,7 @@ public String toString() return "HostRequestBody{" + "externalSourceGUID='" + externalSourceGUID + '\'' + ", externalSourceName='" + externalSourceName + '\'' + - ", displayName='" + getDisplayName() + '\'' + + ", displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerPlatformRequestBody.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerPlatformRequestBody.java index 7e5e32b931d..e3e4db6653a 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerPlatformRequestBody.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerPlatformRequestBody.java @@ -124,7 +124,7 @@ public String toString() ", softwareServerVersion='" + getSoftwareServerPlatformVersion() + '\'' + ", softwareServerSource='" + getSoftwareServerPlatformSource() + '\'' + ", softwareServerUserId='" + getSoftwareServerPlatformUserId() + '\'' + - ", displayName='" + getDisplayName() + '\'' + + ", displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerRequestBody.java b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerRequestBody.java index c9644322977..32a3880a8ca 100644 --- a/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerRequestBody.java +++ b/open-metadata-implementation/access-services/dev-ops/dev-ops-api/src/main/java/org/odpi/openmetadata/accessservices/devops/rest/SoftwareServerRequestBody.java @@ -124,7 +124,7 @@ public String toString() ", softwareServerVersion='" + getSoftwareServerVersion() + '\'' + ", softwareServerSource='" + getSoftwareServerSource() + '\'' + ", softwareServerUserId='" + getSoftwareServerUserId() + '\'' + - ", displayName='" + getDisplayName() + '\'' + + ", displayName='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/digital-service/README.md b/open-metadata-implementation/access-services/digital-service/README.md index bdf8f9c39e1..a5dabba717e 100644 --- a/open-metadata-implementation/access-services/digital-service/README.md +++ b/open-metadata-implementation/access-services/digital-service/README.md @@ -5,28 +5,8 @@ # Digital Service Open Metadata Access Service (OMAS) -The Digital Service OMAS supports the business owners as they track the development and use of -digital services that support the operation of the organization. - -Digital services are business services that are implemented in software. An example of a digital service -is one that allows a customer to buy a product from the organization. - -Digital services are implemented using a variety of software components. These components are defined and deployed -using the [Software Developer OMAS](../software-developer) and [DevOps OMAS](../dev-ops) respectively. - -The Digital Service OMAS is responsible for: - -* Recording the key business capabilities of the organization - with particular focus on those business -capabilities involved in the business transformation. -* Assigning the owner of each business capability. -* Linking the business capability to the governance definitions defined by the [governance program](../governance-program). -* For each business capability, defining the digital services that support it. -* Assigning ownership to each digital service. -* Supporting the owner of a digital service throughout the digital service's lifecycle. -* Supporting the business capability owners with the ability to review the status of the digital services within -their business capability. - -* [Documentation](https://egeria-project.org/services/omas/digital-service/overview) +The Digital Service OMAS is responsible for supporting a digital service manager in the management of [digital services and digital products](https://egeria-project.org/types/7/0710-Digital-Service/). +The documentation for this service is on the main [Egeria documentation site](https://egeria-project.org/services/omas/digital-service/overview). ## Design @@ -35,7 +15,7 @@ The module structure for the Digital Service OMAS is as follows: * [digital-service-api](digital-service-api) supports the common Java classes that are used both by the client and the server. * [digital-service-client](digital-service-client) supports the client library. * [digital-service-server](digital-service-server) supports in implementation of the access service and its related event management. -* [digital-service-spring](digital-service-spring) supports the REST API using the [Spring](../../../developer-resources/Spring.md) libraries. +* [digital-service-spring](digital-service-spring) supports the REST API using the [Spring](https://egeria-project.org/guides/contributor/runtime/) libraries. ---- diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/BusinessCapabilityManagement.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/BusinessCapabilityManagement.java index f67c032b3dd..f347df9d0be 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/BusinessCapabilityManagement.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/BusinessCapabilityManagement.java @@ -16,6 +16,8 @@ /** * BusinessCapabilityManagement supports the maintenance, linking and reporting associated with business capabilities. + * Business capabilities can be modelled at any level of granularity. They provide business context to + * reports and measurements associated with the open metadata ecosystem and the data and technology it represents. */ public interface BusinessCapabilityManagement { @@ -136,7 +138,6 @@ void clearOrganizationalCapability(String userId, PropertyServerException; - /** * Create a relationship between a business capability and a team to show that the support provided by the team for the business capability. * @@ -204,8 +205,6 @@ void removeBusinessCapability(String userId, PropertyServerException; - - /** * Retrieve the list of metadata elements that contain the search string. * The search string is treated as a regular expression. @@ -294,7 +293,6 @@ List getOrganizationalCapability(String userId, PropertyServerException; - /** * Return information about the digital services supporting a business capability. * diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalRolesInterface.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalRolesInterface.java index 63ca9734430..89337e6dcd7 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalRolesInterface.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalRolesInterface.java @@ -4,9 +4,11 @@ +import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.AgreementRoleAppointee; import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.PersonRoleAppointee; import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.PersonRoleElement; import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.PersonRoleHistory; +import org.odpi.openmetadata.accessservices.digitalservice.properties.AgreementRoleProperties; import org.odpi.openmetadata.accessservices.digitalservice.properties.PersonRoleProperties; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -16,14 +18,20 @@ import java.util.List; /** - * DigitalRolesInterface covers the definition of person roles and their appointments. + * DigitalRolesInterface covers the definition of person roles and their appointments. This is to define the digital service managers and + * the roles associated with agreement. */ public interface DigitalRolesInterface { /** - * Create a definition of a new role. + * Create a definition of a new role for the manager of a digital service. The role is anchored to the digital service and will be deleted + * automatically when the digital service is deleted. It can be managed using the methods below before that. + * A person can be appointed to ths role using the appointPersonRole method. + * + * More general support for creating roles is found in Community Profile OMAS and Governance Program OMAS. * * @param userId calling user + * @param digitalServiceGUID unique identifier of the digital service to connect the new role to * @param properties role properties * * @return unique identifier of new role @@ -32,13 +40,47 @@ public interface DigitalRolesInterface * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - String createPersonRole(String userId, - PersonRoleProperties properties) throws UserNotAuthorizedException, - InvalidParameterException, - PropertyServerException; + String createDigitalServiceManagerRole(String userId, + String digitalServiceGUID, + PersonRoleProperties properties) throws UserNotAuthorizedException, + InvalidParameterException, + PropertyServerException; + + + /** + * Create a definition of a new role that is part of an agreement such as a digital subscription. + * + * These roles are often referred to in the agreement. For example, the agreement may refer to the subscriber, payer, data consumer. + * The name of such a role is stored in the agreementRoleProperties. The properties of the person role that is created to represent + * the role is stored in personRoleProperties. A person (or multiple people) can be appointed to the new role using the + * appointPersonRole method. + * + * The new person role created is anchored to the agreement and so it is deleted when the agreement is deleted. + * It can be managed using the methods below before that. + * + * More general support for creating roles is found in Community Profile OMAS and Governance Program OMAS. + * + * @param userId calling user + * @param agreementGUID unique identifier of the agreement + * @param agreementRoleProperties description of a role found in the agreement text + * @param personRoleProperties properties to use when creating the role. + * + * @return unique identifier of new role + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + String createAgreementRole(String userId, + String agreementGUID, + AgreementRoleProperties agreementRoleProperties, + PersonRoleProperties personRoleProperties) throws UserNotAuthorizedException, + InvalidParameterException, + PropertyServerException; /** + * Update the properties of a specific person role. * * @param userId calling user * @param roleGUID identifier of the person role to update @@ -58,7 +100,29 @@ void updatePersonRole(String userId, /** - * Delete the properties of the person role. + * Update the name of the role for a specific agreement. + * + * @param userId calling user + * @param agreementGUID unique identifier of the agreement + * @param roleGUID identifier of the person role + * @param isMergeUpdate are unspecified properties unchanged (true) or replaced with null? + * @param agreementRoleProperties properties to change + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void updateAgreementRole(String userId, + String agreementGUID, + String roleGUID, + boolean isMergeUpdate, + AgreementRoleProperties agreementRoleProperties) throws UserNotAuthorizedException, + InvalidParameterException, + PropertyServerException; + + + /** + * Delete the person role. * * @param userId calling user * @param personRoleGUID identifier of the person role to delete @@ -154,25 +218,46 @@ List getPersonRolesByTitle(String userId, * Return all the person roles and their incumbents (if any). * * @param userId the name of the calling user. - * @param domainIdentifier identifier of domain - 0 means all + * @param digitalServiceGUID unique identifier of the digital service to connect the new role to * @param startFrom where to start from in the list of definitions * @param pageSize max number of results to return in one call * - * @return list of person role objects + * @return list of person role objects with details of the people appointed to the roles (if any) + * @throws InvalidParameterException the userId is either null or invalid. + * @throws PropertyServerException the server is not available. + * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. + */ + List getDigitalServiceManagers(String userId, + String digitalServiceGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + + /** + * Return all the person roles and their incumbents (if any). + * + * @param userId the name of the calling user. + * @param agreementGUID unique identifier of the agreement + * @param startFrom where to start from in the list of definitions + * @param pageSize max number of results to return in one call + * + * @return list of person role objects with details of the people appointed to the roles (if any) * @throws InvalidParameterException the userId is either null or invalid. * @throws PropertyServerException the server is not available. * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. */ - List getCurrentPersonRoleAppointments(String userId, - int domainIdentifier, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException; + List getAgreementRoles(String userId, + String agreementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; /** - * Link a person to a person role. Only one person may be appointed at any one time. + * Link a person to a person role. * * @param userId the name of the calling user * @param roleGUID unique identifier (guid) of the person role @@ -198,7 +283,9 @@ String appointPersonRole(String userId, * @param userId the name of the calling user * @param roleGUID unique identifier (guid) of the person role * @param profileGUID unique identifier for the profile - * @param appointmentGUID unique identifier (guid) of the appointment relationship + * @param appointmentGUID unique identifier (guid) of the appointment relationship created by appointPersonRole - + * this is returned by appointPersonRole and can be retrieved by the getDigitalServiceManagers or + * getAgreementRoles depending on the type of role. * @param endDate the official end of the appointment - null means effective immediately * * @throws InvalidParameterException the profile is not linked to this person role diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalServicesInterface.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalServicesInterface.java index ee75aa82f88..a478d9a1745 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalServicesInterface.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/DigitalServicesInterface.java @@ -14,7 +14,9 @@ import java.util.List; /** - * The DigitalServicesInterface supports the management of digital services. + * The DigitalServicesInterface supports the management of digital services. The DigitalRolesInterface supports + * the appointment of digital service managers. The BusinessCapabilityManagement associates business capabilities + * with the digital services. */ public interface DigitalServicesInterface { @@ -125,10 +127,48 @@ void setupDigitalServiceDependency(String userId, */ void clearDigitalServiceDependency(String userId, String digitalServiceGUID, - String dependentDigitalServiceGUID, - String relationshipTypeName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException; + String dependentDigitalServiceGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Create a link to show that an organization has responsibility in operating a digital service. + * If the link already exists the properties are updated. + * + * @param userId calling user + * @param digitalServiceGUID unique identifier of the digital service + * @param organizationGUID unique identifier of the organization operating the digital service + * @param properties description of the scope of responsibilities that the organization has in the operation of the digital service + * + * @throws InvalidParameterException one of the guids is null or not known + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void setupDigitalServiceOperator(String userId, + String digitalServiceGUID, + String organizationGUID, + DigitalServiceDependencyProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove the dependency link between two digital services. + * + * @param userId calling user + * @param digitalServiceGUID unique identifier of the digital service + * @param organizationGUID unique identifier of the organization operating the digital service + * + * @throws InvalidParameterException one of the guids is null or not known + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void clearDigitalServiceOperator(String userId, + String digitalServiceGUID, + String organizationGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; /** * Retrieve the list of metadata elements that contain the search string. diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/SubjectAreasInterface.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/SubjectAreasInterface.java new file mode 100644 index 00000000000..ed5adb6ab24 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/api/SubjectAreasInterface.java @@ -0,0 +1,116 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.api; + +import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.SubjectAreaElement; +import org.odpi.openmetadata.accessservices.digitalservice.properties.SubjectAreaClassificationProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; + +import java.util.List; + +/** + * Subject areas group data into topic areas. This makes it easier to manage common definitions such as + * glossary terms, reference data and governance definitions that are specific to a certain type of data. + * The SubjectArea classification can be added to digital services and digital products. + */ +public interface SubjectAreasInterface +{ + /** + * Return information about a specific subject area. + * + * @param userId calling user + * @param subjectAreaName unique name for the subject area + * + * @return properties of the subject area + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + SubjectAreaElement getSubjectAreaByName(String userId, + String subjectAreaName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the defined subject areas. + * + * @param userId calling user + * @param domainIdentifier identifier for the desired governance domain - if 0 then all subject areas are returned + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return properties of the subject areas + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getSubjectAreas(String userId, + int domainIdentifier, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Add a subject area classification to a referenceable element. + * + * @param userId calling user + * @param elementGUID unique identifier for the element + * @param properties identifier for a subject area + * + * @throws InvalidParameterException qualifiedName or userId is null; qualifiedName is not unique + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void addSubjectAreaMemberClassification(String userId, + String elementGUID, + SubjectAreaClassificationProperties properties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Remove a subject area classification from a referenceable. + * + * @param userId calling user + * @param elementGUID unique identifier for the element + * + * @throws InvalidParameterException guid or userId is null; guid is not known + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + void deleteSubjectAreaMemberClassification(String userId, + String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; + + + /** + * Return information about the contents of a subject area such as the digital services, digital products, + * glossaries, reference data sets and quality definitions. + * + * @param userId calling user + * @param subjectAreaName unique identifier for the subject area + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return properties of the subject area members + * + * @throws InvalidParameterException qualifiedName or userId is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + List getMembersOfSubjectArea(String userId, + String subjectAreaName, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException; +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/AgreementRoleAppointee.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/AgreementRoleAppointee.java new file mode 100644 index 00000000000..4124ad084f4 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/AgreementRoleAppointee.java @@ -0,0 +1,141 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import org.odpi.openmetadata.accessservices.digitalservice.properties.AgreementRoleProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * PersonRoleAppointee is the bean used to return a role and current appointee(s). + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class AgreementRoleAppointee extends PersonRoleAppointee +{ + private static final long serialVersionUID = 1L; + + private AgreementRoleProperties agreementRoleProperties = null; + + + /** + * Default constructor + */ + public AgreementRoleAppointee() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AgreementRoleAppointee(AgreementRoleAppointee template) + { + super(template); + + if (template != null) + { + agreementRoleProperties = template.getAgreementRoleProperties(); + } + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public AgreementRoleAppointee(PersonRoleElement template) + { + super(template); + } + + + /** + * Return the role information from the agreement. + * + * @return agreement role properties + */ + public AgreementRoleProperties getAgreementRoleProperties() + { + return agreementRoleProperties; + } + + + /** + * Set up the role information from the agreement. + * + * @param agreementRoleProperties agreement role properties + */ + public void setAgreementRoleProperties(AgreementRoleProperties agreementRoleProperties) + { + this.agreementRoleProperties = agreementRoleProperties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "AgreementRoleAppointee{" + + "agreementRoleProperties=" + agreementRoleProperties + + ", currentAppointees=" + getCurrentAppointees() + + ", elementHeader=" + getElementHeader() + + ", properties=" + getProperties() + + '}'; + } + + + /** + * 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; + } + AgreementRoleAppointee that = (AgreementRoleAppointee) objectToCompare; + return Objects.equals(agreementRoleProperties, that.agreementRoleProperties); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), agreementRoleProperties); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleAppointee.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleAppointee.java index 6cd75f72d58..9ec63b277ac 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleAppointee.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleAppointee.java @@ -26,7 +26,8 @@ include = JsonTypeInfo.As.PROPERTY, property = "class") @JsonSubTypes({ - @JsonSubTypes.Type(value = PersonRoleHistory.class, name = "PersonRoleHistory") + @JsonSubTypes.Type(value = PersonRoleHistory.class, name = "PersonRoleHistory"), + @JsonSubTypes.Type(value = AgreementRoleAppointee.class, name = "AgreementRoleAppointee"), }) public class PersonRoleAppointee extends PersonRoleElement { @@ -115,7 +116,6 @@ public String toString() "currentAppointees=" + currentAppointees + ", elementHeader=" + getElementHeader() + ", properties=" + getProperties() + - ", relatedElement=" + getRelatedElement() + '}'; } diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleElement.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleElement.java index 21ff3b10b12..19a2a6ea7f5 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleElement.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleElement.java @@ -27,7 +27,6 @@ public class PersonRoleElement implements MetadataElement, Serializable private ElementHeader elementHeader = null; private PersonRoleProperties properties = null; - private RelatedElement relatedElement = null; /** @@ -50,7 +49,6 @@ public PersonRoleElement(PersonRoleElement template) { elementHeader = template.getElementHeader(); properties = template.getProperties(); - relatedElement = template.getRelatedElement(); } } @@ -101,30 +99,6 @@ public void setProperties(PersonRoleProperties properties) } - /** - * Return details of the relationship used to retrieve this element. - * Will be null if the element was retrieved directly rather than via a relationship. - * - * @return list of element stubs - */ - public RelatedElement getRelatedElement() - { - return relatedElement; - } - - - /** - * Set up details of the relationship used to retrieve this element. - * Will be null if the element was retrieved directly rather than via a relationship. - * - * @param relatedElement relationship details - */ - public void setRelatedElement(RelatedElement relatedElement) - { - this.relatedElement = relatedElement; - } - - /** * JSON-style toString * @@ -136,7 +110,6 @@ public String toString() return "PersonRoleElement{" + "elementHeader=" + elementHeader + ", properties=" + properties + - ", relatedElement=" + relatedElement + '}'; } @@ -160,8 +133,7 @@ public boolean equals(Object objectToCompare) } PersonRoleElement that = (PersonRoleElement) objectToCompare; return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(properties, that.properties) && - Objects.equals(relatedElement, that.relatedElement); + Objects.equals(properties, that.properties); } @@ -173,6 +145,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), elementHeader, properties, relatedElement); + return Objects.hash(super.hashCode(), elementHeader, properties); } } diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleHistory.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleHistory.java index 6cb2b9bda36..46a7db59334 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleHistory.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/PersonRoleHistory.java @@ -120,7 +120,6 @@ public String toString() "currentAppointees=" + getCurrentAppointees() + ", elementHeader=" + getElementHeader() + ", properties=" + getProperties() + - ", relatedElement=" + getRelatedElement() + ", predecessors=" + predecessors + ", successors=" + successors + '}'; diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/SubjectAreaElement.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/SubjectAreaElement.java new file mode 100644 index 00000000000..cb0a7f7c0a4 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/metadataelements/SubjectAreaElement.java @@ -0,0 +1,230 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.metadataelements; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.digitalservice.properties.SubjectAreaProperties; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * SubjectAreaElement is the bean used to return a subject area definition stored in the open metadata repositories. + * It includes links to related subject areas and the governance definitions associated with the subject areas. + * More information about the governance definitions can be retrieved through the Governance Program OMAS. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class SubjectAreaElement implements Serializable, MetadataElement +{ + private static final long serialVersionUID = 1L; + + private ElementHeader elementHeader = null; + private SubjectAreaProperties properties = null; + private String parentSubjectAreaGUID = null; + private List nestedSubjectAreaGUIDs = null; + private List associatedGovernanceDefinitions = null; + + + /** + * Default constructor + */ + public SubjectAreaElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SubjectAreaElement(SubjectAreaElement template) + { + if (template != null) + { + elementHeader = template.getElementHeader(); + properties = template.getProperties(); + parentSubjectAreaGUID = template.getParentSubjectAreaGUID(); + nestedSubjectAreaGUIDs = template.getNestedSubjectAreaGUIDs(); + associatedGovernanceDefinitions = template.getAssociatedGovernanceDefinitions(); } + } + + + /** + * Return the element header associated with the properties. + * + * @return element header object + */ + public ElementHeader getElementHeader() + { + return elementHeader; + } + + + /** + * Set up the element header associated with the properties. + * + * @param elementHeader element header object + */ + public void setElementHeader(ElementHeader elementHeader) + { + this.elementHeader = elementHeader; + } + + + /** + * Return the properties of the subject area. + * + * @return properties bean + */ + public SubjectAreaProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties of the subject area. + * + * @param properties properties bean + */ + public void setProperties(SubjectAreaProperties properties) + { + this.properties = properties; + } + + + /** + * Return the unique identifier of the subject area that this zone inherits governance definitions from. + * + * @return string guid + */ + public String getParentSubjectAreaGUID() + { + return parentSubjectAreaGUID; + } + + + /** + * Set up the unique identifier of the subject area that this zone inherits governance definitions from. + * + * @param parentSubjectAreaGUID string guid + */ + public void setParentSubjectAreaGUID(String parentSubjectAreaGUID) + { + this.parentSubjectAreaGUID = parentSubjectAreaGUID; + } + + + /** + * Return the list of unique identifiers of the subject areas that inherit governance definitions from this zone. + * + * @return list of string guids + */ + public List getNestedSubjectAreaGUIDs() + { + return nestedSubjectAreaGUIDs; + } + + + /** + * Set up the list of unique identifiers of the subject areas that inherit governance definitions from this zone. + * + * @param nestedSubjectAreaGUIDs list of string guids + */ + public void setNestedSubjectAreaGUIDs(List nestedSubjectAreaGUIDs) + { + this.nestedSubjectAreaGUIDs = nestedSubjectAreaGUIDs; + } + + + /** + * Return the list of the governance definitions that control assets in this zone. + * + * @return list of definitions + */ + public List getAssociatedGovernanceDefinitions() + { + return associatedGovernanceDefinitions; + } + + + /** + * Set up the list of the governance definitions that control assets in this zone. + * + * @param associatedGovernanceDefinitions list of definitions + */ + public void setAssociatedGovernanceDefinitions(List associatedGovernanceDefinitions) + { + this.associatedGovernanceDefinitions = associatedGovernanceDefinitions; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SubjectAreaElement{" + + "elementHeader=" + elementHeader + + ", properties=" + properties + + ", parentSubjectAreaGUID='" + parentSubjectAreaGUID + '\'' + + ", nestedSubjectAreaGUIDs=" + nestedSubjectAreaGUIDs + + ", associatedGovernanceDefinitions=" + associatedGovernanceDefinitions + + '}'; + } + + + /** + * 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 SubjectAreaElement)) + { + return false; + } + SubjectAreaElement that = (SubjectAreaElement) objectToCompare; + return Objects.equals(elementHeader, that.elementHeader) && + Objects.equals(properties, that.properties) && + Objects.equals(parentSubjectAreaGUID, that.parentSubjectAreaGUID) && + Objects.equals(nestedSubjectAreaGUIDs, that.nestedSubjectAreaGUIDs) && + Objects.equals(associatedGovernanceDefinitions, that.associatedGovernanceDefinitions); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementHeader, properties); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/AgreementRoleProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/AgreementRoleProperties.java new file mode 100644 index 00000000000..5d97be55d85 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/AgreementRoleProperties.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * AgreementRoleProperties describes a relationship between a role and an agreement. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class AgreementRoleProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private String roleName = null; + + + /** + * Default constructor + */ + public AgreementRoleProperties() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template template object to copy. + */ + public AgreementRoleProperties(AgreementRoleProperties template) + { + super(template); + + if (template != null) + { + roleName = template.getRoleName(); + } + } + + + /** + * Set up the name of the role from the agreement text. + * + * @param roleName String name + */ + public void setRoleName(String roleName) + { + this.roleName = roleName; + } + + + /** + * Returns the name of the role from the agreement text. + * + * @return String name + */ + public String getRoleName() + { + return roleName; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "AgreementRoleProperties{" + + "roleName='" + roleName + '\'' + + ", 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 AgreementRoleProperties)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + AgreementRoleProperties that = (AgreementRoleProperties) objectToCompare; + return Objects.equals(roleName, that.roleName); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), roleName); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ClassificationProperties.java index e21cd35f1db..b58e4eca932 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ClassificationProperties.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ClassificationProperties.java @@ -30,6 +30,7 @@ @JsonSubTypes( { @JsonSubTypes.Type(value = DigitalProductProperties.class, name = "DigitalProductProperties"), + @JsonSubTypes.Type(value = SubjectAreaClassificationProperties.class, name = "SubjectAreaClassificationProperties"), }) public class ClassificationProperties implements Serializable { diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceOperatorProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceOperatorProperties.java new file mode 100644 index 00000000000..48437312b3a --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/DigitalServiceOperatorProperties.java @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * DigitalServiceOperatorProperties describes the scope of responsibilities that an organization has in operating a digital service. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class DigitalServiceOperatorProperties extends RelationshipProperties +{ + private static final long serialVersionUID = 1L; + + private String scope = null; + + + /** + * Default constructor + */ + public DigitalServiceOperatorProperties() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template template object to copy. + */ + public DigitalServiceOperatorProperties(DigitalServiceOperatorProperties template) + { + super(template); + + if (template != null) + { + scope = template.getScope(); + } + } + + + /** + * Set up the description for the dependency. + * + * @param scope String name + */ + public void setScope(String scope) + { + this.scope = scope; + } + + + /** + * Returns the description for the dependency. + * + * @return String name + */ + public String getScope() + { + return scope; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "DigitalServiceOperatorProperties{" + + "scope='" + scope + '\'' + + ", 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 DigitalServiceOperatorProperties)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + DigitalServiceOperatorProperties that = (DigitalServiceOperatorProperties) objectToCompare; + return Objects.equals(scope, that.scope); + } + + + /** + * Return hash code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), scope); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ReferenceableProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ReferenceableProperties.java index 8538ef37eba..8268837ce3d 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ReferenceableProperties.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/ReferenceableProperties.java @@ -34,6 +34,7 @@ @JsonSubTypes.Type(value = BusinessCapabilityProperties.class, name = "BusinessCapabilityProperties"), @JsonSubTypes.Type(value = DigitalServiceProperties.class, name = "DigitalServiceProperties"), @JsonSubTypes.Type(value = GovernanceDefinitionProperties.class, name = "GovernanceDefinitionProperties"), + @JsonSubTypes.Type(value = SubjectAreaProperties.class, name = "SubjectAreaProperties"), @JsonSubTypes.Type(value = SolutionComponentProperties.class, name = "SolutionComponentProperties"), }) public class ReferenceableProperties implements Serializable diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/RelationshipProperties.java index db5b755b799..abf87a071aa 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/RelationshipProperties.java +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/RelationshipProperties.java @@ -29,9 +29,10 @@ property = "class") @JsonSubTypes( { + @JsonSubTypes.Type(value = AgreementRoleProperties.class, name = "AgreementRoleProperties"), @JsonSubTypes.Type(value = DigitalSupportProperties.class, name = "DigitalSupportProperties"), - @JsonSubTypes.Type(value = OrganizationalCapabilityProperties.class, name = "OrganizationalCapabilityProperties"), @JsonSubTypes.Type(value = DigitalServiceDependencyProperties.class, name = "DigitalServiceDependencyProperties"), + @JsonSubTypes.Type(value = OrganizationalCapabilityProperties.class, name = "OrganizationalCapabilityProperties"), }) public class RelationshipProperties implements Serializable { diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/SubjectAreaClassificationProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/SubjectAreaClassificationProperties.java new file mode 100644 index 00000000000..9dc37dad29f --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/SubjectAreaClassificationProperties.java @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.properties; + +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. + */ +public class SubjectAreaClassificationProperties extends ClassificationProperties +{ + private static final long serialVersionUID = 1L; + + private String subjectAreaName = null; + + + /** + * Default constructor + */ + public SubjectAreaClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SubjectAreaClassificationProperties(SubjectAreaClassificationProperties 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 "SubjectAreaClassificationProperties{" + + "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 SubjectAreaClassificationProperties)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + SubjectAreaClassificationProperties that = (SubjectAreaClassificationProperties) 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/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/SubjectAreaProperties.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/SubjectAreaProperties.java new file mode 100644 index 00000000000..be4ba28cf26 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/properties/SubjectAreaProperties.java @@ -0,0 +1,249 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.properties; + +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. + */ +public class SubjectAreaProperties extends ReferenceableProperties +{ + private static final long serialVersionUID = 1L; + + private String subjectAreaName = null; + private String displayName = null; + private String description = null; + private String usage = null; + private String scope = null; + private int domainIdentifier = 0; + + + /** + * Default constructor + */ + public SubjectAreaProperties() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public SubjectAreaProperties(SubjectAreaProperties template) + { + super(template); + + if (template != null) + { + this.subjectAreaName = template.getSubjectAreaName(); + this.displayName = template.getDisplayName(); + this.description = template.getDescription(); + this.usage = template.getUsage(); + this.scope = template.getScope(); + this.domainIdentifier = template.getDomainIdentifier(); + } + } + + + /** + * 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; + } + + + /** + * Return the short name for the governance zone. + * + * @return string name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the short name for the governance zone. + * + * @param displayName string name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Return the description for the governance zone + * + * @return text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the description of the governance zone + * + * @param description text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return details of the usage of this subject area. + * + * @return text + */ + public String getUsage() + { + return usage; + } + + + /** + * Set up the details of the usage of this subject area. + * + * @param usage text + */ + public void setUsage(String usage) + { + this.usage = usage; + } + + + /** + * Return the definition of the scope of this subject area + * + * @return scope definition + */ + public String getScope() + { + return scope; + } + + + /** + * Set up the scope definition + * + * @param scope string definition + */ + public void setScope(String scope) + { + this.scope = scope; + } + + + /** + * Return the identifier of the governance domain that this subject area is managed by. + * + * @return int identifier + */ + public int getDomainIdentifier() + { + return domainIdentifier; + } + + + /** + * Set up the identifier of the governance domain that this subject area is managed by. + * + * @param domainIdentifier int identifier + */ + public void setDomainIdentifier(int domainIdentifier) + { + this.domainIdentifier = domainIdentifier; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "SubjectAreaProperties{" + + "typeName='" + getTypeName() + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", extendedProperties=" + getExtendedProperties() + + ", subjectAreaName='" + subjectAreaName + '\'' + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", usage='" + usage + '\'' + + ", scope='" + scope + '\'' + + ", domainIdentifier=" + domainIdentifier + + '}'; + } + + + /** + * 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; + } + SubjectAreaProperties that = (SubjectAreaProperties) objectToCompare; + return domainIdentifier == that.domainIdentifier && + Objects.equals(subjectAreaName, that.subjectAreaName) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description) && + Objects.equals(usage, that.usage) && + Objects.equals(scope, that.scope); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), getSubjectAreaName(), getDisplayName(), getDescription(), getUsage(), getScope(), getDomainIdentifier()); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/DigitalServiceListResponse.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/DigitalServiceListResponse.java new file mode 100644 index 00000000000..4d5a6f9195e --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/DigitalServiceListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.DigitalServiceElement; + +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; + +/** + * DigitalServiceListResponse is a response object for passing back a list of digital service elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class DigitalServiceListResponse extends DigitalServiceOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public DigitalServiceListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public DigitalServiceListResponse(DigitalServiceListResponse 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 elementList; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elements result object + */ + public void setElementList(List elements) + { + this.elementList = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "DigitalServiceListResponse{" + + "element=" + 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; + } + DigitalServiceListResponse that = (DigitalServiceListResponse) 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/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/DigitalServiceResponse.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/DigitalServiceResponse.java new file mode 100644 index 00000000000..1b63f3ba8d8 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/DigitalServiceResponse.java @@ -0,0 +1,136 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.DigitalServiceElement; + +import java.util.Arrays; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ValidValueResponse is a response object for passing back a single digital service object. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class DigitalServiceResponse extends DigitalServiceOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private DigitalServiceElement element = null; + + + /** + * Default constructor + */ + public DigitalServiceResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public DigitalServiceResponse(DigitalServiceResponse template) + { + super(template); + + if (template != null) + { + element = template.getElement(); + } + } + + + /** + * Return the metadata element. + * + * @return result object + */ + public DigitalServiceElement getElement() + { + return element; + } + + + /** + * Set up the metadata element to return. + * + * @param element result object + */ + public void setElement(DigitalServiceElement element) + { + this.element = element; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "DigitalServiceResponse{" + + "element=" + element + + ", 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; + } + DigitalServiceResponse that = (DigitalServiceResponse) objectToCompare; + return Objects.equals(element, that.element); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), element); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/RelatedElementListResponse.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/RelatedElementListResponse.java new file mode 100644 index 00000000000..a83c84ab003 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/RelatedElementListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.digitalservice.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.RelatedElement; + +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; + +/** + * RelatedElementListResponse is a response object for passing back a list of relatedElement objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElementListResponse extends DigitalServiceOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List elementList = null; + + + /** + * Default constructor + */ + public RelatedElementListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElementListResponse(RelatedElementListResponse 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 elementList; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elements result object + */ + public void setElementList(List elements) + { + this.elementList = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElementListResponse{" + + "element=" + 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; + } + RelatedElementListResponse that = (RelatedElementListResponse) 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/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/TemplateRequestBody.java b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/TemplateRequestBody.java new file mode 100644 index 00000000000..c5f2cdf13bd --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-api/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/rest/TemplateRequestBody.java @@ -0,0 +1,192 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.digitalservice.properties.TemplateProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * TemplateRequestBody carries the parameters for creating a new asset using a template. + * The external source identifiers indicate whether the new asset should be created as an external element or not. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateRequestBody extends TemplateProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + private String parentGUID = null; + + + /** + * Default constructor + */ + public TemplateRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + parentGUID = template.getParentGUID(); + } + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateProperties template) + { + super(template); + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * 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 "TemplateRequestBody{" + + "qualifiedName='" + getQualifiedName() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + ", networkAddress='" + getNetworkAddress() + '\'' + + ", externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", 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 TemplateRequestBody)) + { + return false; + } + if (! super.equals(objectToCompare)) + { + return false; + } + TemplateRequestBody that = (TemplateRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName) && Objects.equals(parentGUID, that.parentGUID); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName, parentGUID); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/build.gradle b/open-metadata-implementation/access-services/digital-service/digital-service-client/build.gradle new file mode 100644 index 00000000000..be1c8445578 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/build.gradle @@ -0,0 +1,25 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * Copyright Contributors to the ODPi Egeria project. + */ + + +dependencies { + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') + implementation project(':open-metadata-implementation:common-services:gaf-metadata-management:gaf-metadata-api') + implementation project(':open-metadata-implementation:common-services:gaf-metadata-management:gaf-metadata-client') + implementation project(':open-metadata-implementation:repository-services:repository-services-apis') + implementation project(':open-metadata-implementation:common-services:ffdc-services') + implementation project(':open-metadata-implementation:access-services:digital-service:digital-service-api') + implementation project(':open-metadata-implementation:frameworks:open-connector-framework') + implementation project(':open-metadata-implementation:frameworks:audit-log-framework') + implementation 'org.springframework:spring-core' + compileOnly 'com.fasterxml.jackson.core:jackson-annotations' +} + +description = 'Digital Service OMAS Client' + +java { + withJavadocJar() +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/pom.xml b/open-metadata-implementation/access-services/digital-service/digital-service-client/pom.xml index 81a13198c38..088f6c7674d 100644 --- a/open-metadata-implementation/access-services/digital-service/digital-service-client/pom.xml +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/pom.xml @@ -6,8 +6,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - digital-service @@ -22,8 +20,41 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master + + + + org.odpi.egeria + gaf-metadata-client + + + + org.odpi.egeria + ocf-metadata-client + + + + org.odpi.egeria + ffdc-services + + + + org.odpi.egeria + digital-service-api + + + + org.odpi.egeria + open-connector-framework + + + + org.odpi.egeria + audit-log-framework + + + diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/ConnectedAssetClient.java b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/ConnectedAssetClient.java new file mode 100644 index 00000000000..b6a20cfa602 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/ConnectedAssetClient.java @@ -0,0 +1,92 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.client; + +import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; + +/** + * ConnectedAssetClient is used by applications and tools as a factory for Open + * Connector Framework (OCF) connectors. The configuration for the connectors is managed as open metadata in + * a Connection definition. The caller to the ConnectedAssetClient passes either the name, GUID or URL for the + * connection to the appropriate method to retrieve a connector. The ConnectedAssetClient retrieves the connection + * from the metadata repository and creates an appropriate connector as described the connection and + * returns it to the caller. + * + * The ConnectedAssetClient supports access to the asset properties through the connector. + */ +public class ConnectedAssetClient extends ConnectedAssetClientBase +{ + private static final String serviceURLName = "digital-service"; + + /** + * 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 servers + * @param auditLog logging destination + * + * @throws InvalidParameterException null URL or server name + */ + public ConnectedAssetClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, serviceURLName, 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 servers + * @throws InvalidParameterException null URL or server name + */ + public ConnectedAssetClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, serviceURLName); + } + + + /** + * 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 servers + * @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 null URL or server name + */ + public ConnectedAssetClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, serviceURLName, userId, password, 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 servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException null URL or server name + */ + public ConnectedAssetClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, serviceURLName, userId, password); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/DigitalServiceBaseClient.java b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/DigitalServiceBaseClient.java new file mode 100644 index 00000000000..68a5c006952 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/DigitalServiceBaseClient.java @@ -0,0 +1,720 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.client; + +import org.odpi.openmetadata.accessservices.digitalservice.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.digitalservice.properties.ClassificationProperties; +import org.odpi.openmetadata.accessservices.digitalservice.properties.ReferenceableProperties; +import org.odpi.openmetadata.accessservices.digitalservice.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.digitalservice.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.digitalservice.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.digitalservice.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.digitalservice.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.digitalservice.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.digitalservice.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.digitalservice.rest.TemplateRequestBody; +import org.odpi.openmetadata.accessservices.digitalservice.client.rest.DigitalServiceRESTClient; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +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.List; + +/** + * DigitalServiceBaseClient supports the common properties and functions for the Digital Service OMAS. + */ +public class DigitalServiceBaseClient +{ + final String serverName; /* Initialized in constructor */ + final String serverPlatformURLRoot; /* Initialized in constructor */ + + final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + final DigitalServiceRESTClient restClient; /* Initialized in constructor */ + + + /** + * 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 servers + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceBaseClient(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 DigitalServiceRESTClient(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 servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceBaseClient(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 DigitalServiceRESTClient(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 servers + * @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 DigitalServiceBaseClient(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 DigitalServiceRESTClient(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 servers + * @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 DigitalServiceBaseClient(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 DigitalServiceRESTClient(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 servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceBaseClient(String serverName, + String serverPlatformURLRoot, + DigitalServiceRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + invalidParameterHandler.setMaxPagingSize(maxPageSize); + + this.restClient = restClient; + } + + + /* ===================================================================================================================== + * Basic client methods + */ + + + /** + * Create a new metadata element. + * + * @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 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) + */ + String createReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + 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 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 templateProperties properties that override the template + * @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) + */ + String createReferenceableFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "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(templateProperties); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID); + + 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 externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @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 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) + */ + String createReferenceableFromTemplateWithParent(String userId, + String externalSourceGUID, + String externalSourceName, + String parentGUID, + String parentGUIDParameterName, + String templateGUID, + TemplateProperties templateProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + 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(templateProperties); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setParentGUID(parentGUID); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element that is attached to the parent. + * + * @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 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 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) + */ + String createReferenceableWithParent(String userId, + String externalSourceGUID, + String externalSourceName, + String parentGUID, + String parentGUIDParameterName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(parentGUID, parentGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setParentGUID(parentGUID); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + 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 externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName 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 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 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 updateReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + boolean isMergeUpdate, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate); + } + + + /** + * Add or update classification on referenceable. + * + * @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 elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param properties properties of security at the site + * @param urlTemplate URL to call with placeholder for guid + * @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 setReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + ClassificationProperties properties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Remove classification from the referenceable. + * + * @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 elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param urlTemplate URL to call with placeholder for guid + * @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 removeReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a relationship between a primary element and a secondary element. + * + * @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 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 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 setupRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Remove a relationship. + * + * @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 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 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 clearRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Retrieve a relationship. + * + * @param userId calling user + * @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 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) + */ + List getRelatedElements(String userId, + String startingElementGUID, + String startingElementGUIDParameterName, + String urlTemplate, + int startFrom, + int pageSize, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startingElementGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElementList(); + } + + + /** + * Remove the metadata element. + * + * @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 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 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 removeReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/OpenMetadataStoreClient.java b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/OpenMetadataStoreClient.java new file mode 100644 index 00000000000..78615f0bb6b --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/OpenMetadataStoreClient.java @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.client; + +import org.odpi.openmetadata.commonservices.gaf.client.OpenMetadataStoreClientBase; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; + +/** + * OpenMetadataStoreClientBase sits in the governance context of a governance action service when it is running in the engine host OMAG server. + * It is however shared by all the governance action services running in an engine service so that we only need one connector to the topic + * listener for the watchdog governance services. + */ +public class OpenMetadataStoreClient extends OpenMetadataStoreClientBase +{ + private final static String serviceURLMarker = "digital-service"; + + /** + * 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 servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public OpenMetadataStoreClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serviceURLMarker, 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 servers + * @param serverUserId caller's userId embedded in all HTTP requests + * @param serverPassword 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 OpenMetadataStoreClient(String serverName, + String serverPlatformURLRoot, + String serverUserId, + String serverPassword) throws InvalidParameterException + { + super(serviceURLMarker, serverName, serverPlatformURLRoot, serverUserId, serverPassword); + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/package-info.java b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/package-info.java new file mode 100644 index 00000000000..1ec9a95587f --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * These are the client interfaces of the Digital Service OMAS. + */ +package org.odpi.openmetadata.accessservices.digitalservice.client; diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/rest/DigitalServiceRESTClient.java b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/rest/DigitalServiceRESTClient.java new file mode 100644 index 00000000000..e7a8b3675e8 --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/rest/DigitalServiceRESTClient.java @@ -0,0 +1,194 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.digitalservice.client.rest; + + +import org.odpi.openmetadata.accessservices.digitalservice.rest.*; +import org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient; +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; + + +/** + * DigitalServiceRESTClient is responsible for issuing calls to the OMAS REST APIs. + */ +public class DigitalServiceRESTClient extends FFDCRESTClient +{ + /** + * Constructor for no authentication with audit log. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server manager where the OMAG Server is running. + * @param auditLog destination for log messages. + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceRESTClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Constructor for no authentication. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server manager where the OMAG Server is running. + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceRESTClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot); + } + + + /** + * Constructor for simple userId and password authentication with audit log. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server manager where the OMAG Server is running. + * @param userId user id for the HTTP request + * @param password password for the HTTP request + * @param auditLog destination for log messages. + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceRESTClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Constructor for simple userId and password authentication. + * + * @param serverName name of the OMAG Server to call + * @param serverPlatformURLRoot URL root of the server manager where the OMAG Server is running. + * @param userId user id for the HTTP request + * @param password password for the HTTP request + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public DigitalServiceRESTClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + super(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Issue a GET REST call that returns a RelatedElementListResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public RelatedElementListResponse callRelatedElementListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + RelatedElementListResponse restResult = this.callGetRESTCall(methodName, RelatedElementListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a DigitalServiceElement in a response object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public DigitalServiceResponse callDigitalServiceGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + DigitalServiceResponse restResult = this.callGetRESTCall(methodName, DigitalServiceResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of DigitalServiceElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public DigitalServiceListResponse callDigitalServiceListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + DigitalServiceListResponse restResult = this.callGetRESTCall(methodName, DigitalServiceListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + + /** + * Issue a GET REST call that returns a list of DigitalServiceElements in a response object. + * + * @param methodName name of the method being called + * @param urlTemplate REST API call URL template with place-holders for the parameters + * @param requestBody request body for the request + * @param params a list of parameters that are slotted into the url template + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException something went wrong with the REST call stack. + */ + public DigitalServiceListResponse callDigitalServiceListPostRESTCall(String methodName, + String urlTemplate, + Object requestBody, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + DigitalServiceListResponse restResult = this.callPostRESTCall(methodName, DigitalServiceListResponse.class, urlTemplate, requestBody, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } +} diff --git a/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/rest/package-info.java b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/rest/package-info.java new file mode 100644 index 00000000000..2a25658b7ec --- /dev/null +++ b/open-metadata-implementation/access-services/digital-service/digital-service-client/src/main/java/org/odpi/openmetadata/accessservices/digitalservice/client/rest/package-info.java @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * This package contains the internal class for issuing REST calls. + */ +package org.odpi.openmetadata.accessservices.digitalservice.client.rest; diff --git a/open-metadata-implementation/access-services/digital-service/pom.xml b/open-metadata-implementation/access-services/digital-service/pom.xml index 6f82909a33f..c3c6cf968e4 100644 --- a/open-metadata-implementation/access-services/digital-service/pom.xml +++ b/open-metadata-implementation/access-services/digital-service/pom.xml @@ -15,14 +15,14 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Digital Service OMAS The Digital Service Open Metadata Access Service (OMAS) provides APIs and notifications for tools and applications supporting - the lifecycle of the Egeria Digital Service. + the lifecycle of the Egeria Digital Service and digital products. digital-service @@ -30,6 +30,7 @@ pom digital-service-api + digital-service-client digital-service-server digital-service-spring diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/GovernanceActionProcessProperties.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/GovernanceActionProcessProperties.java index 244bf629b73..a04ca93ac0a 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/GovernanceActionProcessProperties.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-api/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/properties/GovernanceActionProcessProperties.java @@ -29,6 +29,7 @@ public class GovernanceActionProcessProperties extends ReferenceableProperties private String abbreviation = null; private String usage = null; private String technicalName = null; + private String versionIdentifier = null; private String technicalDescription = null; private String formula = null; private String implementationLanguage = null; @@ -60,6 +61,7 @@ public GovernanceActionProcessProperties(GovernanceActionProcessProperties templ usage = template.getUsage(); technicalName = template.getTechnicalName(); + versionIdentifier = template.getVersionIdentifier(); technicalDescription = template.getTechnicalDescription(); formula = template.getFormula(); @@ -204,6 +206,28 @@ public void setTechnicalName(String technicalName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored technical description property for the asset. * If no technical description is provided then null is returned. @@ -283,6 +307,7 @@ public String toString() ", abbreviation='" + abbreviation + '\'' + ", usage='" + usage + '\'' + ", technicalName='" + technicalName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", technicalDescription='" + technicalDescription + '\'' + ", formula='" + formula + '\'' + ", implementationLanguage='" + implementationLanguage + '\'' + @@ -305,24 +330,54 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof GovernanceActionProcessProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + GovernanceActionProcessProperties that = (GovernanceActionProcessProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(summary, that.summary) && - Objects.equals(description, that.description) && - Objects.equals(abbreviation, that.abbreviation) && - Objects.equals(usage, that.usage) && - Objects.equals(technicalName, that.technicalName) && - Objects.equals(technicalDescription, that.technicalDescription) && - Objects.equals(formula, that.formula) && - Objects.equals(implementationLanguage, that.implementationLanguage); + + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (summary != null ? ! summary.equals(that.summary) : that.summary != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (abbreviation != null ? ! abbreviation.equals(that.abbreviation) : that.abbreviation != null) + { + return false; + } + if (usage != null ? ! usage.equals(that.usage) : that.usage != null) + { + return false; + } + if (technicalName != null ? ! technicalName.equals(that.technicalName) : that.technicalName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (technicalDescription != null ? ! technicalDescription.equals(that.technicalDescription) : that.technicalDescription != null) + { + return false; + } + if (formula != null ? ! formula.equals(that.formula) : that.formula != null) + { + return false; + } + return implementationLanguage != null ? implementationLanguage.equals(that.implementationLanguage) : that.implementationLanguage == null; } @@ -334,7 +389,7 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, summary, description, abbreviation, usage, technicalName, technicalDescription, + return Objects.hash(super.hashCode(), displayName, summary, description, abbreviation, usage, technicalName, versionIdentifier, technicalDescription, formula, implementationLanguage); } } diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java index d53f97508a1..d7f4a0aec9a 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/handlers/GovernanceConfigurationHandler.java @@ -456,6 +456,7 @@ public String createGovernanceService(String userId, null, qualifiedName, displayName, + null, description, null, typeName, @@ -817,6 +818,7 @@ public void updateGovernanceService(String userId, guidParameter, qualifiedName, displayName, + null, description, additionalProperties, OpenMetadataAPIMapper.GOVERNANCE_SERVICE_TYPE_GUID, diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceActionProcessRESTServices.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceActionProcessRESTServices.java index e8b882574f1..5841c1beb2c 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceActionProcessRESTServices.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-server/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/server/GovernanceActionProcessRESTServices.java @@ -103,6 +103,7 @@ public GUIDResponse createGovernanceActionProcess(String null, processProperties.getQualifiedName(), processProperties.getTechnicalName(), + processProperties.getVersionIdentifier(), processProperties.getTechnicalDescription(), processProperties.getAdditionalProperties(), OpenMetadataAPIMapper.GOVERNANCE_ACTION_PROCESS_TYPE_NAME, @@ -230,6 +231,7 @@ public VoidResponse updateGovernanceActionProcess(String processGUID, processGUIDParameterName, processProperties.getQualifiedName(), + processProperties.getVersionIdentifier(), processProperties.getTechnicalName(), processProperties.getTechnicalDescription(), processProperties.getAdditionalProperties(), diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/AssetProperties.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/AssetProperties.java index 3cedb56d088..db2de595e60 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/properties/AssetProperties.java @@ -21,6 +21,7 @@ public class AssetProperties extends SupplementaryProperties private static final long serialVersionUID = 1L; private String technicalName = null; + private String versionIdentifier = null; private String technicalDescription = null; /** @@ -43,6 +44,7 @@ public AssetProperties(AssetProperties template) if (template != null) { technicalName = template.getDisplayName(); + versionIdentifier = template.getVersionIdentifier(); technicalDescription = template.getTechnicalDescription(); } } @@ -71,6 +73,29 @@ public void setTechnicalName(String technicalName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + + /** * Returns the stored technical description property for the asset. * If no description is provided then null is returned. @@ -104,16 +129,19 @@ public String toString() { return "AssetProperties{" + "technicalName='" + technicalName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", technicalDescription='" + technicalDescription + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", typeName='" + getTypeName() + '\'' + + ", extendedProperties=" + getExtendedProperties() + ", displayName='" + getDisplayName() + '\'' + ", summary='" + getSummary() + '\'' + ", description='" + getDescription() + '\'' + ", abbreviation='" + getAbbreviation() + '\'' + ", usage='" + getUsage() + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + '}'; } @@ -131,19 +159,29 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(technicalName, that.technicalName) && - Objects.equals(technicalDescription, that.technicalDescription); + + if (technicalName != null ? ! technicalName.equals(that.technicalName) : that.technicalName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + return technicalDescription != null ? technicalDescription.equals(that.technicalDescription) : that.technicalDescription == null; } + /** * Return hash code based on properties. * @@ -152,6 +190,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), technicalName, technicalDescription); + return Objects.hash(super.hashCode(), technicalName, versionIdentifier, technicalDescription); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/pom.xml b/open-metadata-implementation/access-services/governance-program/governance-program-client/pom.xml index 140729e867d..37a42345359 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/pom.xml +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/pom.xml @@ -18,7 +18,7 @@ scm:git:git://github.com/odpi/egeria.git scm:git:ssh://github.com/odpi/egeria.git - http://github.com/odpi/egeria/tree/master + https://github.com/odpi/egeria/tree/master Governance Program OMAS Client diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java index e14f85c9825..33b3812e84b 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java @@ -275,6 +275,7 @@ public void unlinkSubjectAreasInHierarchy(String userId, methodName); } + /** * Return information about a specific subject area. * diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java index aa425edf12f..b2bbbf34473 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/AssetProperties.java @@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.*; -import java.util.*; - import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; @@ -29,6 +27,8 @@ public class AssetProperties extends ConfigurationItemProperties { private static final long serialVersionUID = 1L; + private String name = null; + private String versionIdentifier = null; private String displayName = null; private String description = null; @@ -52,8 +52,10 @@ public AssetProperties(AssetProperties template) if (template != null) { - displayName = template.getDisplayName(); - description = template.getDescription(); + name = template.getName(); + versionIdentifier = template.getVersionIdentifier(); + displayName = template.getDisplayName(); + description = template.getDescription(); } } @@ -78,18 +80,73 @@ public AssetProperties cloneToAsset(String subTypeName) } + /** + * Return the name of the resource that this asset represents. + * + * @return string resource name + */ + public String getName() + { + if (name == null) + { + return displayName; + } + + return name; + } + + + /** + * Set up the name of the resource that this asset represents. + * + * @param name string resource name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored display name property for the asset. - * If no display name is available then null is returned. + * If no display name is available then name is returned. * * @return String name */ public String getDisplayName() { + if (displayName == null) + { + return name; + } + return displayName; } + /** * Set up the stored display name property for the asset. * @@ -133,7 +190,9 @@ public void setDescription(String description) public String toString() { return "AssetProperties{" + - "displayName='" + displayName + '\'' + + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", displayName='" + displayName + '\'' + ", description='" + description + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + @@ -159,19 +218,31 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } - AssetProperties asset = (AssetProperties) objectToCompare; - return Objects.equals(getDisplayName(), asset.getDisplayName()) && - Objects.equals(getDescription(), asset.getDescription()); - } + AssetProperties that = (AssetProperties) objectToCompare; + + if (name != null ? ! name.equals(that.name) : that.name != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + return description != null ? description.equals(that.description) : that.description == null; + } /** @@ -182,6 +253,11 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), getDisplayName(), getDescription()); + int result = super.hashCode(); + result = 31 * result + (name != null ? name.hashCode() : 0); + result = 31 * result + (versionIdentifier != null ? versionIdentifier.hashCode() : 0); + result = 31 * result + (displayName != null ? displayName.hashCode() : 0); + result = 31 * result + (description != null ? description.hashCode() : 0); + return result; } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/DataAssetProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/DataAssetProperties.java index e62e1c9e010..61343ee7b2f 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/DataAssetProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/DataAssetProperties.java @@ -73,10 +73,13 @@ public AssetProperties cloneToAsset() public String toString() { return "DataAssetProperties{" + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + + ", cloneToAsset=" + cloneToAsset() + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", vendorProperties=" + getVendorProperties() + diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java index 9b7f50f0c16..9eba89a8d64 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/HostProperties.java @@ -86,10 +86,13 @@ public AssetProperties cloneToAsset(String subTypeName) public String toString() { return "HostProperties{" + - "displayName='" + getDisplayName() + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + + ", cloneToAsset=" + cloneToAsset() + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", vendorProperties=" + getVendorProperties() + diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java index 074e4c3a7af..5d8a49e6d9f 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ITInfrastructureProperties.java @@ -87,7 +87,9 @@ public AssetProperties cloneToAsset(String subTypeName) public String toString() { return "ITInfrastructureProperties{" + - "displayName='" + getDisplayName() + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ProcessProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ProcessProperties.java index 25a7418dde4..84af9478433 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ProcessProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/ProcessProperties.java @@ -176,12 +176,15 @@ public void setImplementationLanguage(String implementationLanguage) public String toString() { return "ProcessProperties{" + - "formula='" + formula + '\'' + - ", implementationLanguage='" + implementationLanguage + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + ", effectiveTo=" + getEffectiveTo() + + ", formula='" + formula + '\'' + + ", implementationLanguage='" + implementationLanguage + '\'' + + ", cloneToAsset=" + cloneToAsset() + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + ", vendorProperties=" + getVendorProperties() + diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java index 13f9c1fbe76..507aae6b1f7 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerPlatformProperties.java @@ -263,10 +263,8 @@ public void setSoftwareServerPlatformUserId(String platformUserId) public String toString() { return "SoftwareServerPlatformProperties{" + - "platformType='" + platformType + '\'' + - ", platformVersion='" + platformVersion + '\'' + - ", platformSource='" + platformSource + '\'' + - ", platformUserId='" + platformUserId + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + @@ -276,6 +274,15 @@ public String toString() ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", platformType='" + platformType + '\'' + + ", platformVersion='" + platformVersion + '\'' + + ", platformSource='" + platformSource + '\'' + + ", platformUserId='" + platformUserId + '\'' + + ", cloneToAsset=" + cloneToAsset() + + ", softwareServerPlatformType='" + getSoftwareServerPlatformType() + '\'' + + ", softwareServerPlatformVersion='" + getSoftwareServerPlatformVersion() + '\'' + + ", softwareServerPlatformSource='" + getSoftwareServerPlatformSource() + '\'' + + ", softwareServerPlatformUserId='" + getSoftwareServerPlatformUserId() + '\'' + '}'; } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java index 6aff1a957d5..bd5e82d79aa 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/SoftwareServerProperties.java @@ -291,10 +291,8 @@ public void setSoftwareServerUserId(String softwareServerUserId) public String toString() { return "SoftwareServerProperties{" + - "softwareServerType='" + softwareServerType + '\'' + - ", softwareServerVersion='" + softwareServerVersion + '\'' + - ", softwareServerSource='" + softwareServerSource + '\'' + - ", softwareServerUserId='" + softwareServerUserId + '\'' + + "name='" + getName() + '\'' + + ", versionIdentifier='" + getVersionIdentifier() + '\'' + ", displayName='" + getDisplayName() + '\'' + ", description='" + getDescription() + '\'' + ", effectiveFrom=" + getEffectiveFrom() + @@ -304,6 +302,11 @@ public String toString() ", vendorProperties=" + getVendorProperties() + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", softwareServerType='" + softwareServerType + '\'' + + ", softwareServerVersion='" + softwareServerVersion + '\'' + + ", softwareServerSource='" + softwareServerSource + '\'' + + ", softwareServerUserId='" + softwareServerUserId + '\'' + + ", cloneToAsset=" + cloneToAsset() + '}'; } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/TemplateProperties.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/TemplateProperties.java index 2e29f044d27..e9f38ff6472 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/TemplateProperties.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-api/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/properties/TemplateProperties.java @@ -24,10 +24,13 @@ public class TemplateProperties implements Serializable { private static final long serialVersionUID = 1L; - private String qualifiedName = null; - private String displayName = null; - private String description = null; - private String networkAddress = null; + private String qualifiedName = null; + private String displayName = null; + private String versionIdentifier = null; + private String description = null; + private String pathName = null; + private String networkAddress = null; + /** * Default constructor @@ -47,10 +50,12 @@ public TemplateProperties(TemplateProperties template) { if (template != null) { - qualifiedName = template.getQualifiedName(); - displayName = template.getDisplayName(); - description = template.getDescription(); - networkAddress = template.getNetworkAddress(); + qualifiedName = template.getQualifiedName(); + displayName = template.getDisplayName(); + versionIdentifier = template.getVersionIdentifier(); + description = template.getDescription(); + pathName = template.getPathName(); + networkAddress = template.getNetworkAddress(); } } @@ -101,6 +106,28 @@ public void setDisplayName(String displayName) } + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored description property for the metadata entity. * If no description is provided then null is returned. @@ -124,6 +151,28 @@ public void setDescription(String description) } + /** + * Return the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @return string name + */ + public String getPathName() + { + return pathName; + } + + + /** + * Set up the path name to the physical resource - used when creating new data store assets such as databases, files and folders. + * + * @param pathName string name + */ + public void setPathName(String pathName) + { + this.pathName = pathName; + } + + /** * Return the physical network address of this metadata element (if this makes sense). * @@ -131,7 +180,7 @@ public void setDescription(String description) */ public String getNetworkAddress() { - return networkAddress; + return pathName; } @@ -142,7 +191,7 @@ public String getNetworkAddress() */ public void setNetworkAddress(String networkAddress) { - this.networkAddress = networkAddress; + this.pathName = networkAddress; } @@ -157,7 +206,9 @@ public String toString() return "TemplateProperties{" + "qualifiedName='" + qualifiedName + '\'' + ", displayName='" + displayName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + ", description='" + description + '\'' + + ", pathName='" + pathName + '\'' + ", networkAddress='" + networkAddress + '\'' + '}'; } @@ -176,15 +227,34 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof TemplateProperties)) { return false; } + TemplateProperties that = (TemplateProperties) objectToCompare; - return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(networkAddress, that.networkAddress); + + if (qualifiedName != null ? ! qualifiedName.equals(that.qualifiedName) : that.qualifiedName != null) + { + return false; + } + if (displayName != null ? ! displayName.equals(that.displayName) : that.displayName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + if (description != null ? ! description.equals(that.description) : that.description != null) + { + return false; + } + if (pathName != null ? ! pathName.equals(that.pathName) : that.pathName != null) + { + return false; + } + return networkAddress != null ? networkAddress.equals(that.networkAddress) : that.networkAddress == null; } @@ -196,6 +266,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(qualifiedName, displayName, description, networkAddress); + return Objects.hash(qualifiedName, displayName, versionIdentifier, description, pathName, networkAddress); } } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java index 3d57971c0ea..bfa741cd2f0 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/AssetConverter.java @@ -73,7 +73,8 @@ public B getNewBean(Class beanClass, assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - assetProperties.setDisplayName(this.removeName(instanceProperties)); + assetProperties.setName(this.removeName(instanceProperties)); + assetProperties.setDisplayName(assetProperties.getName()); assetProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java index f6609213cd3..041bba8091f 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/ProcessConverter.java @@ -73,7 +73,8 @@ public B getNewBean(Class beanClass, processProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); processProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - processProperties.setDisplayName(this.removeName(instanceProperties)); + processProperties.setName(this.removeName(instanceProperties)); + processProperties.setDisplayName(processProperties.getName()); processProperties.setDescription(this.removeDescription(instanceProperties)); processProperties.setFormula(this.removeFormula(instanceProperties)); diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java index a9e74d905b8..908403faa82 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/converters/RelatedAssetConverter.java @@ -90,7 +90,8 @@ public B getNewBean(Class beanClass, assetProperties.setQualifiedName(this.removeQualifiedName(instanceProperties)); assetProperties.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - assetProperties.setDisplayName(this.removeName(instanceProperties)); + assetProperties.setName(this.removeName(instanceProperties)); + assetProperties.setDisplayName(assetProperties.getName()); assetProperties.setDescription(this.removeDescription(instanceProperties)); /* diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITAssetRESTService.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITAssetRESTService.java index 701e01ebd41..ccfd09a0625 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITAssetRESTService.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITAssetRESTService.java @@ -117,14 +117,15 @@ public GUIDResponse createAsset(String serverName, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), requestBody.getQualifiedName(), - requestBody.getDisplayName(), + requestBody.getName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), this.getInstanceStatus(requestBody.getInitialStatus()), - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -156,14 +157,15 @@ public GUIDResponse createAsset(String serverName, null, null, requestBody.getQualifiedName(), - requestBody.getDisplayName(), + requestBody.getName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), this.getInstanceStatus(requestBody.getInitialStatus()), - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), new Date(), methodName); @@ -339,7 +341,9 @@ public GUIDResponse createAssetFromTemplate(String serverName, requestBody.getQualifiedName(), qualifiedNameParameterName, requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), + requestBody.getPathName(), requestBody.getNetworkAddress(), false, false, @@ -438,12 +442,13 @@ public VoidResponse updateAsset(String serverName, elementGUIDParameterName, requestBody.getQualifiedName(), requestBody.getDisplayName(), + requestBody.getVersionIdentifier(), requestBody.getDescription(), requestBody.getAdditionalProperties(), typeName, requestBody.getExtendedProperties(), - null, - null, + requestBody.getEffectiveFrom(), + requestBody.getEffectiveTo(), isMergeUpdate, false, false, diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/events/package-info.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/events/package-info.java index a09f00a01e0..ce8e221c7aa 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/events/package-info.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/events/package-info.java @@ -11,7 +11,7 @@ * Following the header are the common properties for all asset events. This includes the latest version of * the asset, its origin and the license associated with the Asset's metadata. * - * Finally are the specialist extensions for each type of event. New asset events include the creation time of the + * Finally, are the specialist extensions for each type of event. New asset events include the creation time of the * asset. Updated asset events include the update time and the original values of the asset (if available). */ package org.odpi.openmetadata.accessservices.stewardshipaction.events; diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ConnectionElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ConnectionElement.java deleted file mode 100644 index 31141e153e2..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ConnectionElement.java +++ /dev/null @@ -1,241 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.ConnectionProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; - -import java.io.Serializable; -import java.util.ArrayList; -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; - -/** - * ConnectionElement contains the properties and header for a connection retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ConnectionElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ConnectionProperties connectionProperties = null; - private ElementHeader elementHeader = null; - private ElementStub connectorType = null; - private ElementStub endpoint = null; - private List embeddedConnections = null; - - - /** - * Default constructor - */ - public ConnectionElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public ConnectionElement(ConnectionElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - connectionProperties = template.getConnectionProperties(); - connectorType = template.getConnectorType(); - endpoint = template.getEndpoint(); - embeddedConnections = template.getEmbeddedConnections(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties for the connection. - * - * @return asset properties (using appropriate subclass) - */ - public ConnectionProperties getConnectionProperties() - { - return connectionProperties; - } - - - /** - * Set up the properties for the connection. - * - * @param connectionProperties asset properties - */ - public void setConnectionProperties(ConnectionProperties connectionProperties) - { - this.connectionProperties = connectionProperties; - } - - - /** - * Set up the connector type properties for this Connection. - * - * @param connectorType ConnectorType properties object - */ - public void setConnectorType(ElementStub connectorType) - { - this.connectorType = connectorType; - } - - - /** - * Returns a copy of the properties for this connection's connector type. - * A null means there is no connection type. - * - * @return connector type for the connection - */ - public ElementStub getConnectorType() - { - return connectorType; - } - - - /** - * Set up the endpoint properties for this Connection. - * - * @param endpoint Endpoint properties object - */ - public void setEndpoint(ElementStub endpoint) - { - this.endpoint = endpoint; - } - - - /** - * Returns a copy of the properties for this connection's endpoint. - * Null means no endpoint information available. - * - * @return endpoint for the connection - */ - public ElementStub getEndpoint() - { - return endpoint; - } - - - /** - * Return the list of embedded connections for this virtual connection. - * - * @return list of EmbeddedConnection objects - */ - public List getEmbeddedConnections() - { - if (embeddedConnections == null) - { - return null; - } - else if (embeddedConnections.isEmpty()) - { - return null; - } - else - { - return new ArrayList<>(embeddedConnections); - } - } - - - /** - * Set up the list of embedded connections for this virtual connection. - * - * @param embeddedConnections list of EmbeddedConnection objects - */ - public void setEmbeddedConnections(List embeddedConnections) - { - this.embeddedConnections = embeddedConnections; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "ConnectionElement{" + - "connectionProperties=" + connectionProperties + - ", elementHeader=" + elementHeader + - ", connectorType=" + connectorType + - ", endpoint=" + endpoint + - ", embeddedConnections=" + embeddedConnections + - '}'; - } - - - /** - * 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; - } - ConnectionElement that = (ConnectionElement) objectToCompare; - return Objects.equals(getConnectionProperties(), that.getConnectionProperties()) && - Objects.equals(getElementHeader(), that.getElementHeader()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, connectionProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ConnectorTypeElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ConnectorTypeElement.java deleted file mode 100644 index 23355d3b365..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ConnectorTypeElement.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.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.ConnectorTypeProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * ConnectorTypeElement contains the properties and header for a connector type retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ConnectorTypeElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ConnectorTypeProperties connectorTypeProperties = null; - private ElementHeader elementHeader = null; - - - /** - * Default constructor - */ - public ConnectorTypeElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public ConnectorTypeElement(ConnectorTypeElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - connectorTypeProperties = template.getConnectorTypeProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - - /** - * Return the properties for the connector type. - * - * @return asset properties (using appropriate subclass) - */ - public ConnectorTypeProperties getConnectorTypeProperties() - { - return connectorTypeProperties; - } - - - /** - * Set up the properties for the connector type. - * - * @param connectorTypeProperties asset properties - */ - public void setConnectorTypeProperties(ConnectorTypeProperties connectorTypeProperties) - { - this.connectorTypeProperties = connectorTypeProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "ConnectorTypeElement{" + - "connectorTypeProperties=" + connectorTypeProperties + - ", elementHeader=" + elementHeader + - '}'; - } - - - /** - * Return comparison result based on the content of the properties. - * - * @param objectToCompare test object - * @return result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - ConnectorTypeElement that = (ConnectorTypeElement) objectToCompare; - return Objects.equals(getConnectorTypeProperties(), that.getConnectorTypeProperties()) && - Objects.equals(getElementHeader(), that.getElementHeader()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, connectorTypeProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/EmbeddedConnection.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/EmbeddedConnection.java deleted file mode 100644 index 5d601d33d73..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/EmbeddedConnection.java +++ /dev/null @@ -1,215 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; - -import java.io.Serializable; -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; - -/** - * The EmbeddedConnection is used within a VirtualConnection to link to the embedded connections. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class EmbeddedConnection implements Serializable -{ - private static final long serialVersionUID = 1L; - - /* - * Attributes of an embedded connection - */ - protected int position = 0; - protected String displayName = null; - protected Map arguments = null; - protected ElementStub embeddedConnection = null; - - - /** - * Default constructor - */ - public EmbeddedConnection() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template element to copy - */ - public EmbeddedConnection(EmbeddedConnection template) - { - if (template != null) - { - position = template.getPosition(); - displayName = template.getDisplayName(); - arguments = template.getArguments(); - embeddedConnection = template.getEmbeddedConnection(); - } - } - - - /** - * Return the position that this connector is in the list of embedded connectors. - * - * @return int - */ - public int getPosition() - { - return position; - } - - - /** - * Set up the position that this connector is in the list of embedded connectors. - * - * @param position int - */ - public void setPosition(int position) - { - this.position = position; - } - - - /** - * Return the printable name of the embedded connection. - * - * @return String name - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Set up the printable name of the embedded connection. - * - * @param displayName String name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Return the arguments for the embedded connection. - * - * @return property map - */ - public Map getArguments() - { - if (arguments == null) - { - return null; - } - else if (arguments.isEmpty()) - { - return null; - } - else - { - return new HashMap<>(arguments); - } - } - - - /** - * Set up the arguments for the embedded connection. - * - * @param arguments property map - */ - public void setArguments(Map arguments) - { - this.arguments = arguments; - } - - - /** - * Return the embedded connection. - * - * @return header of Connection object. - */ - public ElementStub getEmbeddedConnection() - { - return embeddedConnection; - } - - - /** - * Set up the embedded connection - * - * @param embeddedConnection header of Connection object - */ - public void setEmbeddedConnection(ElementStub embeddedConnection) - { - this.embeddedConnection = embeddedConnection; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "EmbeddedConnection{" + - "position=" + position + - ", displayName='" + displayName + '\'' + - ", arguments=" + arguments + - ", embeddedConnection=" + embeddedConnection + - '}'; - } - - - /** - * 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; - } - EmbeddedConnection that = (EmbeddedConnection) objectToCompare; - return position == that.position && - Objects.equals(displayName, that.displayName) && - Objects.equals(arguments, that.arguments) && - Objects.equals(embeddedConnection, that.embeddedConnection); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(position, displayName, arguments, embeddedConnection); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/EndpointElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/EndpointElement.java deleted file mode 100644 index 949e9cbc572..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/EndpointElement.java +++ /dev/null @@ -1,150 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.EndpointProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * EndpointElement contains the properties and header for an endpoint retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class EndpointElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private EndpointProperties endpointProperties = null; - private ElementHeader elementHeader = null; - - - /** - * Default constructor - */ - public EndpointElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public EndpointElement(EndpointElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - endpointProperties = template.getEndpointProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties for the endpoint. - * - * @return asset properties (using appropriate subclass) - */ - public EndpointProperties getEndpointProperties() - { - return endpointProperties; - } - - - /** - * Set up the properties for the endpoint. - * - * @param endpointProperties asset properties - */ - public void setEndpointProperties(EndpointProperties endpointProperties) - { - this.endpointProperties = endpointProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "EndpointElement{" + - "endpointProperties=" + endpointProperties + - ", elementHeader=" + elementHeader + - '}'; - } - - - /** - * Return comparison result based on the content of the properties. - * - * @param objectToCompare test object - * @return result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - EndpointElement that = (EndpointElement) objectToCompare; - return Objects.equals(getEndpointProperties(), that.getEndpointProperties()) && - Objects.equals(getElementHeader(), that.getElementHeader()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, endpointProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FileElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FileElement.java deleted file mode 100644 index a8ba75c1d08..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FileElement.java +++ /dev/null @@ -1,154 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.FileProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * FileElement contains the properties and header for a file retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class FileElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ElementHeader elementHeader = null; - private FileProperties fileProperties = null; - - - /** - * Default constructor - */ - public FileElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public FileElement(FileElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - fileProperties = template.getFileProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties that describe the file. - * - * @return properties bean - */ - public FileProperties getFileProperties() - { - return fileProperties; - } - - - /** - * Set up the file properties. - * - * @param fileProperties properties bean - */ - public void setFileProperties(FileProperties fileProperties) - { - this.fileProperties = fileProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "FileElement{" + - "elementHeader=" + elementHeader + - ", fileProperties=" + fileProperties + - '}'; - } - - - /** - * 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; - } - FileElement that = (FileElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(fileProperties, that.fileProperties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, fileProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FileSystemElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FileSystemElement.java deleted file mode 100644 index aefcecf388e..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FileSystemElement.java +++ /dev/null @@ -1,154 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.FileSystemProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * FileSystemElement contains the properties and header for a file system retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class FileSystemElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ElementHeader elementHeader = null; - private FileSystemProperties fileSystemProperties = null; - - - /** - * Default constructor - */ - public FileSystemElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public FileSystemElement(FileSystemElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - fileSystemProperties = template.getFileSystemProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the file system properties. - * - * @return properties bean - */ - public FileSystemProperties getFileSystemProperties() - { - return fileSystemProperties; - } - - - /** - * Set up the file system properties. - * - * @param fileSystemProperties properties bean - */ - public void setFileSystemProperties(FileSystemProperties fileSystemProperties) - { - this.fileSystemProperties = fileSystemProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "FileSystemElement{" + - "elementHeader=" + elementHeader + - ", fileSystemProperties=" + fileSystemProperties + - '}'; - } - - - /** - * 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; - } - FileSystemElement that = (FileSystemElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(fileSystemProperties, that.fileSystemProperties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, fileSystemProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FolderElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FolderElement.java deleted file mode 100644 index fe866638f02..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/FolderElement.java +++ /dev/null @@ -1,154 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.FolderProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * FolderElement contains the properties and header for a Folder retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class FolderElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ElementHeader elementHeader = null; - private FolderProperties folderProperties = null; - - - /** - * Default constructor - */ - public FolderElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public FolderElement(FolderElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - folderProperties = template.getFolderProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties for the folder. - * - * @return bean properties - */ - public FolderProperties getFolderProperties() - { - return folderProperties; - } - - - /** - * Set up the properties for a folder. - * - * @param folderProperties bean properties - */ - public void setFolderProperties(FolderProperties folderProperties) - { - this.folderProperties = folderProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "FolderElement{" + - "elementHeader=" + elementHeader + - ", folderProperties=" + folderProperties + - '}'; - } - - - /** - * 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; - } - FolderElement that = (FolderElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(folderProperties, that.folderProperties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, folderProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/SchemaAttributeElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/SchemaAttributeElement.java deleted file mode 100644 index 3519978e188..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/SchemaAttributeElement.java +++ /dev/null @@ -1,154 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.SchemaAttributeProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * SchemaAttributeElement contains the properties and header for a schema attribute retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class SchemaAttributeElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ElementHeader elementHeader = null; - private SchemaAttributeProperties schemaAttributeProperties = null; - - - /** - * Default constructor - */ - public SchemaAttributeElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public SchemaAttributeElement(SchemaAttributeElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - schemaAttributeProperties = template.getSchemaAttributeProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties for a schema attribute. - * - * @return properties bean - */ - public SchemaAttributeProperties getSchemaAttributeProperties() - { - return schemaAttributeProperties; - } - - - /** - * Set up the properties for a schema attribute. - * - * @param schemaAttributeProperties properties bean - */ - public void setSchemaAttributeProperties(SchemaAttributeProperties schemaAttributeProperties) - { - this.schemaAttributeProperties = schemaAttributeProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "SchemaAttributeElement{" + - "elementHeader=" + elementHeader + - ", schemaAttributeProperties=" + schemaAttributeProperties + - '}'; - } - - - /** - * 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; - } - SchemaAttributeElement that = (SchemaAttributeElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(schemaAttributeProperties, that.schemaAttributeProperties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, schemaAttributeProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/SchemaTypeElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/SchemaTypeElement.java deleted file mode 100644 index 06bc1f6e440..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/SchemaTypeElement.java +++ /dev/null @@ -1,150 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.SchemaTypeProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * SchemaTypeElement contains the properties and header for a reference data asset retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class SchemaTypeElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private SchemaTypeProperties schemaTypeProperties = null; - private ElementHeader elementHeader = null; - - - /** - * Default constructor - */ - public SchemaTypeElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public SchemaTypeElement(SchemaTypeElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - schemaTypeProperties = template.getSchemaTypeProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties for the schema. - * - * @return schema properties (using appropriate subclass) - */ - public SchemaTypeProperties getSchemaTypeProperties() - { - return schemaTypeProperties; - } - - - /** - * Set up the properties for the schema. - * - * @param schemaTypeProperties schema properties - */ - public void setSchemaTypeProperties(SchemaTypeProperties schemaTypeProperties) - { - this.schemaTypeProperties = schemaTypeProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "SchemaTypeElement{" + - "elementHeader=" + elementHeader + - ", properties='" + getSchemaTypeProperties() + '\'' + - '}'; - } - - - /** - * 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; - } - SchemaTypeElement that = (SchemaTypeElement) objectToCompare; - return Objects.equals(schemaTypeProperties, that.schemaTypeProperties) && - Objects.equals(elementHeader, that.elementHeader); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, schemaTypeProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ValidValueElement.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ValidValueElement.java deleted file mode 100644 index 9794649f9ed..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/metadataelements/ValidValueElement.java +++ /dev/null @@ -1,154 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.ValidValueProperties; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; - -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; - -/** - * ValidValueElement contains the properties and header for a valid value definition or set entity retrieved from the metadata repository. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ValidValueElement implements MetadataElement, Serializable -{ - private static final long serialVersionUID = 1L; - - private ElementHeader elementHeader = null; - private ValidValueProperties validValueProperties = null; - - - /** - * Default constructor - */ - public ValidValueElement() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public ValidValueElement(ValidValueElement template) - { - if (template != null) - { - elementHeader = template.getElementHeader(); - validValueProperties = template.getValidValueProperties(); - } - } - - - /** - * Return the element header associated with the properties. - * - * @return element header object - */ - @Override - public ElementHeader getElementHeader() - { - return elementHeader; - } - - - /** - * Set up the element header associated with the properties. - * - * @param elementHeader element header object - */ - @Override - public void setElementHeader(ElementHeader elementHeader) - { - this.elementHeader = elementHeader; - } - - - /** - * Return the properties for a valid value definition or set. - * - * @return properties bean - */ - public ValidValueProperties getValidValueProperties() - { - return validValueProperties; - } - - - /** - * Set up the properties for a valid values definition of set. - * - * @param validValueProperties properties bean - */ - public void setValidValueProperties(ValidValueProperties validValueProperties) - { - this.validValueProperties = validValueProperties; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "ValidValueElement{" + - "elementHeader=" + elementHeader + - ", validValueProperties=" + validValueProperties + - '}'; - } - - - /** - * 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; - } - ValidValueElement that = (ValidValueElement) objectToCompare; - return Objects.equals(elementHeader, that.elementHeader) && - Objects.equals(validValueProperties, that.validValueProperties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementHeader, validValueProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/AssetProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/AssetProperties.java index 95cad3476b7..d9d3bf0835a 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/AssetProperties.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/AssetProperties.java @@ -1,78 +1,30 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* SPDX-License-Identifier: Apache 2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ + package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.ArrayList; -import java.util.HashMap; -import java.util.List; -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; /** - * AssetProperties holds asset properties that are used for displaying details of - * an asset in summary lists or hover text. It includes the following properties: - *
      - *
    • type - metadata type information for the asset
    • - *
    • guid - globally unique identifier for the asset
    • - *
    • url - external link for the asset
    • - *
    • qualifiedName - The official (unique) name for the asset. This is often defined by the IT systems - * management organization and should be used (when available) on audit logs and error messages. - * (qualifiedName from Referenceable - model 0010)
    • - *
    • displayName - A consumable name for the asset. Often a shortened form of the assetQualifiedName - * for use on user interfaces and messages. The assetDisplayName should only be used for audit logs and error - * messages if the assetQualifiedName is not set. (Sourced from attribute name within Asset - model 0010)
    • - *
    • shortDescription - short description about the asset. - * (Sourced from assetSummary within ConnectionsToAsset - model 0205)
    • - *
    • description - full description of the asset. - * (Sourced from attribute description within Asset - model 0010)
    • - *
    • owner - name of the person or organization that owns the asset. - * (Sourced from classification AssetOwnership or Ownership attached to Asset - model 0445)
    • - *
    • ownerTypeName - name of the element type identifying the person or organization that owns the asset. - * (Sourced from classification AssetOwnership or Ownership attached to Asset - model 0445)
    • - *
    • ownerPropertyName - name of the property identifying person or organization that owns the asset. - * (Sourced from classification AssetOwnership or Ownership attached to Asset - model 0445)
    • - *
    • zoneMembership - name of the person or organization that owns the asset. - * (Sourced from classification AssetZoneMemberShip attached to Asset - model 0424)
    • - *
    • origin - origin identifiers describing the source of the asset. - * (Sourced from classification AssetOrigin attached to Asset - model 0440)
    • - *
    • classifications - list of all classifications assigned to the asset
    • - *
    • extendedProperties - list of properties assigned to the asset from the Asset subclasses
    • - *
    • additionalProperties - list of properties assigned to the asset as additional properties
    • - *
    + * AssetProperties is a java bean used to describe assets managed by the governance program. */ @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 = DataStoreProperties.class, name = "DataStoreProperties"), -}) -public class AssetProperties extends ReferenceableProperties +public class AssetProperties extends SupplementaryProperties { private static final long serialVersionUID = 1L; - private String displayName = null; - private String description = null; - private String owner = null; - private String ownerTypeName = null; - private String ownerPropertyName = null; - private List zoneMembership = null; - private String originOrganizationGUID = null; - private String originBusinessCapabilityGUID = null; - private Map otherOriginValues = null; - + private String technicalName = null; + private String versionIdentifier = null; + private String technicalDescription = null; /** * Default constructor @@ -93,238 +45,79 @@ public AssetProperties(AssetProperties template) if (template != null) { - displayName = template.getDisplayName(); - description = template.getDescription(); - owner = template.getOwner(); - ownerTypeName = template.getOwnerTypeName(); - ownerPropertyName = template.getOwnerPropertyName(); - zoneMembership = template.getZoneMembership(); - originOrganizationGUID = template.getOriginOrganizationGUID(); - originBusinessCapabilityGUID = template.getOriginBusinessCapabilityGUID(); - otherOriginValues = template.getOtherOriginValues(); + technicalName = template.getDisplayName(); + versionIdentifier = template.getVersionIdentifier(); + technicalDescription = template.getTechnicalDescription(); } } /** - * Returns the stored display name property for the asset. - * If no display name is available then null is returned. + * Returns the stored technical name property for the asset. + * If no technical name is available then null is returned. * * @return String name */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Set up the stored display name property for the asset. - * - * @param displayName String name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Returns the stored description property for the asset. - * If no description is provided then null is returned. - * - * @return description String text - */ - public String getDescription() - { - return description; - } - - - /** - * Set up the stored description property associated with the asset. - * - * @param description String text - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * 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) + public String getTechnicalName() { - this.owner = owner; + return technicalName; } /** - * Returns the name of the type used to identify of the owner for this asset. + * Set up the stored technical name property for the asset. * - * @return owner String + * @param technicalName String name */ - public String getOwnerTypeName() + public void setTechnicalName(String technicalName) { - return ownerTypeName; + this.technicalName = technicalName; } /** - * Set up the name of the type used to identify the owner for this asset. + * Set up the version identifier of the resource. * - * @param ownerTypeName String name + * @return string version name */ - public void setOwnerTypeName(String ownerTypeName) + public String getVersionIdentifier() { - this.ownerTypeName = ownerTypeName; + return versionIdentifier; } /** - * Returns the property name used to identify the owner for this asset. + * Set up the version identifier of the resource. * - * @return owner String + * @param versionIdentifier string version name */ - public String getOwnerPropertyName() + public void setVersionIdentifier(String versionIdentifier) { - return ownerPropertyName; + this.versionIdentifier = versionIdentifier; } - /** - * Set up the property name used to identify the owner for this asset. - * - * @param ownerPropertyName String name - */ - public void setOwnerPropertyName(String ownerPropertyName) - { - this.ownerPropertyName = ownerPropertyName; - } - /** - * Return the names of the zones that this asset is a member of. - * - * @return list of zone names - */ - public List getZoneMembership() - { - if (zoneMembership == null) - { - return null; - } - else if (zoneMembership.isEmpty()) - { - return null; - } - else - { - return new ArrayList<>(zoneMembership); - } - } - - - /** - * Set up the names of the zones that this asset is a member of. - * - * @param zoneMembership list of zone names - */ - public void setZoneMembership(List zoneMembership) - { - this.zoneMembership = zoneMembership; - } - - - /** - * Return the unique identifier for the organization that originated this asset. - * - * @return string guid - */ - public String getOriginOrganizationGUID() - { - return originOrganizationGUID; - } - - - /** - * Set up the unique identifier for the organization that originated this asset. - * - * @param originOrganizationGUID string guid - */ - public void setOriginOrganizationGUID(String originOrganizationGUID) - { - this.originOrganizationGUID = originOrganizationGUID; - } - - - /** - * Return the unique identifier of the business capability that originated this asset. - * - * @return string guid - */ - public String getOriginBusinessCapabilityGUID() - { - return originBusinessCapabilityGUID; - } - - - /** - * Set up the unique identifier of the business capability that originated this asset. + * Returns the stored technical description property for the asset. + * If no description is provided then null is returned. * - * @param originBusinessCapabilityGUID string guid + * @return description String text */ - public void setOriginBusinessCapabilityGUID(String originBusinessCapabilityGUID) + public String getTechnicalDescription() { - this.originBusinessCapabilityGUID = originBusinessCapabilityGUID; + return technicalDescription; } /** - * Return the properties that characterize where this asset is from. + * Set up the stored technical description property associated with the asset. * - * @return map of name value pairs, all strings + * @param technicalDescription String text */ - public Map getOtherOriginValues() + public void setTechnicalDescription(String technicalDescription) { - if (otherOriginValues == null) - { - return null; - } - else if (otherOriginValues.isEmpty()) - { - return null; - } - else - { - return new HashMap<>(otherOriginValues); - } - } - - - /** - * Set up the properties that characterize where this asset is from. - * - * @param otherOriginValues map of name value pairs, all strings - */ - public void setOtherOriginValues(Map otherOriginValues) - { - this.otherOriginValues = otherOriginValues; + this.technicalDescription = technicalDescription; } @@ -337,19 +130,20 @@ public void setOtherOriginValues(Map otherOriginValues) public String toString() { return "AssetProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", owner='" + owner + '\'' + - ", ownerTypeName=" + ownerTypeName + - ", ownerPropertyName=" + ownerPropertyName+ - ", zoneMembership=" + zoneMembership + - ", originOrganizationGUID='" + originOrganizationGUID + '\'' + - ", originBusinessCapabilityGUID='" + originBusinessCapabilityGUID + '\'' + - ", otherOriginValues=" + otherOriginValues + - ", typeName='" + getTypeName() + '\'' + + "technicalName='" + technicalName + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", technicalDescription='" + technicalDescription + '\'' + ", qualifiedName='" + getQualifiedName() + '\'' + ", additionalProperties=" + getAdditionalProperties() + + ", effectiveFrom=" + getEffectiveFrom() + + ", effectiveTo=" + getEffectiveTo() + + ", typeName='" + getTypeName() + '\'' + ", extendedProperties=" + getExtendedProperties() + + ", displayName='" + getDisplayName() + '\'' + + ", summary='" + getSummary() + '\'' + + ", description='" + getDescription() + '\'' + + ", abbreviation='" + getAbbreviation() + '\'' + + ", usage='" + getUsage() + '\'' + '}'; } @@ -367,24 +161,26 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof AssetProperties)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } + AssetProperties that = (AssetProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(owner, that.owner) && - Objects.equals(ownerTypeName, that.ownerTypeName) && - Objects.equals(ownerPropertyName, that.ownerPropertyName) && - Objects.equals(zoneMembership, that.zoneMembership) && - Objects.equals(originOrganizationGUID, that.originOrganizationGUID) && - Objects.equals(originBusinessCapabilityGUID, that.originBusinessCapabilityGUID) && - Objects.equals(otherOriginValues, that.otherOriginValues); + + if (technicalName != null ? ! technicalName.equals(that.technicalName) : that.technicalName != null) + { + return false; + } + if (versionIdentifier != null ? ! versionIdentifier.equals(that.versionIdentifier) : that.versionIdentifier != null) + { + return false; + } + return technicalDescription != null ? technicalDescription.equals(that.technicalDescription) : that.technicalDescription == null; } @@ -396,8 +192,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, description, owner, ownerTypeName, ownerPropertyName, - zoneMembership, originOrganizationGUID, - originBusinessCapabilityGUID, otherOriginValues); + return Objects.hash(super.hashCode(), technicalName, versionIdentifier, technicalDescription); } -} \ No newline at end of file +} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ClassificationProperties.java new file mode 100644 index 00000000000..531c9b000fc --- /dev/null +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ClassificationProperties.java @@ -0,0 +1,189 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.stewardshipaction.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.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; + +/** + * RelationshipProperties provides the base class for relationships 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) +public class ClassificationProperties implements Serializable +{ + 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/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ComplexSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ComplexSchemaTypeProperties.java deleted file mode 100644 index aa7896c5331..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ComplexSchemaTypeProperties.java +++ /dev/null @@ -1,142 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * ComplexSchemaTypeProperties describes a schema with multiple attributes. Notice it does not contain the attributes, - * just a count of them. This is because a complex schema type may have literally thousands of attributes - * and so the attribute contents are retrieved separated through calls that support paging. - */ -@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 = DocumentSchemaAttributeProperties.class, name = "DocumentSchemaAttributeProperties"), - @JsonSubTypes.Type(value = StructSchemaTypeProperties.class, name = "StructSchemaTypeProperties"), - @JsonSubTypes.Type(value = TabularSchemaTypeProperties.class, name = "TabularSchemaTypeProperties"), -}) -public class ComplexSchemaTypeProperties extends SchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private int attributeCount = 0; - - - /** - * Default constructor used by subclasses - */ - public ComplexSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public ComplexSchemaTypeProperties(ComplexSchemaTypeProperties template) - { - super(template); - - if (template != null) - { - attributeCount = template.getAttributeCount(); - } - } - - - /** - * Return the count of attributes in this schema type. - * - * @return String data type name - */ - public int getAttributeCount() { return attributeCount; } - - - /** - * Set up the count of attributes in this schema type - * - * @param attributeCount data type name - */ - public void setAttributeCount(int attributeCount) - { - this.attributeCount = attributeCount; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ComplexSchemaType{" + - "attributeCount='" + attributeCount + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - ComplexSchemaTypeProperties that = (ComplexSchemaTypeProperties) objectToCompare; - return attributeCount == that.attributeCount; - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), attributeCount); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ConnectionProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ConnectionProperties.java deleted file mode 100644 index 05ed5e6daf0..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ConnectionProperties.java +++ /dev/null @@ -1,379 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * The connection is an object that contains the properties needed to create and initialise a connector to access a - * specific data assets. - * - * The properties for a connection are defined in model 0201. They include the following options for connector name: - *
      - *
    • - * guid - Globally unique identifier for the connection. - *
    • - *
    • - * url - URL of the connection definition in the metadata repository. - * This URL can be stored as a property in another entity to create an explicit link to this connection. - *
    • - *
    • - * qualifiedName - The official (unique) name for the connection. - * This is often defined by the IT systems management organization and should be used (when available) on - * audit logs and error messages. The qualifiedName is defined in the 0010 model as part of Referenceable. - *
    • - *
    • - * displayName - A consumable name for the connection. Often a shortened form of the qualifiedName for use - * on user interfaces and messages. The displayName should be only be used for audit logs and error messages - * if the qualifiedName is not set. - *
    • - *
    - * - * Either the guid, qualifiedName or displayName can be used to specify the name for a connection. - * - * Other properties for the connection include: - *
      - *
    • - * type - information about the TypeDef for Connection - *
    • - *
    • - * description - A full description of the connection covering details of the assets it connects to - * along with usage and version information. - *
    • - *
    • - * additionalProperties - Any additional properties associated with the connection. - *
    • - *
    • - * configurationProperties - properties for configuring the connector. - *
    • - *
    • - * securedProperties - Protected properties for secure log on by connector to back end server. These - * are protected properties that can only be retrieved by privileged connector code. - *
    • - *
    • - * userId - name or URI or connecting user. - *
    • - *
    • - * encryptedPassword - password for the userId - needs decrypting by connector before use. - *
    • - *
    • - * clearPassword - password for userId - ready to use. - *
    • - *
    • - * connectorType - Properties that describe the connector type for the connector. - *
    • - *
    • - * endpoint - Properties that describe the server endpoint where the connector will retrieve the assets. - *
    • - *
    • - * assetSummary - short description of the connected asset (if any). - *
    • - *
    - * - * The connection class is simply used to cache the properties for an connection. - * It is used by other classes to exchange this information between a metadata repository and a consumer. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ConnectionProperties extends ReferenceableProperties -{ - private static final long serialVersionUID = 1L; - - /* - * Attributes of a connector - */ - private String displayName = null; - private String description = null; - private String userId = null; - private String encryptedPassword = null; - private String clearPassword = null; - private Map configurationProperties = null; - private Map securedProperties = null; - - - /** - * Default constructor sets the Connection properties to null. - */ - public ConnectionProperties() - { - super(); - } - - - /** - * Copy/clone Constructor to return a copy of a connection object. - * - * @param template Connection to copy - */ - public ConnectionProperties(ConnectionProperties template) - { - super(template); - - if (template != null) - { - displayName = template.getDisplayName(); - description = template.getDescription(); - userId = template.getUserId(); - clearPassword = template.getClearPassword(); - encryptedPassword = template.getEncryptedPassword(); - configurationProperties = template.getConfigurationProperties(); - securedProperties = template.getSecuredProperties(); - } - } - - - /** - * Returns the stored display name property for the connection. - * Null means no displayName is available. - * - * @return displayName - */ - public String getDisplayName() { return displayName; } - - - /** - * Set up the display name for UIs and reports. - * - * @param displayName String name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Set up description of the element. - * - * @param description String - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * Returns the stored description property for the connection. - * If no description is provided then null is returned. - * - * @return description - */ - public String getDescription() - { - return description; - } - - - /** - * Return the userId to use on this connection. - * - * @return string - */ - public String getUserId() - { - return userId; - } - - - /** - * Set up the userId to use on this connection. - * - * @param userId string - */ - public void setUserId(String userId) - { - this.userId = userId; - } - - - /** - * Return an encrypted password. The caller is responsible for decrypting it. - * - * @return string - */ - public String getEncryptedPassword() - { - return encryptedPassword; - } - - - /** - * Set up an encrypted password. - * - * @param encryptedPassword string - */ - public void setEncryptedPassword(String encryptedPassword) - { - this.encryptedPassword = encryptedPassword; - } - - - /** - * Return an unencrypted password. - * - * @return string - */ - public String getClearPassword() - { - return clearPassword; - } - - - /** - * Set up an unencrypted password. - * - * @param clearPassword string - */ - public void setClearPassword(String clearPassword) - { - this.clearPassword = clearPassword; - } - - - /** - * Set up the configuration properties for this Connection. - * - * @param configurationProperties properties that contain additional configuration information for the connector. - */ - public void setConfigurationProperties(Map configurationProperties) - { - this.configurationProperties = configurationProperties; - } - - - /** - * Return a copy of the configuration properties. Null means no secured properties are available. - * - * @return secured properties typically user credentials for the connection - */ - public Map getConfigurationProperties() - { - if (configurationProperties == null) - { - return null; - } - else if (configurationProperties.isEmpty()) - { - return null; - } - else - { - return new HashMap<>(configurationProperties); - } - } - - - /** - * Set up the secured properties for this Connection. - * - * @param securedProperties properties that contain secret information such as log on information. - */ - public void setSecuredProperties(Map securedProperties) - { - this.securedProperties = securedProperties; - } - - - /** - * Return a copy of the secured properties. Null means no secured properties are available. - * - * @return secured properties typically user credentials for the connection - */ - public Map getSecuredProperties() - { - if (securedProperties == null) - { - return null; - } - else if (securedProperties.isEmpty()) - { - return null; - } - else - { - return new HashMap<>(securedProperties); - } - } - - - /** - * Standard toString method. Note SecuredProperties and other credential type properties are not displayed. - * This is deliberate because there is no knowing where the string will be printed. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ConnectionProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", userId='" + userId + '\'' + - ", encryptedPassword='" + encryptedPassword + '\'' + - ", clearPassword='" + clearPassword + '\'' + - ", configurationProperties=" + configurationProperties + - ", securedProperties=" + securedProperties + - ", 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; - } - ConnectionProperties that = (ConnectionProperties) objectToCompare; - return Objects.equals(getDisplayName(), that.getDisplayName()) && - Objects.equals(getDescription(), that.getDescription()) && - Objects.equals(getUserId(), that.getUserId()) && - Objects.equals(getEncryptedPassword(), that.getEncryptedPassword()) && - Objects.equals(getClearPassword(), that.getClearPassword()) && - Objects.equals(getConfigurationProperties(), that.getConfigurationProperties()) && - Objects.equals(getSecuredProperties(), that.getSecuredProperties()); - } - - - /** - * Return hash code based on properties. - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), getDisplayName(), getDescription(), - getUserId(), getEncryptedPassword(), getClearPassword(), getSecuredProperties(), - getConfigurationProperties()); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ConnectorTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ConnectorTypeProperties.java deleted file mode 100644 index 71a018de797..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ConnectorTypeProperties.java +++ /dev/null @@ -1,611 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -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; - -/** - * The ConnectorTypeProperties describe the implementation details of a particular type of connector. - * The properties for a connector type are defined in model 0201. - * They include: - * - *
      - *
    • - * guid - Globally unique identifier for the connector type. - *
    • - *
    • - * qualifiedName - The official (unique) name for the connector type. This is often defined by the IT - * systems management organization and should be used (when available) on audit logs and error messages. - *
    • - *
    • - * displayName - A consumable name for the connector type. Often a shortened form of the qualifiedName for use - * on user interfaces and messages. The displayName should be only be used for audit logs and error messages - * if the qualifiedName is not set. - *
    • - *
    • - * description - A full description of the connector type covering details of the assets it connects to - * along with usage and versioning information. - *
    • - *
    • - * supportedAssetTypeName - the type of asset that the connector implementation supports. - *
    • - *
    • - * expectedDataFormat - the format of the data that the connector supports - null for "any". - *
    • - *
    • - * connectorProviderClassName - The connector provider is the factory for a particular type of connector. - * This property defines the class name for the connector provider that the Connector Broker should use to request - * new connector instances. - *
    • - *
    • - * connectorFrameworkName - name of the connector framework that the connector implements - default Open Connector Framework (OCF). - *
    • - *
    • - * connectorInterfaceLanguage - the language that the connector is implemented in - default Java. - *
    • - *
    • - * connectorInterfaces - list of interfaces that the connector supports. - *
    • - *
    • - * targetTechnologySource - the organization that supplies the target technology that the connector implementation connects to. - *
    • - *
    • - * targetTechnologyName - the name of the target technology that the connector implementation connects to. - *
    • - *
    • - * targetTechnologyInterfaces - the names of the interfaces in the target technology that the connector calls. - *
    • - *
    • - * targetTechnologyVersions - the versions of the target technology that the connector supports. - *
    • - *
    • - * recognizedAdditionalProperties - these are the Connection additional properties recognized by the connector implementation - *
    • - *
    • - * recognizedConfigurationProperties - these are the Connection configuration properties recognized by the connector implementation - *
    • - *
    • - * recognizedSecuredProperties - these are the Connection secured properties recognized by the connector implementation - *
    • - *
    • - * additionalProperties - Any additional properties that the connector provider needs to know in order to - * create connector instances. - *
    • - *
    - * - * The connectorTypeProperties class is simply used to cache the properties for an connector type. - * It is used by other classes to exchange this information between a metadata repository and a consumer. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ConnectorTypeProperties extends ReferenceableProperties -{ - private static final long serialVersionUID = 1L; - - /* - * Attributes of a connector type - */ - private String displayName = null; - private String description = null; - private String supportedAssetTypeName = null; - private String expectedDataFormat = null; - private String connectorProviderClassName = null; - private String connectorFrameworkName = null; - private String connectorInterfaceLanguage = null; - private List connectorInterfaces = null; - private String targetTechnologySource = null; - private String targetTechnologyName = null; - private List targetTechnologyInterfaces = null; - private List targetTechnologyVersions = null; - private List recognizedAdditionalProperties = null; - private List recognizedConfigurationProperties = null; - private List recognizedSecuredProperties = null; - - - - /** - * Default constructor - */ - public ConnectorTypeProperties() - { - super(); - } - - - /** - * Copy/clone constructor for a connectorType that is not connected to an asset (either directly or indirectly). - * - * @param template template object to copy. - */ - public ConnectorTypeProperties(ConnectorTypeProperties template) - { - super(template); - - if (template != null) - { - displayName = template.getDisplayName(); - description = template.getDescription(); - supportedAssetTypeName = template.getSupportedAssetTypeName(); - expectedDataFormat = template.getExpectedDataFormat(); - connectorProviderClassName = template.getConnectorProviderClassName(); - connectorFrameworkName = template.getConnectorFrameworkName(); - connectorInterfaceLanguage = template.getConnectorInterfaceLanguage(); - connectorInterfaces = template.getConnectorInterfaces(); - targetTechnologySource = template.getTargetTechnologySource(); - targetTechnologyName = template.getTargetTechnologyName(); - targetTechnologyInterfaces = template.getTargetTechnologyInterfaces(); - targetTechnologyVersions = template.getTargetTechnologyVersions(); - recognizedAdditionalProperties = template.getRecognizedAdditionalProperties(); - recognizedConfigurationProperties = template.getRecognizedConfigurationProperties(); - recognizedSecuredProperties = template.getRecognizedSecuredProperties(); - } - } - - /** - * Set up the display name for UIs and reports. - * - * @param displayName String name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Returns the stored display name property for the connector type. - * If no display name is available then null is returned. - * - * @return displayName - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Set up description of the element. - * - * @param description String - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * Returns the stored description property for the connector type. - * If no description is available then null is returned. - * - * @return description - */ - public String getDescription() - { - return description; - } - - - /** - * Return the type of asset that the connector implementation supports. - * - * @return string name - */ - public String getSupportedAssetTypeName() - { - return supportedAssetTypeName; - } - - - /** - * Set up the type of asset that the connector implementation supports. - * - * @param supportedAssetTypeName string name - */ - public void setSupportedAssetTypeName(String supportedAssetTypeName) - { - this.supportedAssetTypeName = supportedAssetTypeName; - } - - - /** - * Return the format of the data that the connector supports - null for "any". - * - * @return string name - */ - public String getExpectedDataFormat() - { - return expectedDataFormat; - } - - - /** - * Set up the format of the data that the connector supports - null for "any". - * - * @param expectedDataFormat string name - */ - public void setExpectedDataFormat(String expectedDataFormat) - { - this.expectedDataFormat = expectedDataFormat; - } - - - /** - * The name of the connector provider class name. - * - * @param connectorProviderClassName String class name - */ - public void setConnectorProviderClassName(String connectorProviderClassName) - { - this.connectorProviderClassName = connectorProviderClassName; - } - - - /** - * Returns the stored connectorProviderClassName property for the connector type. - * If no connectorProviderClassName is available then null is returned. - * - * @return connectorProviderClassName class name (including package name) - */ - public String getConnectorProviderClassName() - { - return connectorProviderClassName; - } - - - /** - * Return name of the connector framework that the connector implements - default Open Connector Framework (OCF). - * - * @return string name - */ - public String getConnectorFrameworkName() - { - return connectorFrameworkName; - } - - - /** - * Set up name of the connector framework that the connector implements - default Open Connector Framework (OCF). - * - * @param connectorFrameworkName string name - */ - public void setConnectorFrameworkName(String connectorFrameworkName) - { - this.connectorFrameworkName = connectorFrameworkName; - } - - - /** - * Return the language that the connector is implemented in - default Java. - * - * @return string name - */ - public String getConnectorInterfaceLanguage() - { - return connectorInterfaceLanguage; - } - - - /** - * Set up the language that the connector is implemented in - default Java. - * - * @param connectorInterfaceLanguage string name - */ - public void setConnectorInterfaceLanguage(String connectorInterfaceLanguage) - { - this.connectorInterfaceLanguage = connectorInterfaceLanguage; - } - - - /** - * Return list of interfaces that the connector supports. - * - * @return list of names - */ - public List getConnectorInterfaces() - { - return connectorInterfaces; - } - - - /** - * Set up list of interfaces that the connector supports. - * - * @param connectorInterfaces list of names - */ - public void setConnectorInterfaces(List connectorInterfaces) - { - this.connectorInterfaces = connectorInterfaces; - } - - - /** - * Return the name of the organization that supplies the target technology that the connector implementation connects to. - * - * @return string name - */ - public String getTargetTechnologySource() - { - return targetTechnologySource; - } - - - /** - * Set up the name of the organization that supplies the target technology that the connector implementation connects to. - * - * @param targetTechnologySource list of names - */ - public void setTargetTechnologySource(String targetTechnologySource) - { - this.targetTechnologySource = targetTechnologySource; - } - - - /** - * Return the name of the target technology that the connector implementation connects to. - * - * @return string name - */ - public String getTargetTechnologyName() - { - return targetTechnologyName; - } - - - /** - * Set up the name of the target technology that the connector implementation connects to. - * - * @param targetTechnologyName string name - */ - public void setTargetTechnologyName(String targetTechnologyName) - { - this.targetTechnologyName = targetTechnologyName; - } - - - /** - * Return the names of the interfaces in the target technology that the connector calls. - * - * @return list of interface names - */ - public List getTargetTechnologyInterfaces() - { - return targetTechnologyInterfaces; - } - - - /** - * Set up the names of the interfaces in the target technology that the connector calls. - * - * @param targetTechnologyInterfaces list of interface names - */ - public void setTargetTechnologyInterfaces(List targetTechnologyInterfaces) - { - this.targetTechnologyInterfaces = targetTechnologyInterfaces; - } - - - /** - * Return the versions of the target technology that the connector supports. - * - * @return list of version identifiers - */ - public List getTargetTechnologyVersions() - { - return targetTechnologyVersions; - } - - - /** - * Set up the versions of the target technology that the connector supports. - * - * @param targetTechnologyVersions list of version identifiers - */ - public void setTargetTechnologyVersions(List targetTechnologyVersions) - { - this.targetTechnologyVersions = targetTechnologyVersions; - } - - - /** - * Set up the list of property names that this connector/connector provider implementation looks for - * in the Connection object's additionalProperties. - * - * @param recognizedAdditionalProperties list of property names - */ - public void setRecognizedAdditionalProperties(List recognizedAdditionalProperties) - { - this.recognizedAdditionalProperties = recognizedAdditionalProperties; - } - - - /** - * Return the list of property names that this connector/connector provider implementation looks for - * in the Connection object's additionalProperties. - * - * @return list of property names - */ - public List getRecognizedAdditionalProperties() - { - if (recognizedAdditionalProperties == null) - { - return null; - } - else if (recognizedAdditionalProperties.isEmpty()) - { - return null; - } - else - { - return recognizedAdditionalProperties; - } - } - - - /** - * Set up the list of property names that this connector/connector provider implementation looks for - * in the Connection object's configurationProperties. - * - * @param recognizedConfigurationProperties list of property names - */ - public void setRecognizedConfigurationProperties(List recognizedConfigurationProperties) - { - - this.recognizedConfigurationProperties = recognizedConfigurationProperties; - } - - - /** - * Return the list of property names that this connector/connector provider implementation looks for - * in the Connection object's configurationProperties. - * - * @return list of property names - */ - public List getRecognizedConfigurationProperties() - { - if (recognizedConfigurationProperties == null) - { - return null; - } - else if (recognizedConfigurationProperties.isEmpty()) - { - return null; - } - else - { - return recognizedConfigurationProperties; - } - } - - - /** - * Set up the list of property names that this connector/connector provider implementation looks for - * in the Connection object's securedProperties. - * - * @param recognizedSecuredProperties list of property names - */ - public void setRecognizedSecuredProperties(List recognizedSecuredProperties) - { - this.recognizedSecuredProperties = recognizedSecuredProperties; - } - - - /** - * Return the list of property names that this connector/connector provider implementation looks for - * in the Connection object's securedProperties. - * - * @return list of property names - */ - public List getRecognizedSecuredProperties() - { - if (recognizedSecuredProperties == null) - { - return null; - } - else if (recognizedSecuredProperties.isEmpty()) - { - return null; - } - else - { - return recognizedSecuredProperties; - } - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ConnectorTypeProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", supportedAssetTypeName='" + supportedAssetTypeName + '\'' + - ", expectedDataFormat='" + expectedDataFormat + '\'' + - ", connectorProviderClassName='" + connectorProviderClassName + '\'' + - ", connectorFrameworkName='" + connectorFrameworkName + '\'' + - ", connectorInterfaceLanguage='" + connectorInterfaceLanguage + '\'' + - ", connectorInterfaces=" + connectorInterfaces + - ", targetTechnologySource='" + targetTechnologySource + '\'' + - ", targetTechnologyName='" + targetTechnologyName + '\'' + - ", targetTechnologyInterfaces=" + targetTechnologyInterfaces + - ", targetTechnologyVersions=" + targetTechnologyVersions + - ", recognizedAdditionalProperties=" + recognizedAdditionalProperties + - ", recognizedConfigurationProperties=" + recognizedConfigurationProperties + - ", recognizedSecuredProperties=" + recognizedSecuredProperties + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - ConnectorTypeProperties that = (ConnectorTypeProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(supportedAssetTypeName, that.supportedAssetTypeName) && - Objects.equals(expectedDataFormat, that.expectedDataFormat) && - Objects.equals(connectorProviderClassName, that.connectorProviderClassName) && - Objects.equals(connectorFrameworkName, that.connectorFrameworkName) && - Objects.equals(connectorInterfaceLanguage, that.connectorInterfaceLanguage) && - Objects.equals(connectorInterfaces, that.connectorInterfaces) && - Objects.equals(targetTechnologySource, that.targetTechnologySource) && - Objects.equals(targetTechnologyName, that.targetTechnologyName) && - Objects.equals(targetTechnologyInterfaces, that.targetTechnologyInterfaces) && - Objects.equals(targetTechnologyVersions, that.targetTechnologyVersions) && - Objects.equals(recognizedAdditionalProperties, that.recognizedAdditionalProperties) && - Objects.equals(recognizedConfigurationProperties, that.recognizedConfigurationProperties) && - Objects.equals(recognizedSecuredProperties, that.recognizedSecuredProperties); - } - - - /** - * Hash of properties - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), displayName, description, supportedAssetTypeName, expectedDataFormat, connectorProviderClassName, - connectorFrameworkName, connectorInterfaceLanguage, connectorInterfaces, targetTechnologySource, targetTechnologyName, - targetTechnologyInterfaces, targetTechnologyVersions, recognizedAdditionalProperties, recognizedConfigurationProperties, - recognizedSecuredProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java deleted file mode 100644 index e27dadd7ea8..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataItemSortOrder.java +++ /dev/null @@ -1,138 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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; - -/** - * DataItemSortOrder is used for schema attributes that may have multiple instances. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@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."), - 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 (3, 99, "Unsorted", "The instances of the schema attribute may appear in any order."); - - - public static final String ENUM_TYPE_GUID = "aaa4df8f-1aca-4de8-9abd-1ef2aadba300"; - public static final String ENUM_TYPE_NAME = "DataItemSortOrder"; - - 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 - */ - DataItemSortOrder(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 "DataItemSortOrder{" + - "codeValue=" + ordinal + - ", codeName='" + name + '\'' + - ", description='" + description + - '}'; - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataStoreProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataStoreProperties.java deleted file mode 100644 index 655d980b63e..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DataStoreProperties.java +++ /dev/null @@ -1,326 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.Date; -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; - -/** - * DataStoreProperties provides the JavaBean for describing a data store. This is a physical store of data. - * It is saved in the catalog as an asset. - */ -@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 = FileProperties.class, name = "FileProperties"), - @JsonSubTypes.Type(value = FolderProperties.class, name = "FolderProperties") - - }) -public class DataStoreProperties extends AssetProperties -{ - private static final long serialVersionUID = 1L; - - private String pathName = null; - private Date createTime = null; - private Date modifiedTime = null; - private String encodingType = null; - private String encodingLanguage = null; - private String encodingDescription = null; - private Map encodingProperties = null; - - - /** - * Default constructor - */ - public DataStoreProperties() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public DataStoreProperties(DataStoreProperties template) - { - super(template); - - if (template != null) - { - pathName = template.getPathName(); - createTime = template.getCreateTime(); - modifiedTime = template.getModifiedTime(); - encodingType = template.getEncodingType(); - encodingLanguage = template.getEncodingLanguage(); - encodingDescription = template.getEncodingDescription(); - encodingProperties = template.getEncodingProperties(); - } - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public DataStoreProperties(AssetProperties template) - { - super(template); - } - - - /** - * Return the fully qualified physical location of the data store. This should be suitable for the - * network address of the Endpoint. - * - * @return string name - */ - public String getPathName() - { - return pathName; - } - - - /** - * Set up the fully qualified physical location of the data store. This should be suitable for the - * network address of the Endpoint. - * - * @param pathName string name - */ - public void setPathName(String pathName) - { - this.pathName = pathName; - } - - - /** - * Return the time that the data store was created. - * - * @return date - */ - public Date getCreateTime() - { - return createTime; - } - - - /** - * Set up the time that the data store was created. - * - * @param createTime date - */ - public void setCreateTime(Date createTime) - { - this.createTime = createTime; - } - - - /** - * Return the last known time the data store was modified. - * - * @return date - */ - public Date getModifiedTime() - { - return modifiedTime; - } - - - /** - * Setup the last known time the data store was modified. - * - * @param modifiedTime date - */ - public void setModifiedTime(Date modifiedTime) - { - this.modifiedTime = modifiedTime; - } - - - /** - * Return the name of the encoding style used in the data store. - * - * @return string name - */ - public String getEncodingType() - { - return encodingType; - } - - - /** - * Set up the name of the encoding style used in the data store. - * - * @param encodingType string name - */ - public void setEncodingType(String encodingType) - { - this.encodingType = encodingType; - } - - - /** - * Return the name of the natural language used for text strings within the data store. - * - * @return string language name - */ - public String getEncodingLanguage() - { - return encodingLanguage; - } - - - /** - * Set up the name of the natural language used for text strings within the data store. - * - * @param encodingLanguage string language name - */ - public void setEncodingLanguage(String encodingLanguage) - { - this.encodingLanguage = encodingLanguage; - } - - - /** - * Return the description of the encoding used in the data store. - * - * @return string text - */ - public String getEncodingDescription() - { - return encodingDescription; - } - - - /** - * Set up the description of the encoding used in the data store. - * - * @param encodingDescription string text - */ - public void setEncodingDescription(String encodingDescription) - { - this.encodingDescription = encodingDescription; - } - - - /** - * Return the additional properties associated with the encoding process. - * - * @return map of name-value pairs - */ - public Map getEncodingProperties() - { - if (encodingProperties == null) - { - return null; - } - else if (encodingProperties.isEmpty()) - { - return null; - } - return encodingProperties; - } - - - /** - * Set up the additional properties associated with the encoding process. - * - * @param encodingProperties map of name-value pairs - */ - public void setEncodingProperties(Map encodingProperties) - { - this.encodingProperties = encodingProperties; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - @SuppressWarnings(value = "deprecation") - public String toString() - { - return "DataStoreProperties{" + - "pathName=" + pathName + - ", createTime=" + createTime + - ", modifiedTime=" + modifiedTime + - ", encodingType='" + encodingType + '\'' + - ", encodingLanguage='" + encodingLanguage + '\'' + - ", encodingDescription='" + encodingDescription + '\'' + - ", encodingProperties='" + encodingProperties + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", owner='" + getOwner() + '\'' + - ", zoneMembership=" + getZoneMembership() + - ", origin=" + getOtherOriginValues() + - ", 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; - } - DataStoreProperties that = (DataStoreProperties) objectToCompare; - return Objects.equals(pathName, that.pathName) && - Objects.equals(createTime, that.createTime) && - Objects.equals(modifiedTime, that.modifiedTime) && - Objects.equals(encodingType, that.encodingType) && - Objects.equals(encodingLanguage, that.encodingLanguage) && - Objects.equals(encodingDescription, that.encodingDescription) && - Objects.equals(encodingProperties, that.encodingProperties); - } - - - /** - * Return hash code based on properties. - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), pathName, createTime, modifiedTime, encodingType, - encodingLanguage, encodingDescription, encodingProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DerivedSchemaTypeQueryTargetProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DerivedSchemaTypeQueryTargetProperties.java deleted file mode 100644 index f2401977300..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DerivedSchemaTypeQueryTargetProperties.java +++ /dev/null @@ -1,197 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -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; - -/** - * DerivedSchemaTypeQueryTargetProperties defines a query on a schema element that returns all or part of the value for a - * derived schema type. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class DerivedSchemaTypeQueryTargetProperties implements Serializable -{ - private static final long serialVersionUID = 1L; - - private String queryId = null; - private String query = null; - private String queryType = null; - private String queryTargetGUID = null; - - - - /** - * Default constructor - */ - public DerivedSchemaTypeQueryTargetProperties() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template template schema query to copy. - */ - public DerivedSchemaTypeQueryTargetProperties(DerivedSchemaTypeQueryTargetProperties template) - { - super(); - - if (template != null) - { - queryId = template.getQueryId(); - query = template.getQuery(); - queryType = template.getQueryType(); - queryTargetGUID = template.getQueryTargetGUID(); - } - } - - - /** - * Return the query id - this is used to identify where the results of this query should be plugged into - * the other queries or the formula for the parent derived schema element. - * - * @return String query identifier - */ - public String getQueryId() { return queryId; } - - - /** - * Set up the query id - this is used to identify where the results of this query should be plugged into - * the other queries or the formula for the parent derived schema element. - * - * @param queryId String query identifier - */ - public void setQueryId(String queryId) - { - this.queryId = queryId; - } - - - /** - * Return the query string for this element. The query string may have placeholders for values returned - * by queries that have a lower queryId than this element. - * - * @return String query - */ - public String getQuery() { return query; } - - - /** - * Set up the query string for this element. The query string may have placeholders for values returned - * by queries that have a lower queryId than this element. - * - * @param query String query - */ - public void setQuery(String query) - { - this.query = query; - } - - - /** - * Return the name of the query language used in the query. - * - * @return queryType String - */ - public String getQueryType() { return queryType; } - - - /** - * Set up the name of the query language used in the query. - * - * @param queryType String name - */ - public void setQueryType(String queryType) - { - this.queryType = queryType; - } - - - /** - * Return the unique identifier that describes the data source that will be queried to get part of the derived value. - * - * @return string guid - */ - public String getQueryTargetGUID() - { - return queryTargetGUID; - } - - - /** - * Set up the unique identifier that describes the data source that will be queried to get part of the derived value. - * - * @param queryTargetGUID string guid - */ - public void setQueryTargetGUID(String queryTargetGUID) - { - this.queryTargetGUID = queryTargetGUID; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "DerivedSchemaTypeQueryTargetProperties{" + - "queryId=" + queryId + - ", query='" + query + '\'' + - ", queryType='" + queryType + '\'' + - ", queryTargetGUID=" + queryTargetGUID + - '}'; - } - - - /** - * 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 DerivedSchemaTypeQueryTargetProperties)) - { - return false; - } - DerivedSchemaTypeQueryTargetProperties that = (DerivedSchemaTypeQueryTargetProperties) objectToCompare; - return Objects.equals(getQueryId(), that.getQueryId()) && - Objects.equals(getQuery(), that.getQuery()) && - Objects.equals(getQueryType(), that.getQueryType()) && - Objects.equals(getQueryTargetGUID(), that.getQueryTargetGUID()); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(getQueryId(), getQuery(), getQueryType(), getQueryTargetGUID()); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DocumentSchemaAttributeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DocumentSchemaAttributeProperties.java deleted file mode 100644 index 7867a3b9709..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DocumentSchemaAttributeProperties.java +++ /dev/null @@ -1,77 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * A DocumentSchemaAttributeProperties defines an attribute in a hierarchical document structure such as an - * XML document. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class DocumentSchemaAttributeProperties extends SchemaAttributeProperties -{ - private static final long serialVersionUID = 1L; - - - /** - * Default constructor - */ - public DocumentSchemaAttributeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public DocumentSchemaAttributeProperties(DocumentSchemaAttributeProperties template) - { - super(template); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "DocumentSchemaAttributeProperties{" + - "elementPosition=" + getElementPosition() + - ", minCardinality=" + getMinCardinality() + - ", maxCardinality=" + getMaxCardinality() + - ", allowsDuplicateValues=" + getAllowsDuplicateValues() + - ", orderedValues=" + getOrderedValues() + - ", sortOrder=" + getSortOrder() + - ", minimumLength=" + getMinimumLength() + - ", length=" + getLength() + - ", significantDigits=" + getPrecision() + - ", nullable=" + getIsNullable() + - ", defaultValueOverride='" + getDefaultValueOverride() + '\'' + - ", attributeType=" + getAttributeType() + - ", attributeRelationships=" + getAttributeRelationships() + - ", nativeJavaClass='" + getNativeJavaClass() + '\'' + - ", aliases=" + getAliases() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DocumentSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DocumentSchemaTypeProperties.java deleted file mode 100644 index 582ef0299ca..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/DocumentSchemaTypeProperties.java +++ /dev/null @@ -1,95 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * DocumentSchemaTypeProperties is a specific type of bean for a do a top-level hierarchical document structure such - * as an XML document. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class DocumentSchemaTypeProperties extends ComplexSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - - /** - * Default constructor used by subclasses - */ - public DocumentSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public DocumentSchemaTypeProperties(DocumentSchemaTypeProperties template) - { - super(template); - } - - - /** - * Returns a clone of this object as the abstract SchemaElement class. - * - * @return SchemaElement - */ - public SchemaElementProperties cloneSchemaElement() - { - return new DocumentSchemaTypeProperties(this); - } - - - /** - * Returns a clone of this object as the abstract SchemaType class. - * - * @return SchemaType object - */ - public SchemaTypeProperties cloneSchemaType() - { - return new DocumentSchemaTypeProperties(this); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "DocumentSchemaTypeProperties{" + - "cloneSchemaElement=" + cloneSchemaElement() + - ", cloneSchemaType=" + cloneSchemaType() + - ", attributeCount=" + getAttributeCount() + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/EndpointProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/EndpointProperties.java deleted file mode 100644 index 613f8f48717..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/EndpointProperties.java +++ /dev/null @@ -1,247 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * EndpointProperties describes the properties of a server endpoint. The endpoint is linked - * to the asset manager's server and describes its network endpoint. It is also linked to connection objects - * that are used by clients to connect to the asset manager. A connection is linked to each asset - * that is hosted on the asset manager. - */ -@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class EndpointProperties extends SupplementaryProperties -{ - private static final long serialVersionUID = 1L; - - private String technicalName = null; - private String technicalDescription = null; - private String address = null; - private String protocol = null; - private String encryptionMethod = null; - - - /** - * Default constructor - */ - public EndpointProperties() - { - super(); - } - - - /** - * Copy/clone constructor for an Endpoint. - * - * @param template template object to copy. - */ - public EndpointProperties(EndpointProperties template) - { - super(template); - - if (template != null) - { - technicalName = template.getTechnicalName(); - technicalDescription = template.getTechnicalDescription(); - address = template.getAddress(); - protocol = template.getProtocol(); - encryptionMethod = template.getEncryptionMethod(); - } - } - - - /** - * Set up the technical name for the endpoint. - * - * @param technicalName String name - */ - public void setTechnicalName(String technicalName) - { - this.technicalName = technicalName; - } - - - /** - * Returns the stored technical name property for the endpoint. - * If no technical name is available then null is returned. - * - * @return String name - */ - public String getTechnicalName() - { - return technicalName; - } - - - /** - * Set up the technical description of the endpoint. - * - * @param technicalDescription String - */ - public void setTechnicalDescription(String technicalDescription) - { - this.technicalDescription = technicalDescription; - } - - - /** - * Return the technical description for the endpoint. - * - * @return String technicalDescription - */ - public String getTechnicalDescription() - { - return technicalDescription; - } - - - /** - * Set up the network address of the endpoint. - * - * @param address String resource name - */ - public void setAddress(String address) - { - this.address = address; - } - - - /** - * Returns the stored address property for the endpoint. - * If no network address is available then null is returned. - * - * @return address - */ - public String getAddress() - { - return address; - } - - - /** - * Set up the protocol to use for this Endpoint - * - * @param protocol String protocol name - */ - public void setProtocol(String protocol) - { - this.protocol = protocol; - } - - - /** - * Returns the stored protocol property for the endpoint. - * If no protocol is available then null is returned. - * - * @return protocol - */ - public String getProtocol() - { - return protocol; - } - - - /** - * Set up the encryption method used on this Endpoint. - * - * @param encryptionMethod String name - */ - public void setEncryptionMethod(String encryptionMethod) - { - this.encryptionMethod = encryptionMethod; - } - - - /** - * Returns the stored encryptionMethod property for the endpoint. This is an open type allowing the information - * needed to work with a specific encryption mechanism used by the endpoint to be defined. - * If no encryptionMethod property is available (typically because this is an unencrypted endpoint) - * then null is returned. - * - * @return encryption method information - */ - public String getEncryptionMethod() - { - return encryptionMethod; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "EndpointProperties{" + - "technicalName='" + technicalName + '\'' + - ", technicalDescription='" + technicalDescription + '\'' + - ", address='" + address + '\'' + - ", protocol='" + protocol + '\'' + - ", encryptionMethod='" + encryptionMethod + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", summary='" + getSummary() + '\'' + - ", description='" + getDescription() + '\'' + - ", abbreviation='" + getAbbreviation() + '\'' + - ", usage='" + getUsage() + '\'' + - ", 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; - } - EndpointProperties that = (EndpointProperties) objectToCompare; - return Objects.equals(technicalName, that.technicalName) && - Objects.equals(technicalDescription, that.technicalDescription) && - Objects.equals(address, that.address) && - Objects.equals(protocol, that.protocol) && - Objects.equals(encryptionMethod, that.encryptionMethod); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), technicalName, technicalDescription, address, protocol, encryptionMethod); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/EnumSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/EnumSchemaTypeProperties.java deleted file mode 100644 index 2d4099cf81c..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/EnumSchemaTypeProperties.java +++ /dev/null @@ -1,133 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * EnumSchemaTypeProperties carries the specialized parameters for creating or updating enum schema types. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) - -public class EnumSchemaTypeProperties extends SimpleSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private String validValueSetGUID = null; - - /** - * Default constructor - */ - public EnumSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor - * - * @param template template object to copy. - */ - public EnumSchemaTypeProperties(EnumSchemaTypeProperties template) - { - super(template); - } - - - /** - * Return the unique identifier of the valid value set that describes the enum values for this schema element. - * - * @return string guid - */ - public String getValidValueSetGUID() - { - return validValueSetGUID; - } - - - /** - * Set up the unique identifier of the value set that describes the enum values for this schema element. - * - * @param validValueSetGUID string guid - */ - public void setValidValueSetGUID(String validValueSetGUID) - { - this.validValueSetGUID = validValueSetGUID; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "EnumSchemaTypeProperties{" + - "validValueSet='" + validValueSetGUID + '\'' + - ", dataType='" + getDataType() + '\'' + - ", defaultValue='" + getDefaultValue() + '\'' + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - EnumSchemaTypeProperties that = (EnumSchemaTypeProperties) objectToCompare; - return Objects.equals(validValueSetGUID, that.validValueSetGUID); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), validValueSetGUID); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ExternalSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ExternalSchemaTypeProperties.java deleted file mode 100644 index 4a8301f1b26..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ExternalSchemaTypeProperties.java +++ /dev/null @@ -1,166 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * ExternalSchemaTypeProperties carries the unique identifier and properties of a reusable schema type. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) - -public class ExternalSchemaTypeProperties extends SimpleSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private String externalSchemaTypeGUID = null; - private SchemaTypeProperties externalSchemaType = null; - - /** - * Default constructor - */ - public ExternalSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor - * - * @param template template object to copy. - */ - public ExternalSchemaTypeProperties(ExternalSchemaTypeProperties template) - { - super(template); - - if (template != null) - { - externalSchemaTypeGUID = template.getExternalSchemaTypeGUID(); - externalSchemaType = template.getExternalSchemaType(); - } - } - - - /** - * Return the unique identifier of the external schema type. - * - * @return string guid - */ - public String getExternalSchemaTypeGUID() - { - return externalSchemaTypeGUID; - } - - - /** - * Set up the unique identifier of the external schema type. - * - * @param externalSchemaTypeGUID string guid - */ - public void setExternalSchemaTypeGUID(String externalSchemaTypeGUID) - { - this.externalSchemaTypeGUID = externalSchemaTypeGUID; - } - - - /** - * Return the schema type that is reusable amongst assets. - * - * @return bean describing external schema - */ - public SchemaTypeProperties getExternalSchemaType() - { - return externalSchemaType; - } - - - /** - * Set up the schema type that is reusable amongst assets. - * - * @param externalSchemaType bean describing external schema - */ - public void setExternalSchemaType(SchemaTypeProperties externalSchemaType) - { - this.externalSchemaType = externalSchemaType; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "ExternalSchemaTypeProperties{" + - "externalSchemaTypeGUID=" + externalSchemaTypeGUID + - ", externalSchemaType=" + externalSchemaType + - ", dataType='" + getDataType() + '\'' + - ", defaultValue='" + getDefaultValue() + '\'' + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - ExternalSchemaTypeProperties that = (ExternalSchemaTypeProperties) objectToCompare; - return Objects.equals(externalSchemaTypeGUID, that.externalSchemaTypeGUID) && - Objects.equals(externalSchemaType, that.externalSchemaType); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), externalSchemaTypeGUID, externalSchemaType); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FileProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FileProperties.java deleted file mode 100644 index 3e8d86d9bc9..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FileProperties.java +++ /dev/null @@ -1,149 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * FileProperties describes the property of a single data file. - */ -@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 = DataStoreProperties.class, name = "DataStoreProperties"), -}) -public class FileProperties extends DataStoreProperties -{ - private static final long serialVersionUID = 1L; - - private String fileType = null; - - - /** - * Default constructor - */ - public FileProperties() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public FileProperties(FileProperties template) - { - super(template); - - if (template != null) - { - fileType = template.getFileType(); - } - } - - - /** - * Return the file type of the file if known. - * - * @return file type string - */ - public String getFileType() - { - return fileType; - } - - - /** - * Set up the file type of the file if known. - * - * @param fileType string - */ - public void setFileType(String fileType) - { - this.fileType = fileType; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @SuppressWarnings(value = "deprecation") - @Override - public String toString() - { - return "FileProperties{" + - "fileType='" + fileType + '\'' + - ", createTime=" + getCreateTime() + - ", modifiedTime=" + getModifiedTime() + - ", encodingType='" + getEncodingType() + '\'' + - ", encodingLanguage='" + getEncodingLanguage() + '\'' + - ", encodingDescription='" + getEncodingDescription() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", owner='" + getOwner() + '\'' + - ", zoneMembership=" + getZoneMembership() + - ", origin=" + getOtherOriginValues() + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", typeName='" + getTypeName() + '\'' + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } - - - /** - * 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; - } - FileProperties that = (FileProperties) objectToCompare; - return Objects.equals(fileType, that.fileType); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), fileType); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FileSystemProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FileSystemProperties.java deleted file mode 100644 index 0536b93d1d6..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FileSystemProperties.java +++ /dev/null @@ -1,162 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - - -/** - * FileSystemProperties describes the root node of a file system. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) - -public class FileSystemProperties extends SoftwareServerCapabilityProperties -{ - private static final long serialVersionUID = 1L; - - private String format = null; - private String encryption = null; - - - /** - * Default constructor - */ - public FileSystemProperties() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public FileSystemProperties(FileSystemProperties template) - { - super(template); - - if (template != null) - { - format = template.getFormat(); - encryption = template.getEncryption(); - } - } - - - /** - * Return the format of the file system. - * - * @return string name - */ - public String getFormat() - { - return format; - } - - - /** - * Set up the format of the file system. - * - * @param format string name - */ - public void setFormat(String format) - { - this.format = format; - } - - - /** - * Return the type of encryption used on the file system (or null is unencrypted). - * - * @return encryption type - */ - public String getEncryption() - { - return encryption; - } - - - /** - * Set up the type of encryption used on the file system (or null is unencrypted). - * - * @param encryption encryption type - */ - public void setEncryption(String encryption) - { - this.encryption = encryption; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "FileSystemProperties{" + - "format='" + format + '\'' + - ", encryption='" + encryption + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", typeDescription='" + getTypeDescription() + '\'' + - ", version='" + getVersion() + '\'' + - ", patchLevel='" + getPatchLevel() + '\'' + - ", source='" + getSource() + '\'' + - '}'; - } - - - /** - * 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; - } - FileSystemProperties that = (FileSystemProperties) objectToCompare; - return Objects.equals(format, that.format) && Objects.equals(encryption, that.encryption); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), getFormat(), getEncryption()); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FolderProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FolderProperties.java deleted file mode 100644 index e6e9b7363d1..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/FolderProperties.java +++ /dev/null @@ -1,63 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * FolderProperties defines an asset that is a folder. The qualified name is the fully qualified path name of the folder. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class FolderProperties extends DataStoreProperties -{ - private static final long serialVersionUID = 1L; - - /** - * Default constructor - */ - public FolderProperties() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public FolderProperties(FolderProperties template) - { - super(template); - } - - - /** - * Subtyping constructor. - * - * @param template object to copy - */ - public FolderProperties(DataStoreProperties template) - { - super(template); - } - - - /** - * Subtyping constructor. - * - * @param template object to copy - */ - public FolderProperties(AssetProperties template) - { - super(template); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/LiteralSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/LiteralSchemaTypeProperties.java deleted file mode 100644 index 7367573c8c2..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/LiteralSchemaTypeProperties.java +++ /dev/null @@ -1,157 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * LiteralSchemaTypeProperties carries the specialized parameters for creating or updating literal schema types. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) - -public class LiteralSchemaTypeProperties extends SchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private String dataType = null; - private String fixedValue = null; - - /** - * Default constructor - */ - public LiteralSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor - the parentAsset is passed separately to the template because it is also - * likely to be being cloned in the same operation and we want the definitions clone to point to the - * asset clone and not the original asset. - * - * @param template template object to copy. - */ - public LiteralSchemaTypeProperties(LiteralSchemaTypeProperties template) - { - super(template); - - if (template != null) - { - dataType = template.getDataType(); - fixedValue = template.getFixedValue(); - } - } - - - /** - * Return the data type for this element. Null means unknown data type. - * - * @return String data type name - */ - public String getDataType() { return dataType; } - - - /** - * Set up the data type for this element. Null means unknown data type. - * - * @param dataType data type name - */ - public void setDataType(String dataType) - { - this.dataType = dataType; - } - - - /** - * Return the fixed value for the element. Null means fixed value is null. - * - * @return String containing fixed value - */ - public String getFixedValue() { return fixedValue; } - - - /** - * Set up the fixed value for the element. Null means fixed value is null. - * - * @param fixedValue String containing fixed value - */ - public void setFixedValue(String fixedValue) - { - this.fixedValue = fixedValue; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "LiteralSchemaTypeProperties{" + - "dataType='" + dataType + '\'' + - ", fixedValue='" + fixedValue + '\'' + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - LiteralSchemaTypeProperties that = (LiteralSchemaTypeProperties) objectToCompare; - return Objects.equals(dataType, that.dataType) && - Objects.equals(fixedValue, that.fixedValue); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), dataType, fixedValue); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/MapSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/MapSchemaTypeProperties.java deleted file mode 100644 index b5e59eb63e3..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/MapSchemaTypeProperties.java +++ /dev/null @@ -1,170 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * MapSchemaTypeProperties describes a schema element of type map. It stores the type of schema element for the domain - * (eg property name) for the map and the schema element for the range (eg property value) for the map. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) - -public class MapSchemaTypeProperties extends SchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private SchemaTypeProperties mapFromElement = null; - private SchemaTypeProperties mapToElement = null; - - - /** - * Default constructor - */ - public MapSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public MapSchemaTypeProperties(MapSchemaTypeProperties template) - { - super(template); - - if (template != null) - { - mapFromElement = template.getMapFromElement(); - mapToElement = template.getMapToElement(); - } - } - - - /** - * Return the type of schema element that represents the key or property name for the map. - * This is also called the domain of the map. - * - * @return SchemaElement - */ - public SchemaTypeProperties getMapFromElement() - { - return mapFromElement; - } - - - /** - * Set up the type of schema element that represents the key or property name for the map. - * This is also called the domain of the map. - * - * @param mapFromElement SchemaElement - */ - public void setMapFromElement(SchemaTypeProperties mapFromElement) - { - this.mapFromElement = mapFromElement; - } - - - /** - * Return the type of schema element that represents the property value for the map. - * This is also called the range of the map. - * - * @return SchemaElement - */ - public SchemaTypeProperties getMapToElement() - { - return mapToElement; - } - - - /** - * Set up the type of schema element that represents the property value for the map. - * This is also called the range of the map. - * - * @param mapToElement SchemaType - */ - public void setMapToElement(SchemaTypeProperties mapToElement) - { - this.mapToElement = mapToElement; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "MapSchemaTypeProperties{" + - "mapFromElement=" + mapFromElement + - ", mapToElement=" + mapToElement + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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 MapSchemaTypeProperties)) - { - return false; - } - if (!super.equals(objectToCompare)) - { - return false; - } - MapSchemaTypeProperties that = (MapSchemaTypeProperties) objectToCompare; - return Objects.equals(getMapFromElement(), that.getMapFromElement()) && - Objects.equals(getMapToElement(), that.getMapToElement()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), mapFromElement, mapToElement); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/PrimitiveSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/PrimitiveSchemaTypeProperties.java deleted file mode 100644 index 7330298ef56..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/PrimitiveSchemaTypeProperties.java +++ /dev/null @@ -1,71 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * PrimitiveSchemaTypeProperties carries the specialized parameters for creating or updating primitive schema types. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) - -public class PrimitiveSchemaTypeProperties extends SimpleSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - /** - * Default constructor - */ - public PrimitiveSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor - * - * @param template template object to copy. - */ - public PrimitiveSchemaTypeProperties(PrimitiveSchemaTypeProperties template) - { - super(template); - } - - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "PrimitiveSchemaTypeProperties{" + - "dataType='" + getDataType() + '\'' + - ", defaultValue='" + getDefaultValue() + '\'' + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ReferenceableProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ReferenceableProperties.java index 4fb9651a1f1..0efaea00aef 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ReferenceableProperties.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ReferenceableProperties.java @@ -8,9 +8,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements.ReferenceableElement; import java.io.Serializable; +import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -29,69 +29,60 @@ property = "class") @JsonSubTypes( { - @JsonSubTypes.Type(value = ReferenceableElement.class, name = "ReferenceableElement"), - @JsonSubTypes.Type(value = AssetProperties.class, name = "AssetProperties"), + @JsonSubTypes.Type(value = SupplementaryProperties.class, name = "SupplementaryProperties"), @JsonSubTypes.Type(value = MeaningProperties.class, name = "MeaningProperties"), - @JsonSubTypes.Type(value = SoftwareServerCapabilityProperties.class, name = "SoftwareServerCapabilityProperties"), - @JsonSubTypes.Type(value = SchemaElementProperties.class, name = "SchemaElementProperties") }) -public abstract class ReferenceableProperties implements Serializable +public class ReferenceableProperties implements Serializable { private static final long serialVersionUID = 1L; - private String qualifiedName = null; - private Map additionalProperties = null; + private String qualifiedName = null; + private Map additionalProperties = null; - private String typeName = null; - private Map extendedProperties = null; + private Date effectiveFrom = null; + private Date effectiveTo = null; + private String typeName = null; + private Map extendedProperties = null; /** * Default constructor */ public ReferenceableProperties() { + super(); } /** - * Copy/clone constructor + * Copy/clone constructor. Retrieves the values from the supplied template * - * @param template object to copy + * @param template element to copy */ public ReferenceableProperties(ReferenceableProperties template) { if (template != null) { - this.qualifiedName = template.getQualifiedName(); - this.additionalProperties = template.getAdditionalProperties(); - this.typeName = template.getTypeName(); - this.extendedProperties = template.getExtendedProperties(); - } - } + qualifiedName = template.getQualifiedName(); + additionalProperties = template.getAdditionalProperties(); + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); - /** - * Return the open metadata type name of this object - this is used to create a subtype of - * the referenceable. Any properties associated with this subtype are passed as extended properties. - * - * @return string type name - */ - public String getTypeName() - { - return typeName; + typeName = template.getTypeName(); + extendedProperties = template.getExtendedProperties(); + } } /** - * Set up the open metadata type name of this object - this is used to create a subtype of - * the referenceable. Any properties associated with this subtype are passed as extended properties. + * Set up the fully qualified name. * - * @param typeName string type name + * @param qualifiedName String name */ - public void setTypeName(String typeName) + public void setQualifiedName(String qualifiedName) { - this.typeName = typeName; + this.qualifiedName = qualifiedName; } @@ -108,13 +99,13 @@ public String getQualifiedName() /** - * Set up the fully qualified name. + * Set up additional properties. * - * @param qualifiedName String name + * @param additionalProperties Additional properties object */ - public void setQualifiedName(String qualifiedName) + public void setAdditionalProperties(Map additionalProperties) { - this.qualifiedName = qualifiedName; + this.additionalProperties = additionalProperties; } @@ -141,21 +132,76 @@ else if (additionalProperties.isEmpty()) /** - * Set up additional properties. + * Return the date/time that this element is effective from (null means effective from the epoch). * - * @param additionalProperties Additional properties object + * @return date object */ - public void setAdditionalProperties(Map additionalProperties) + public Date getEffectiveFrom() { - this.additionalProperties = additionalProperties; + 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 are defined for a subtype of referenceable but are not explicitly - * supported by the bean. + * Return the name of the open metadata type for this metadata element. * - * @return map of properties + * @return string name + */ + public String getTypeName() + { + return typeName; + } + + + /** + * Set up the name of the open metadata type for this element. + * + * @param typeName string name + */ + public void setTypeName(String typeName) + { + this.typeName = typeName; + } + + + /** + * 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() { @@ -175,10 +221,10 @@ else if (extendedProperties.isEmpty()) /** - * Set up the properties that are defined for a subtype of referenceable but are not explicitly - * supported by the bean. + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. * - * @param extendedProperties map of properties + * @param extendedProperties property map */ public void setExtendedProperties(Map extendedProperties) { @@ -186,28 +232,29 @@ public void setExtendedProperties(Map extendedProperties) } - - /** - * JSON-style toString. + * Standard toString method. * - * @return list of properties and their values. + * @return print out of variables in a JSON-style */ @Override public String toString() { return "ReferenceableProperties{" + - "qualifiedName='" + qualifiedName + '\'' + - ", additionalProperties=" + additionalProperties + - ", typeName='" + typeName + '\'' + - ", extendedProperties=" + extendedProperties + - '}'; + "qualifiedName='" + qualifiedName + '\'' + + ", additionalProperties=" + additionalProperties + + ", effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", typeName='" + typeName + '\'' + + ", extendedProperties=" + extendedProperties + + '}'; } + /** - * Equals method that returns true if containing properties are the same. + * Compare the values of the supplied object with those stored in the current object. * - * @param objectToCompare object to compare + * @param objectToCompare supplied object * @return boolean result of comparison */ @Override @@ -223,19 +270,22 @@ public boolean equals(Object objectToCompare) } ReferenceableProperties that = (ReferenceableProperties) objectToCompare; return Objects.equals(qualifiedName, that.qualifiedName) && - Objects.equals(additionalProperties, that.additionalProperties) && - Objects.equals(typeName, that.typeName) && - Objects.equals(extendedProperties, that.extendedProperties); + Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo) && + Objects.equals(typeName, that.typeName) && + Objects.equals(extendedProperties, that.extendedProperties); } + /** - * Return hash code for this object + * Return hash code based on properties. * - * @return int hash code + * @return int */ @Override public int hashCode() { - return Objects.hash(qualifiedName, additionalProperties, extendedProperties, typeName); + return Objects.hash(qualifiedName, additionalProperties, effectiveFrom, effectiveTo, typeName, extendedProperties); } } diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/RelationshipProperties.java new file mode 100644 index 00000000000..bbcecfc4355 --- /dev/null +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/RelationshipProperties.java @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.stewardshipaction.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.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; + +/** + * RelationshipProperties provides the base class for relationships 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) +public class RelationshipProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map extendedProperties = null; + + + /** + * Default constructor + */ + public RelationshipProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public RelationshipProperties(RelationshipProperties 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; + } + RelationshipProperties that = (RelationshipProperties) 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/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaAttributeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaAttributeProperties.java deleted file mode 100644 index ec371745430..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaAttributeProperties.java +++ /dev/null @@ -1,525 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements.SchemaAttributeElement; - -import java.util.ArrayList; -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; - -/** - * SchemaAttributeProperties carries the common parameters for creating or updating schema attributes. - */ -@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 = SchemaAttributeElement.class, name = "SchemaAttributeElement"), - @JsonSubTypes.Type(value = TabularColumnProperties.class, name = "TabularColumnProperties") - }) -public class SchemaAttributeProperties extends SchemaElementProperties -{ - private static final long serialVersionUID = 1L; - - private int elementPosition = 0; - - /* - * Details related to the instances of the attribute - */ - private int minCardinality = 0; - private int maxCardinality = -1; - private boolean allowsDuplicateValues = false; - private boolean orderedValues = false; - private String defaultValueOverride = null; - private DataItemSortOrder sortOrder = null; - private int minimumLength = 0; - private int length = 0; - private int precision = 0; - private boolean isNullable = true; - - /* - * Two choices on how the type is expressed - */ - private SchemaTypeProperties attributeType = null; - - /* - * Attribute relationships are things like foreign keys - */ - private List attributeRelationships = null; - - /* - * Implementation details - */ - private String nativeJavaClass = null; - private List aliases = null; - - - /** - * Default constructor - */ - public SchemaAttributeProperties() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template template schema attribute to copy. - */ - public SchemaAttributeProperties(SchemaAttributeProperties template) - { - super(template); - - if (template != null) - { - elementPosition = template.getElementPosition(); - minCardinality = template.getMinCardinality(); - maxCardinality = template.getMaxCardinality(); - allowsDuplicateValues = template.getAllowsDuplicateValues(); - orderedValues = template.getOrderedValues(); - sortOrder = template.getSortOrder(); - minimumLength = template.getMinimumLength(); - length = template.getLength(); - precision = template.getPrecision(); - isNullable = template.getIsNullable(); - defaultValueOverride = template.getDefaultValueOverride(); - attributeType = template.getAttributeType(); - attributeRelationships = template.getAttributeRelationships(); - nativeJavaClass = template.getNativeJavaClass(); - aliases = template.getAliases(); - } - } - - - /** - * Return the position of this schema attribute in its parent schema. - * - * @return int position in schema - 0 means first - */ - public int getElementPosition() { return elementPosition; } - - - /** - * Set up the position of this schema attribute in its parent schema. - * - * @param elementPosition int position in schema - 0 means first - */ - public void setElementPosition(int elementPosition) - { - this.elementPosition = elementPosition; - } - - - /** - * Return this minimum number of instances allowed for this attribute. - * - * @return int - */ - public int getMinCardinality() - { - return minCardinality; - } - - - /** - * Set up the minimum number of instances allowed for this attribute. - * - * @param minCardinality int - */ - public void setMinCardinality(int minCardinality) - { - this.minCardinality = minCardinality; - } - - - /** - * Return the maximum number of instances allowed for this attribute. - * - * @return int (-1 means infinite) - */ - public int getMaxCardinality() - { - return maxCardinality; - } - - - /** - * Set up the maximum number of instances allowed for this attribute. - * - * @param maxCardinality int (-1 means infinite) - */ - public void setMaxCardinality(int maxCardinality) - { - this.maxCardinality = maxCardinality; - } - - - /** - * Return whether the same value can be used by more than one instance of this attribute. - * - * @return boolean flag - */ - public boolean getAllowsDuplicateValues() - { - return allowsDuplicateValues; - } - - - /** - * Set up whether the same value can be used by more than one instance of this attribute. - * - * @param allowsDuplicateValues boolean flag - */ - public void setAllowsDuplicateValues(boolean allowsDuplicateValues) - { - this.allowsDuplicateValues = allowsDuplicateValues; - } - - - /** - * Return whether the attribute instances are arranged in an order. - * - * @return boolean flag - */ - public boolean getOrderedValues() - { - return orderedValues; - } - - - /** - * Set up whether the attribute instances are arranged in an order. - * - * @param orderedValues boolean flag - */ - public void setOrderedValues(boolean orderedValues) - { - this.orderedValues = orderedValues; - } - - - /** - * Return the order that the attribute instances are arranged in - if any. - * - * @return DataItemSortOrder enum - */ - public DataItemSortOrder getSortOrder() - { - return sortOrder; - } - - - /** - * Set up the order that the attribute instances are arranged in - if any. - * - * @param sortOrder DataItemSortOrder enum - */ - public void setSortOrder(DataItemSortOrder sortOrder) - { - this.sortOrder = sortOrder; - } - - - /** - * Return the minimum length of the data. - * - * @return int - */ - public int getMinimumLength() - { - return minimumLength; - } - - - /** - * Set up the minimum length of the data. - * - * @param minimumLength int - */ - public void setMinimumLength(int minimumLength) - { - this.minimumLength = minimumLength; - } - - - /** - * Return the length of the data field. - * - * @return int - */ - public int getLength() - { - return length; - } - - - /** - * Set up the length of the data field. - * - * @param length int - */ - public void setLength(int length) - { - this.length = length; - } - - - /** - * Return the number of significant digits to the right of decimal point. - * - * @return int - */ - public int getPrecision() - { - return precision; - } - - - /** - * Set up the number of significant digits to the right of decimal point. - * - * @param precision int - */ - public void setPrecision(int precision) - { - this.precision = precision; - } - - - /** - * Return whether the field is nullable or not. - * - * @return boolean - */ - public boolean getIsNullable() - { - return isNullable; - } - - - /** - * Set up whether the field is nullable or not. - * - * @param nullable boolean - */ - public void setIsNullable(boolean nullable) - { - isNullable = nullable; - } - - - /** - * Return any default value for this attribute that would override the default defined in the - * schema element for this attribute's type (note only used is type is primitive). - * - * @return String default value override - */ - public String getDefaultValueOverride() { return defaultValueOverride; } - - - /** - * Set up any default value for this attribute that would override the default defined in the - * schema element for this attribute's type (note only used is type is primitive). - * - * @param defaultValueOverride String default value override - */ - public void setDefaultValueOverride(String defaultValueOverride) - { - this.defaultValueOverride = defaultValueOverride; - } - - - /** - * Return the SchemaType that relates to the type of this attribute. - * - * @return SchemaType - */ - public SchemaTypeProperties getAttributeType() - { - return attributeType; - } - - - /** - * Set up the SchemaType that relates to the type of this attribute. - * - * @param attributeType SchemaType - */ - public void setAttributeType(SchemaTypeProperties attributeType) - { - this.attributeType = attributeType; - } - - - /** - * Return any relationships to other schema attributes. - * - * @return list of attribute relationships - */ - public List getAttributeRelationships() - { - if (attributeRelationships == null) - { - return null; - } - else if (attributeRelationships.isEmpty()) - { - return null; - } - else - { - return new ArrayList<>(attributeRelationships); - } - } - - - /** - * Set up any relationships to other schema attributes. - * - * @param attributeRelationships list of attribute relationships - */ - public void setAttributeRelationships(List attributeRelationships) - { - this.attributeRelationships = attributeRelationships; - } - - - /** - * Return the name of the Java class to use to represent this type. - * - * @return fully qualified Java class name - */ - public String getNativeJavaClass() - { - return nativeJavaClass; - } - - - /** - * Set up the name of the Java class to use to represent this type. - * - * @param nativeJavaClass fully qualified Java class name - */ - public void setNativeJavaClass(String nativeJavaClass) - { - this.nativeJavaClass = nativeJavaClass; - } - - - /** - * Return a list of alternative names for the attribute. - * - * @return list of names - */ - public List getAliases() - { - return aliases; - } - - - /** - * Set up a list of alternative names for the attribute. - * - * @param aliases list of names - */ - public void setAliases(List aliases) - { - this.aliases = aliases; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SchemaAttributeProperties{" + - ", elementPosition=" + elementPosition + - ", minCardinality=" + minCardinality + - ", maxCardinality=" + maxCardinality + - ", allowsDuplicateValues=" + allowsDuplicateValues + - ", orderedValues=" + orderedValues + - ", defaultValueOverride='" + defaultValueOverride + '\'' + - ", sortOrder=" + sortOrder + - ", attributeType=" + attributeType + - ", attributeRelationships=" + attributeRelationships + - ", nativeJavaClass='" + nativeJavaClass + '\'' + - ", aliases=" + aliases + - ", deprecated=" + getIsDeprecated() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", 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; - } - SchemaAttributeProperties that = (SchemaAttributeProperties) objectToCompare; - return elementPosition == that.elementPosition && - minCardinality == that.minCardinality && - maxCardinality == that.maxCardinality && - allowsDuplicateValues == that.allowsDuplicateValues && - orderedValues == that.orderedValues && - Objects.equals(defaultValueOverride, that.defaultValueOverride) && - sortOrder == that.sortOrder && - Objects.equals(attributeType, that.attributeType) && - Objects.equals(getAttributeRelationships(), that.getAttributeRelationships()) && - Objects.equals(nativeJavaClass, that.nativeJavaClass) && - Objects.equals(aliases, that.aliases); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), elementPosition, minCardinality, maxCardinality, allowsDuplicateValues, orderedValues, - defaultValueOverride, sortOrder, minimumLength, length, precision, isNullable, attributeType, - attributeRelationships, nativeJavaClass, aliases); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaAttributeRelationshipProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaAttributeRelationshipProperties.java deleted file mode 100644 index 1a5de2f7674..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaAttributeRelationshipProperties.java +++ /dev/null @@ -1,243 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.io.Serializable; -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; - -/** - * SchemaAttributeRelationshipProperties defines a relationship between 2 SchemaAttributes. - * It is used in network type schemas such as a graph - * or to show relationships such as foreign key relationships in relational schemas. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class SchemaAttributeRelationshipProperties implements Serializable -{ - private static final long serialVersionUID = 1L; - - private String linkGUID = null; - private String linkType = null; - private String linkedAttributeName = null; - private Map linkProperties = null; - private String linkedAttributeGUID = null; - - - /** - * Default constructor - */ - public SchemaAttributeRelationshipProperties() - { - super(); - } - - - /** - * Copy/clone constructor makes a copy of the supplied object. - * - * @param template template object to copy - */ - public SchemaAttributeRelationshipProperties(SchemaAttributeRelationshipProperties template) - { - if (template != null) - { - linkGUID = template.getLinkGUID(); - linkedAttributeName = template.getLinkedAttributeName(); - linkType = template.getLinkType(); - linkProperties = template.getLinkProperties(); - linkedAttributeGUID = template.getLinkedAttributeGUID(); - } - } - - - /** - * Return the identifier for the schema link. - * - * @return String guid - */ - public String getLinkGUID() - { - return linkGUID; - } - - - /** - * Set up the identifier for the schema link. - * - * @param linkGUID String guid - */ - public void setLinkGUID(String linkGUID) - { - this.linkGUID = linkGUID; - } - - - /** - * Return the type of the link - this is related to the type of the schema it is a part of. - * - * @return String link type - */ - public String getLinkType() - { - return linkType; - } - - - /** - * Set up the type of the link - this is related to the type of the schema it is a part of. - * - * @param linkType String link type - */ - public void setLinkType(String linkType) - { - this.linkType = linkType; - } - - - /** - * Return the name of this link - * - * @return String name - */ - public String getLinkedAttributeName() - { - return linkedAttributeName; - } - - - /** - * Set up the name of this link. - * - * @param linkedAttributeName String name - */ - public void setLinkedAttributeName(String linkedAttributeName) - { - this.linkedAttributeName = linkedAttributeName; - } - - - /** - * Return the properties associated with this schema link. - * - * @return property map - */ - public Map getLinkProperties() - { - if (linkProperties == null) - { - return null; - } - else if (linkProperties.isEmpty()) - { - return null; - } - else - { - return new HashMap<>(linkProperties); - } - } - - - /** - * Set up the properties associated with this schema link. - * - * @param linkProperties property map - */ - public void setLinkProperties(Map linkProperties) - { - this.linkProperties = linkProperties; - } - - - /** - * Return the GUID of the schema attribute that this link connects together. - * - * @return GUID for the attribute at the other end of the link. - */ - public String getLinkedAttributeGUID() - { - return linkedAttributeGUID; - } - - - /** - * Set up the GUIDs of the schema attributes that this link connects together. - * - * @param linkedAttributeGUID GUIDs for either end of the link - returned as a list. - */ - public void setLinkedAttributeGUID(String linkedAttributeGUID) - { - this.linkedAttributeGUID = linkedAttributeGUID; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SchemaAttributeRelationshipProperties{" + - "linkGUID='" + linkGUID + '\'' + - ", linkType='" + linkType + '\'' + - ", linkedAttributeName='" + linkedAttributeName + '\'' + - ", linkProperties=" + linkProperties + - ", linkedAttributeGUID='" + linkedAttributeGUID + '\'' + - '}'; - } - - - /** - * 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 SchemaAttributeRelationshipProperties)) - { - return false; - } - SchemaAttributeRelationshipProperties that = (SchemaAttributeRelationshipProperties) objectToCompare; - return Objects.equals(getLinkGUID(), that.getLinkGUID()) && - Objects.equals(getLinkType(), that.getLinkType()) && - Objects.equals(getLinkedAttributeName(), that.getLinkedAttributeName()) && - Objects.equals(getLinkProperties(), that.getLinkProperties()) && - Objects.equals(getLinkedAttributeGUID(), that.getLinkedAttributeGUID()); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(getLinkGUID(), - getLinkType(), - getLinkedAttributeName(), - getLinkProperties(), - getLinkedAttributeGUID()); - } - -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaElementProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaElementProperties.java deleted file mode 100644 index 5b6c6a0e1b4..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaElementProperties.java +++ /dev/null @@ -1,185 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * SchemaElementProperties carries the common parameters for creating or updating schema elements such as schema types and attributes. - */ -@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 = SchemaTypeProperties.class, name = "SchemaTypeProperties"), - @JsonSubTypes.Type(value = SchemaAttributeProperties.class, name = "SchemaAttributeProperties") - }) -public abstract class SchemaElementProperties extends ReferenceableProperties -{ - private static final long serialVersionUID = 1L; - - private String displayName = null; - private String description = null; - private boolean isDeprecated = false; - - - /** - * Default constructor - */ - public SchemaElementProperties() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public SchemaElementProperties(SchemaElementProperties template) - { - super(template); - - if (template != null) - { - displayName = template.getDisplayName(); - description = template.getDescription(); - isDeprecated = template.getIsDeprecated(); - } - } - - - /** - * Return the display name of the file - * - * @return string name - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Set up the display name of the file. - * - * @param displayName string name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Return the description of the file. - * - * @return string description - */ - public String getDescription() - { - return description; - } - - - /** - * Set up the description of the file. - * - * @param description string description - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * Is the schema element deprecated? - * - * @return boolean flag - */ - public boolean getIsDeprecated() - { - return isDeprecated; - } - - - /** - * Set whether the schema element deprecated or not. Default is false. - * - * @param deprecated boolean flag - */ - public void setIsDeprecated(boolean deprecated) - { - isDeprecated = deprecated; - } - - - /** - * JSON-style toString - * - * @return return string containing the property names and values - */ - @Override - public String toString() - { - return "SchemaElementProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", isDeprecated=" + isDeprecated + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } - - - /** - * 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; - } - SchemaElementProperties that = (SchemaElementProperties) objectToCompare; - return Objects.equals(getDisplayName(), that.getDisplayName()) && - Objects.equals(getDescription(), that.getDescription()); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(getDisplayName(), getDescription()); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaTypeChoiceProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaTypeChoiceProperties.java deleted file mode 100644 index 09af3105c24..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaTypeChoiceProperties.java +++ /dev/null @@ -1,146 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -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; - -/** - * SchemaTypeChoiceProperties carries the specialized parameters for creating or updating a choice of schema types. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class SchemaTypeChoiceProperties extends SchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private List schemaOptions = null; - - - /** - * Default constructor - */ - public SchemaTypeChoiceProperties() - { - super(); - } - - - /** - * Copy/clone Constructor - the parentAsset is passed separately to the template because it is also - * likely to be being cloned in the same operation and we want the definitions clone to point to the - * asset clone and not the original asset. - * - * @param template template object to copy. - */ - public SchemaTypeChoiceProperties(SchemaTypeChoiceProperties template) - { - super(template); - - if (template != null) - { - schemaOptions = template.getSchemaOptions(); - } - } - - - /** - * Return the list of alternative schema types that this attribute or asset may use. - * - * @return list of schema types - */ - public List getSchemaOptions() - { - if (schemaOptions == null) - { - return null; - } - else if (schemaOptions.isEmpty()) - { - return null; - } - - return schemaOptions; - } - - - /** - * Set up the list of alternative schema types that this attribute or asset may use. - * - * @param schemaOptions list of schema types - */ - public void setSchemaOptions(List schemaOptions) - { - this.schemaOptions = schemaOptions; - } - - - /** - * 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; - } - SchemaTypeChoiceProperties that = (SchemaTypeChoiceProperties) objectToCompare; - return Objects.equals(getSchemaOptions(), that.getSchemaOptions()); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SchemaTypeChoiceProperties{" + - "versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), schemaOptions); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaTypeProperties.java deleted file mode 100644 index cef0dd969b6..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SchemaTypeProperties.java +++ /dev/null @@ -1,306 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.ArrayList; -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; - -/** - * SchemaTypeProperties carries the common parameters for creating or updating schema types. - */ -@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 = ComplexSchemaTypeProperties.class, name = "ComplexSchemaTypeProperties"), - @JsonSubTypes.Type(value = LiteralSchemaTypeProperties.class, name = "LiteralSchemaTypeProperties"), - @JsonSubTypes.Type(value = SimpleSchemaTypeProperties.class, name = "SimpleSchemaTypeProperties"), - @JsonSubTypes.Type(value = SchemaTypeChoiceProperties.class, name = "SchemaTypeChoiceProperties"), - @JsonSubTypes.Type(value = MapSchemaTypeProperties.class, name = "MapSchemaTypeProperties"), - }) -public class SchemaTypeProperties extends SchemaElementProperties -{ - private static final long serialVersionUID = 1L; - - private String versionNumber = null; - private String author = null; - private String usage = null; - private String encodingStandard = null; - private String namespace = null; - - /* - * Values for when the schemaType is derived from other values rather than stored - */ - private String formula = null; - private List queries = null; - - /** - * Default constructor - */ - public SchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public SchemaTypeProperties(SchemaTypeProperties template) - { - super(template); - - if (template != null) - { - versionNumber = template.getVersionNumber(); - author = template.getAuthor(); - usage = template.getUsage(); - encodingStandard = template.getEncodingStandard(); - namespace = template.getNamespace(); - formula = template.getFormula(); - queries = template.getQueries(); - } - } - - - /** - * Return the version number of the schema element - null means no version number. - * - * @return String version number - */ - public String getVersionNumber() { return versionNumber; } - - - /** - * Set up the version number of the schema element - null means no version number. - * - * @param versionNumber String version number - */ - public void setVersionNumber(String versionNumber) - { - this.versionNumber = versionNumber; - } - - - /** - * Return the name of the author of the schema element. Null means the author is unknown. - * - * @return String author name - */ - public String getAuthor() { return author; } - - - /** - * Set up the name of the author of the schema element. Null means the author is unknown. - * - * @param author String author name - */ - public void setAuthor(String author) - { - this.author = author; - } - - - /** - * Return the usage guidance for this schema element. Null means no guidance available. - * - * @return String usage guidance - */ - public String getUsage() { return usage; } - - - /** - * Set up the usage guidance for this schema element. Null means no guidance available. - * - * @param usage String usage guidance - */ - public void setUsage(String usage) - { - this.usage = usage; - } - - - /** - * Return the format (encoding standard) used for this schema. It may be XML, JSON, SQL DDL or something else. - * Null means the encoding standard is unknown or there are many choices. - * - * @return String encoding standard - */ - public String getEncodingStandard() { return encodingStandard; } - - - /** - * Set up the format (encoding standard) used for this schema. It may be XML, JSON, SQL DDL or something else. - * Null means the encoding standard is unknown or there are many choices. - * - * @param encodingStandard String encoding standard - */ - public void setEncodingStandard(String encodingStandard) - { - this.encodingStandard = encodingStandard; - } - - - /** - * Return the name of the namespace that this type belongs to. - * - * @return string name - */ - public String getNamespace() - { - return namespace; - } - - - /** - * Set up the name of the namespace that this type belongs to. - * - * @param namespace string name - */ - public void setNamespace(String namespace) - { - this.namespace = namespace; - } - - - /** - * Return the formula used to combine the values of the queries. Each query is numbers 0, 1, ... and the - * formula has placeholders in it to show how the query results are combined. - * - * @return String formula - */ - public String getFormula() { return formula; } - - - /** - * Set up the formula used to combine the values of the queries. Each query is numbers 0, 1, ... and the - * formula has placeholders in it to show how the query results are combined. - * - * @param formula String formula - */ - public void setFormula(String formula) - { - this.formula = formula; - } - - - /** - * Return the list of queries that are used to create the derived schema element. - * - * @return list of queries - */ - public List getQueries() - { - if (queries == null) - { - return null; - } - else if (queries.isEmpty()) - { - return null; - } - else - { - return new ArrayList<>(queries); - } - } - - - /** - * Set up the list of queries that are used to create the derived schema element. - * - * @param queries list of queries - */ - public void setQueries(List queries) - { - this.queries = queries; - } - - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SchemaTypeProperties{" + - "versionNumber='" + versionNumber + '\'' + - ", author='" + author + '\'' + - ", usage='" + usage + '\'' + - ", encodingStandard='" + encodingStandard + '\'' + - ", namespace='" + namespace + '\'' + - ", formula='" + formula + '\'' + - ", queries=" + queries + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - SchemaTypeProperties that = (SchemaTypeProperties) objectToCompare; - return Objects.equals(versionNumber, that.versionNumber) && - Objects.equals(author, that.author) && - Objects.equals(usage, that.usage) && - Objects.equals(encodingStandard, that.encodingStandard) && - Objects.equals(namespace, that.namespace) && - Objects.equals(formula, that.formula) && - Objects.equals(queries, that.queries); - } - - - /** - * Return hash code based on properties. - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), versionNumber, author, usage, encodingStandard, namespace, formula, queries); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SecurityTagsProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SecurityTagsProperties.java deleted file mode 100644 index dc3559ea783..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SecurityTagsProperties.java +++ /dev/null @@ -1,177 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -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; - -/** - * SecurityTagsProperties holds the list of labels and properties used by a security enforcement engine to control access - * and visibility to the contents of the real-world object described by the Referenceable. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class SecurityTagsProperties implements Serializable -{ - private List securityLabels = null; - private Map securityProperties = null; - - - /** - * Default constructor - */ - public SecurityTagsProperties() - { - super(); - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public SecurityTagsProperties(SecurityTagsProperties template) - { - super(); - - if (template != null) - { - this.securityLabels = template.getSecurityLabels(); - this.securityProperties = template.getSecurityProperties(); - } - } - - - /** - * Return the list of security labels attached to the element. - * - * @return list of label strings - */ - public List getSecurityLabels() - { - if (securityLabels == null) - { - return null; - } - else if (securityLabels.isEmpty()) - { - return null; - } - else - { - return new ArrayList<>(securityLabels); - } - } - - - /** - * Set up the list of security labels for the element. - * - * @param securityLabels list of label strings - */ - public void setSecurityLabels(List securityLabels) - { - this.securityLabels = securityLabels; - } - - - /** - * Return the security properties associated with the element. These are name-value pairs. - * - * @return map of properties - */ - public Map getSecurityProperties() - { - if (securityProperties == null) - { - return null; - } - else if (securityProperties.isEmpty()) - { - return null; - } - else - { - return new HashMap<>(securityProperties); - } - } - - - /** - * Set up the security properties associated with the element. These are name-value pairs. - * - * @param securityProperties map of properties - */ - public void setSecurityProperties(Map securityProperties) - { - this.securityProperties = securityProperties; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SecurityTagsProperties{" + - "securityLabels=" + securityLabels + - ", securityProperties=" + securityProperties + - '}'; - } - - - /** - * 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; - } - SecurityTagsProperties that = (SecurityTagsProperties) objectToCompare; - return Objects.equals(securityLabels, that.securityLabels) && - Objects.equals(securityProperties, that.securityProperties); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), securityLabels, securityProperties); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SimpleSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SimpleSchemaTypeProperties.java deleted file mode 100644 index 9f257c0ce80..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SimpleSchemaTypeProperties.java +++ /dev/null @@ -1,167 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * SimpleSchemaTypeProperties carries the common parameters for creating or updating primitive and enum schema types. - */ -@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 = PrimitiveSchemaTypeProperties.class, name = "PrimitiveSchemaTypeProperties"), - @JsonSubTypes.Type(value = EnumSchemaTypeProperties.class, name = "EnumSchemaTypeProperties"), - @JsonSubTypes.Type(value = ExternalSchemaTypeProperties.class, name = "ExternalSchemaTypeProperties"), -}) -public class SimpleSchemaTypeProperties extends SchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - private String dataType = null; - private String defaultValue = null; - - /** - * Default constructor - */ - public SimpleSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor - the parentAsset is passed separately to the template because it is also - * likely to be being cloned in the same operation and we want the definitions clone to point to the - * asset clone and not the original asset. - * - * @param template template object to copy. - */ - public SimpleSchemaTypeProperties(SimpleSchemaTypeProperties template) - { - super(template); - - if (template != null) - { - dataType = template.getDataType(); - defaultValue = template.getDefaultValue(); - } - } - - - /** - * Return the data type for this element. Null means unknown data type. - * - * @return String data type name - */ - public String getDataType() { return dataType; } - - - /** - * Set up the data type for this element. Null means unknown data type. - * - * @param dataType data type name - */ - public void setDataType(String dataType) - { - this.dataType = dataType; - } - - - /** - * Return the default value for the element. Null means no default value set up. - * - * @return String containing default value - */ - public String getDefaultValue() { return defaultValue; } - - - /** - * Set up the default value for the element. Null means no default value set up. - * - * @param defaultValue String containing default value - */ - public void setDefaultValue(String defaultValue) - { - this.defaultValue = defaultValue; - } - - - /** - * 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; - } - SimpleSchemaTypeProperties that = (SimpleSchemaTypeProperties) objectToCompare; - return Objects.equals(dataType, that.dataType) && - Objects.equals(defaultValue, that.defaultValue); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SimpleSchemaTypeProperties{" + - "dataType='" + dataType + '\'' + - ", defaultValue='" + defaultValue + '\'' + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), dataType, defaultValue); - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SoftwareServerCapabilityProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SoftwareServerCapabilityProperties.java deleted file mode 100644 index ca344db16b2..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SoftwareServerCapabilityProperties.java +++ /dev/null @@ -1,268 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.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.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * SoftwareServerCapabilityProperties describe the properties needed to describe a specific software server's capability. - */ -@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 = FileSystemProperties.class, name = "FileSystemProperties") -}) -public class SoftwareServerCapabilityProperties extends ReferenceableProperties -{ - private static final long serialVersionUID = 1L; - - private String displayName = null; - private String description = null; - private String typeDescription = null; - private String version = null; - private String patchLevel = null; - private String source = null; - - - /** - * Default constructor. - */ - public SoftwareServerCapabilityProperties() - { - super(); - } - - - /** - * Copy/clone constructor. - * - * @param template object to copy - */ - public SoftwareServerCapabilityProperties(SoftwareServerCapabilityProperties template) - { - super(template); - - if (template != null) - { - displayName = template.getDisplayName(); - description = template.getDescription(); - typeDescription = template.getTypeDescription(); - version = template.getVersion(); - patchLevel = template.getPatchLevel(); - source = template.getSource(); - } - } - - - /** - * Return the display name for messages and UI. - * - * @return string name - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Set up the display name for messages and UI. - * - * @param displayName string name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Return the description of the discovery engine. - * - * @return string description - */ - public String getDescription() - { - return description; - } - - - /** - * Set up the description of the discovery engine. - * - * @param description string - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * Return the description of the type of discovery engine this is. - * - * @return string description - */ - public String getTypeDescription() - { - return typeDescription; - } - - - /** - * Set up the description of the type of discovery engine this is. - * - * @param typeDescription string - */ - public void setTypeDescription(String typeDescription) - { - this.typeDescription = typeDescription; - } - - - /** - * Return the version of the discovery engine. - * - * @return version string - */ - public String getVersion() - { - return version; - } - - - /** - * Set up the version string of the discovery engine. - * - * @param version string - */ - public void setVersion(String version) - { - this.version = version; - } - - - /** - * Return the patch level of the discovery engine. - * - * @return patch level string - */ - public String getPatchLevel() - { - return patchLevel; - } - - - /** - * Set up the patch level of the discovery engine. - * - * @param patchLevel string - */ - public void setPatchLevel(String patchLevel) - { - this.patchLevel = patchLevel; - } - - - /** - * Return the source of the discovery engine implementation. - * - * @return string url - */ - public String getSource() - { - return source; - } - - - /** - * Set up the source of the discovery engine implementation. - * - * @param source string url - */ - public void setSource(String source) - { - this.source = source; - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "SoftwareServerCapabilityProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", typeDescription='" + typeDescription + '\'' + - ", version='" + version + '\'' + - ", patchLevel='" + patchLevel + '\'' + - ", source='" + source + '\'' + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - SoftwareServerCapabilityProperties that = (SoftwareServerCapabilityProperties) objectToCompare; - return Objects.equals(getDisplayName(), that.getDisplayName()) && - Objects.equals(getDescription(), that.getDescription()) && - Objects.equals(getTypeDescription(), that.getTypeDescription()) && - Objects.equals(getVersion(), that.getVersion()) && - Objects.equals(getPatchLevel(), that.getPatchLevel()) && - Objects.equals(getSource(), that.getSource()); - } - - - /** - * Create a hash code for this element type. - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), getDisplayName(), getDescription(), getTypeDescription(), getVersion(), - getPatchLevel(), getSource()); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/StructDocumentTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/StructDocumentTypeProperties.java deleted file mode 100644 index b902f068e05..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/StructDocumentTypeProperties.java +++ /dev/null @@ -1,70 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * StructDocumentTypeProperties is a specific type of bean for a do a nested structure in a hierarchical document structure such - * as an XML document. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class StructDocumentTypeProperties extends StructSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - - /** - * Default constructor used by subclasses - */ - public StructDocumentTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public StructDocumentTypeProperties(StructDocumentTypeProperties template) - { - super(template); - } - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "StructDocumentTypeProperties{" + - "attributeCount=" + getAttributeCount() + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/StructSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/StructSchemaTypeProperties.java deleted file mode 100644 index 520c994fcc0..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/StructSchemaTypeProperties.java +++ /dev/null @@ -1,79 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.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 static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * StructSchemaTypeProperties is a specific type of bean for a structure. - */ -@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 = StructDocumentTypeProperties.class, name = "StructDocumentTypeProperties") - }) -public class StructSchemaTypeProperties extends ComplexSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - - /** - * Default constructor used by subclasses - */ - public StructSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public StructSchemaTypeProperties(StructSchemaTypeProperties template) - { - super(template); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "StructSchemaTypeProperties{" + - "attributeCount=" + getAttributeCount() + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SupplementaryProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SupplementaryProperties.java index 9c48fe79d7e..249b92a4c16 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SupplementaryProperties.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/SupplementaryProperties.java @@ -26,7 +26,7 @@ property = "class") @JsonSubTypes( { - @JsonSubTypes.Type(value = EndpointProperties.class, name = "EndpointProperties"), + @JsonSubTypes.Type(value = AssetProperties.class, name = "AssetProperties"), }) public class SupplementaryProperties extends ReferenceableProperties { diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/TabularColumnProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/TabularColumnProperties.java deleted file mode 100644 index 1269588c5f1..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/TabularColumnProperties.java +++ /dev/null @@ -1,75 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * A TabularColumnProperties defines a column in a simple table. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class TabularColumnProperties extends SchemaAttributeProperties -{ - private static final long serialVersionUID = 1L; - - - /** - * Default constructor - */ - public TabularColumnProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public TabularColumnProperties(TabularColumnProperties template) - { - super(template); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "TabularColumnProperties{" + - ", elementPosition=" + getElementPosition() + - ", minCardinality=" + getMinCardinality() + - ", maxCardinality=" + getMaxCardinality() + - ", allowsDuplicateValues=" + getAllowsDuplicateValues() + - ", orderedValues=" + getOrderedValues() + - ", sortOrder=" + getSortOrder() + - ", minimumLength=" + getMinimumLength() + - ", length=" + getLength() + - ", significantDigits=" + getPrecision() + - ", nullable=" + getIsNullable() + - ", defaultValueOverride='" + getDefaultValueOverride() + '\'' + - ", attributeType=" + getAttributeType() + - ", attributeRelationships=" + getAttributeRelationships() + - ", nativeJavaClass='" + getNativeJavaClass() + '\'' + - ", aliases=" + getAliases() + - ", deprecated=" + getIsDeprecated() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/TabularSchemaTypeProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/TabularSchemaTypeProperties.java deleted file mode 100644 index 8294162d973..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/TabularSchemaTypeProperties.java +++ /dev/null @@ -1,70 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ - -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * TabularSchemaTypeProperties is a specific type of bean for a simple table. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class TabularSchemaTypeProperties extends ComplexSchemaTypeProperties -{ - private static final long serialVersionUID = 1L; - - - /** - * Default constructor used by subclasses - */ - public TabularSchemaTypeProperties() - { - super(); - } - - - /** - * Copy/clone Constructor. - * - * @param template template object to copy. - */ - public TabularSchemaTypeProperties(TabularSchemaTypeProperties template) - { - super(template); - } - - - /** - * Standard toString method. - * - * @return print out of variables in a JSON-style - */ - @Override - public String toString() - { - return "TabularSchemaTypeProperties{" + - "attributeCount=" + getAttributeCount() + - ", versionNumber='" + getVersionNumber() + '\'' + - ", author='" + getAuthor() + '\'' + - ", usage='" + getUsage() + '\'' + - ", encodingStandard='" + getEncodingStandard() + '\'' + - ", namespace='" + getNamespace() + '\'' + - ", formula='" + getFormula() + '\'' + - ", queries=" + getQueries() + - ", displayName='" + getDisplayName() + '\'' + - ", description='" + getDescription() + '\'' + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", extendedProperties=" + getExtendedProperties() + - '}'; - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ValidValueProperties.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ValidValueProperties.java deleted file mode 100644 index c47039c98a1..00000000000 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/properties/ValidValueProperties.java +++ /dev/null @@ -1,259 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.stewardshipaction.properties; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * ValidValueProperties provides the common super class for ValidValueSet and ValidValueDefinition. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ValidValueProperties extends ReferenceableProperties -{ - private static final long serialVersionUID = 1L; - - private String displayName = null; - private String description = null; - private String usage = null; - private String scope = null; - private String preferredValue = null; - private boolean isDeprecated = false; - - - /** - * Constructor - */ - public ValidValueProperties() - { - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public ValidValueProperties(ValidValueProperties template) - { - super(template); - - if (template != null) - { - displayName = template.getDisplayName(); - description = template.getDescription(); - usage = template.getUsage(); - scope = template.getScope(); - preferredValue = template.getPreferredValue(); - isDeprecated = template.getIsDeprecated(); - } - } - - - /** - * Returns the stored display name property for the valid value. - * If no display name is available then null is returned. - * - * @return String name - */ - public String getDisplayName() - { - return displayName; - } - - - /** - * Set up the stored display name property for the valid value. - * - * @param displayName String name - */ - public void setDisplayName(String displayName) - { - this.displayName = displayName; - } - - - /** - * Returns the stored description property for the valid value. - * If no description is provided then null is returned. - * - * @return description String text - */ - public String getDescription() - { - return description; - } - - - /** - * Set up the stored description property associated with the valid value. - * - * @param description String text - */ - public void setDescription(String description) - { - this.description = description; - } - - - /** - * Return the description of how this valid value should be used. - * - * @return String text - */ - public String getUsage() - { - return usage; - } - - - /** - * Set up the description of how this valid value should be used. - * - * @param usage String text - */ - public void setUsage(String usage) - { - this.usage = usage; - } - - - /** - * Return the scope of values that this valid value covers (normally used with sets) - * - * @return String text - */ - public String getScope() - { - return scope; - } - - - /** - * Set up the scope of values that this valid value covers (normally used with sets) - * - * @param scope String text - */ - public void setScope(String scope) - { - this.scope = scope; - } - - - /** - * Return the preferred values to use in implementations (normally used with definitions) - * - * @return String value - */ - public String getPreferredValue() - { - return preferredValue; - } - - - /** - * Set up the preferred values to use in implementations (normally used with definitions) - * - * @param preferredValue String value - */ - public void setPreferredValue(String preferredValue) - { - this.preferredValue = preferredValue; - } - - - /** - * Is the valid value deprecated? - * - * @return boolean flag - */ - public boolean getIsDeprecated() - { - return isDeprecated; - } - - - /** - * Set whether the valid value is deprecated or not. Default is false. - * - * @param deprecated boolean flag - */ - public void setIsDeprecated(boolean deprecated) - { - isDeprecated = deprecated; - } - - /** - * Generate a string containing the properties. - * - * @return string value - */ - @Override - public String toString() - { - return "ValidValueProperties{" + - "displayName='" + displayName + '\'' + - ", description='" + description + '\'' + - ", usage='" + usage + '\'' + - ", scope='" + scope + '\'' + - ", preferredValue='" + preferredValue + '\'' + - ", isDeprecated=" + isDeprecated + - ", deprecated=" + getIsDeprecated() + - ", typeName='" + getTypeName() + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", 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; - } - ValidValueProperties that = (ValidValueProperties) objectToCompare; - return Objects.equals(displayName, that.displayName) && - Objects.equals(description, that.description) && - Objects.equals(usage, that.usage) && - Objects.equals(scope, that.scope) && - Objects.equals(isDeprecated, that.isDeprecated) && - Objects.equals(preferredValue, that.preferredValue); - } - - - /** - * Return hash code based on properties. - * - * @return int - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), displayName, description, usage, scope, preferredValue, isDeprecated); - } -} diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/rest/DuplicatesResponse.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/rest/DuplicatesResponse.java index 5389e2c9fc4..ae484ac2f55 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/rest/DuplicatesResponse.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-api/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/rest/DuplicatesResponse.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements.DuplicateElement; -import org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements.ValidValueElement; import java.util.Arrays; import java.util.List; diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java index db78dec2b0e..ce7a2b1ab18 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-server/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/outtopic/StewardshipActionOMRSTopicListener.java @@ -749,7 +749,7 @@ public void processRefreshEntityEvent(String sourceName, * @param userId callers userId * @param entity entity to test * @param entityProxy entity proxy when entity is not available - * @return entity detail if it is to be send. + * @return entity detail if it is to be sent. */ private EntityDetail entityOfInterest(String userId, EntityDetail entity, @@ -824,22 +824,22 @@ else if (entityProxy != null) /** * Stewardship Action OMAS only publishes events of type Asset that * - * @param entityHeader entity element + * @param instanceHeader entity element * @return flag to say whether to publish the event. */ - private boolean isTypeOfInterest(InstanceHeader entityHeader) + private boolean isTypeOfInterest(InstanceHeader instanceHeader) { final String interestingTypeName = "Referenceable"; - if (entityHeader != null) + if (instanceHeader != null) { List typeNames = new ArrayList<>(); - typeNames.add(entityHeader.getType().getTypeDefName()); + typeNames.add(instanceHeader.getType().getTypeDefName()); - if (entityHeader.getType().getTypeDefSuperTypes() != null) + if (instanceHeader.getType().getTypeDefSuperTypes() != null) { - for (TypeDefLink superType : entityHeader.getType().getTypeDefSuperTypes()) + for (TypeDefLink superType : instanceHeader.getType().getTypeDefSuperTypes()) { if (superType != null) { @@ -848,7 +848,12 @@ private boolean isTypeOfInterest(InstanceHeader entityHeader) } } - return typeNames.contains(interestingTypeName); + if (typeNames.contains(OpenMetadataAPIMapper.TO_DO_TYPE_NAME)) + { + return true; + } + + return (typeNames.contains(OpenMetadataAPIMapper.INCIDENT_REPORT_TYPE_NAME)); } return false; diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/BasicFilesMonitorIntegrationConnectorBase.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/BasicFilesMonitorIntegrationConnectorBase.java index 1ff68da1090..bca8f08a710 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/BasicFilesMonitorIntegrationConnectorBase.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/BasicFilesMonitorIntegrationConnectorBase.java @@ -36,9 +36,9 @@ public abstract class BasicFilesMonitorIntegrationConnectorBase extends FilesInt private File dataFolderFile = null; - private Map monitors = new HashMap<>(); + private final Map monitors = new HashMap<>(); - private static int POLL_INTERVAL = 500; // milliseconds + private static final int POLL_INTERVAL = 500; // milliseconds /** diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java index a16086dc22b..15afc7696f3 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFilesMonitorIntegrationConnector.java @@ -157,9 +157,9 @@ public void refresh() throws ConnectorCheckedException if (dataFile != null) { if ((dataFile.getElementHeader() != null) && (dataFile.getElementHeader().getGUID() != null) && - (dataFile.getDataFileProperties() != null) && (dataFile.getDataFileProperties().getQualifiedName() != null)) + (dataFile.getDataFileProperties() != null) && (dataFile.getDataFileProperties().getPathName() != null)) { - File file = new File(dataFile.getDataFileProperties().getQualifiedName()); + File file = new File(dataFile.getDataFileProperties().getPathName()); if (! file.exists()) { @@ -234,8 +234,8 @@ private void catalogFile(File file, DataFileProperties properties = new DataFileProperties(); properties.setTypeName(this.getAssetTypeName(fileExtension)); - properties.setQualifiedName(file.getAbsolutePath()); - properties.setDisplayName(file.getName()); + properties.setPathName(file.getAbsolutePath()); + properties.setName(file.getName()); properties.setModifiedTime(new Date(file.lastModified())); List guids = this.getContext().addDataFileToCatalog(properties, null); @@ -244,7 +244,7 @@ private void catalogFile(File file, { auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FILE_CREATED.getMessageDefinition(connectorName, - properties.getQualifiedName(), + properties.getPathName(), guids.get( guids.size() - 1))); } @@ -287,7 +287,7 @@ private void catalogFile(File file, { TemplateProperties properties = new TemplateProperties(); - properties.setQualifiedName(file.getAbsolutePath()); + properties.setPathName(file.getAbsolutePath()); properties.setDisplayName(file.getName()); properties.setNetworkAddress(file.getAbsolutePath()); @@ -298,7 +298,7 @@ private void catalogFile(File file, auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FILE_CREATED_FROM_TEMPLATE.getMessageDefinition( connectorName, - properties.getQualifiedName(), + properties.getPathName(), guids.get(guids.size() - 1), templateQualifiedName, templateGUID)); @@ -406,18 +406,18 @@ private void archiveFileInCatalog(File file, } if ((cataloguedElement.getElementHeader() != null) && (cataloguedElement.getElementHeader().getGUID() != null) && - (cataloguedElement.getDataFileProperties() != null) && (cataloguedElement.getDataFileProperties().getQualifiedName() != null)) + (cataloguedElement.getDataFileProperties() != null) && (cataloguedElement.getDataFileProperties().getPathName() != null)) { if (allowCatalogDelete) { this.getContext().deleteDataFileFromCatalog(cataloguedElement.getElementHeader().getGUID(), - cataloguedElement.getDataFileProperties().getQualifiedName()); + cataloguedElement.getDataFileProperties().getPathName()); if (auditLog != null) { auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FILE_DELETED.getMessageDefinition(connectorName, - cataloguedElement.getDataFileProperties().getQualifiedName(), + cataloguedElement.getDataFileProperties().getPathName(), cataloguedElement.getElementHeader().getGUID())); } } @@ -434,7 +434,7 @@ private void archiveFileInCatalog(File file, { auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FILE_ARCHIVED.getMessageDefinition(connectorName, - cataloguedElement.getDataFileProperties().getQualifiedName(), + cataloguedElement.getDataFileProperties().getPathName(), cataloguedElement.getElementHeader().getGUID())); } } @@ -484,7 +484,7 @@ private void updateFileInCatalog(File file) if (dataFileInCatalog != null) { if ((dataFileInCatalog.getElementHeader() != null) && (dataFileInCatalog.getElementHeader().getGUID() != null) && - (dataFileInCatalog.getDataFileProperties() != null) && (dataFileInCatalog.getDataFileProperties().getQualifiedName() != null)) + (dataFileInCatalog.getDataFileProperties() != null) && (dataFileInCatalog.getDataFileProperties().getPathName() != null)) { DataFileProperties properties = new DataFileProperties(); @@ -496,7 +496,7 @@ private void updateFileInCatalog(File file) { auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FILE_UPDATED.getMessageDefinition(connectorName, - dataFileInCatalog.getDataFileProperties().getQualifiedName(), + dataFileInCatalog.getDataFileProperties().getPathName(), dataFileInCatalog.getElementHeader().getGUID())); } } diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFolderMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFolderMonitorIntegrationConnector.java index f0f4d12cf4a..0ba2f3bf115 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFolderMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/files-integration-connectors/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/basicfiles/DataFolderMonitorIntegrationConnector.java @@ -86,7 +86,7 @@ private void updateDataFolder(File fileChanged, String methodName) { String directoryName = null; - String fileFolderQualifiedName = null; + String fileFolderPathName = null; try { @@ -99,7 +99,7 @@ private void updateDataFolder(File fileChanged, } directoryName = folderFile.getName(); - fileFolderQualifiedName = folderElement.getFileFolderProperties().getQualifiedName(); + fileFolderPathName = folderElement.getFileFolderProperties().getPathName(); Date lastRecordedChange = folderElement.getFileFolderProperties().getModifiedTime(); @@ -116,14 +116,14 @@ private void updateDataFolder(File fileChanged, { auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FOLDER_UPDATED.getMessageDefinition(connectorName, - fileFolderQualifiedName, + fileFolderPathName, modifiedTime.toString())); } else { auditLog.logMessage(methodName, BasicFilesIntegrationConnectorsAuditCode.DATA_FOLDER_UPDATED_FOR_FILE.getMessageDefinition(connectorName, - fileFolderQualifiedName, + fileFolderPathName, modifiedTime.toString(), fileChanged.getAbsolutePath())); } @@ -137,7 +137,7 @@ private void updateDataFolder(File fileChanged, auditLog.logException(methodName, BasicFilesIntegrationConnectorsAuditCode.UNEXPECTED_EXC_FOLDER_UPDATE.getMessageDefinition(error.getClass().getName(), connectorName, - fileFolderQualifiedName, + fileFolderPathName, directoryName, error.getMessage()), error); @@ -152,7 +152,7 @@ private void updateDataFolder(File fileChanged, */ class FileCataloguingListener extends FileAlterationListenerAdaptor { - private DataFolderMonitorIntegrationConnector connector; + private final DataFolderMonitorIntegrationConnector connector; FileCataloguingListener(DataFolderMonitorIntegrationConnector connector) { diff --git a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java index f88f5924396..8c207cff87c 100644 --- a/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java +++ b/open-metadata-implementation/adapters/open-connectors/integration-connectors/openapi-integration-connector/src/main/java/org/odpi/openmetadata/adapters/connectors/integration/openapis/OpenAPIMonitorIntegrationConnector.java @@ -581,7 +581,7 @@ private String getAPIGUID(String url, APIProperties properties = new APIProperties(); properties.setQualifiedName(apiQualifiedName); - properties.setDisplayName(tag.getName()); + properties.setName(tag.getName()); properties.setDescription(tag.getDescription()); apiGUID = myContext.createAPI(endpointGUID, properties); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetBuilder.java index d93bb0d9a34..bd95051bde3 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetBuilder.java @@ -16,6 +16,7 @@ public class AssetBuilder extends ReferenceableBuilder { private String technicalName = null; + private String versionIdentifier = null; private String technicalDescription = null; @@ -66,6 +67,7 @@ protected AssetBuilder(String typeGUID, * * @param qualifiedName unique name * @param technicalName new value for the name + * @param versionIdentifier new value for the versionIdentifier * @param technicalDescription new description for the asset * @param additionalProperties additional properties * @param typeGUID unique identifier for the type of this asset @@ -77,6 +79,7 @@ protected AssetBuilder(String typeGUID, */ protected AssetBuilder(String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String typeGUID, @@ -96,6 +99,7 @@ protected AssetBuilder(String qualifiedName, serverName); this.technicalName = technicalName; + this.versionIdentifier = versionIdentifier; this.technicalDescription = technicalDescription; } @@ -105,6 +109,7 @@ protected AssetBuilder(String qualifiedName, * * @param qualifiedName unique name * @param technicalName new value for the name + * @param versionIdentifier new value for the versionIdentifier * @param technicalDescription new description for the asset * @param additionalProperties additional properties * @param typeGUID unique identifier for the type of this asset @@ -117,6 +122,7 @@ protected AssetBuilder(String qualifiedName, */ protected AssetBuilder(String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String typeGUID, @@ -138,6 +144,7 @@ protected AssetBuilder(String qualifiedName, serverName); this.technicalName = technicalName; + this.versionIdentifier = versionIdentifier; this.technicalDescription = technicalDescription; } @@ -418,15 +425,20 @@ public InstanceProperties getInstanceProperties(String methodName) throws Inval InstanceProperties properties = super.getInstanceProperties(methodName); properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataAPIMapper.NAME_PROPERTY_NAME, - technicalName, - methodName); - properties = repositoryHelper.addStringPropertyToInstance(serviceName, - properties, - OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, - technicalDescription, - methodName); + properties, + OpenMetadataAPIMapper.NAME_PROPERTY_NAME, + technicalName, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.VERSION_IDENTIFIER_PROPERTY_NAME, + versionIdentifier, + methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, + properties, + OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, + technicalDescription, + methodName); return properties; } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java index ff2977b1535..3a583b5f4aa 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/AssetHandler.java @@ -584,8 +584,10 @@ public String detachSchemaTypeFromAsset(String userId, * @param expectedTypeName unique name of type (or super type of asset identified by templateGUID) * @param qualifiedName unique name for this asset - must not be null * @param qualifiedNameParameterName parameter name providing qualifiedName - * @param displayName the stored display name property for the database - if null, the value from the template is used + * @param name the stored name property for the asset - if null, the value from the template is used + * @param versionIdentifier the stored versionIdentifier property for the asset * @param description the stored description property associated with the database - if null, the value from the template is used + * @param pathName the physical address of the storage where the data is held (for DataStore assets) * @param networkAddress if there is a connection object for this asset - update the endpoint network address * @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 @@ -608,8 +610,10 @@ public String addAssetFromTemplate(String userId, String expectedTypeName, String qualifiedName, String qualifiedNameParameterName, - String displayName, + String name, + String versionIdentifier, String description, + String pathName, String networkAddress, boolean forLineage, boolean forDuplicateProcessing, @@ -622,13 +626,23 @@ public String addAssetFromTemplate(String userId, invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + Map extendedProperties = null; + + if (pathName != null) + { + extendedProperties = new HashMap<>(); + + extendedProperties.put(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME, pathName); + } + AssetBuilder builder = new AssetBuilder(qualifiedName, - displayName, + name, + versionIdentifier, description, null, expectedTypeGUID, expectedTypeName, - null, + extendedProperties, repositoryHelper, serviceName, serverName); @@ -728,7 +742,8 @@ public String addAssetFromTemplate(String userId, * @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 this asset - * @param technicalName the stored display name property for the asset + * @param technicalName the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset * @param technicalDescription the stored description property associated with the asset * @param zoneMembership initial zones for the asset - or null to allow the security module to set it up * @param owner identifier of the owner @@ -757,6 +772,7 @@ public String createAssetInRepository(String userId, String externalSourceName, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, List zoneMembership, String owner, @@ -791,6 +807,7 @@ public String createAssetInRepository(String userId, AssetBuilder builder = new AssetBuilder(qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, assetTypeId, @@ -840,7 +857,8 @@ else if (defaultZones != null) * @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 this asset - * @param technicalName the stored display name property for the asset + * @param technicalName the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset * @param technicalDescription the stored description property associated with the asset * @param additionalProperties any arbitrary properties not part of the type system * @param typeName name of the type that is a subtype of asset - or null to create standard type @@ -862,6 +880,7 @@ public String createAssetInRepository(String userId, String externalSourceName, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String typeName, @@ -889,6 +908,7 @@ public String createAssetInRepository(String userId, AssetBuilder builder = new AssetBuilder(qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, assetTypeId, @@ -926,7 +946,8 @@ public String createAssetInRepository(String userId, * @param externalSourceName unique name of software capability representing the caller * @param assetGUIDParameterName parameter name of the resulting asset's GUID * @param assetQualifiedName unique name for this asset - * @param technicalName the stored display name property for the asset + * @param technicalName the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset * @param technicalDescription the stored description property associated with the asset * @param additionalProperties any arbitrary properties not part of the type system * @param assetTypeName name of the type that is a subtype of asset - or null to create standard type @@ -958,6 +979,7 @@ public String createAssetWithConnection(String userId, String assetGUIDParameterName, String assetQualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String assetTypeName, @@ -983,6 +1005,7 @@ public String createAssetWithConnection(String userId, externalSourceName, assetQualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, assetTypeName, @@ -1030,7 +1053,8 @@ public String createAssetWithConnection(String userId, * @param assetGUID unique identifier of the metadata element to update * @param assetGUIDParameterName parameter name that supplied the assetGUID * @param qualifiedName unique name for this database - * @param technicalName the stored display name property for the asset + * @param technicalName the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset * @param technicalDescription the stored description property associated with the asset * @param additionalProperties any arbitrary properties not part of the type system * @param typeName name of the type that is a subtype of Database - or null to create standard type @@ -1054,6 +1078,7 @@ public void updateAsset(String userId, String assetGUIDParameterName, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String typeName, @@ -1081,6 +1106,7 @@ public void updateAsset(String userId, assetGUIDParameterName, qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, typeGUID, @@ -1106,7 +1132,8 @@ public void updateAsset(String userId, * @param assetGUID unique identifier of the metadata element to update * @param assetGUIDParameterName parameter name that supplied the assetGUID * @param qualifiedName unique name for this database - * @param technicalName the stored display name property for the asset + * @param technicalName the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset * @param technicalDescription the stored description property associated with the asset * @param additionalProperties any arbitrary properties not part of the type system * @param typeGUID identifier of the type that is a subtype of Database - or null to create standard type @@ -1131,6 +1158,7 @@ public void updateAsset(String userId, String assetGUIDParameterName, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String typeGUID, @@ -1153,6 +1181,7 @@ public void updateAsset(String userId, assetGUIDParameterName, qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, typeGUID, @@ -1178,7 +1207,8 @@ public void updateAsset(String userId, * @param assetGUID unique identifier of the metadata element to update * @param assetGUIDParameterName parameter name that supplied the assetGUID * @param qualifiedName unique name for this database - * @param technicalName the stored display name property for the asset + * @param technicalName the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset * @param technicalDescription the stored description property associated with the asset * @param additionalProperties any arbitrary properties not part of the type system * @param typeGUID identifier of the type that is a subtype of Asset - or null to create standard type @@ -1204,6 +1234,7 @@ public void updateAsset(String userId, String assetGUIDParameterName, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, Map additionalProperties, String typeGUID, @@ -1222,6 +1253,7 @@ public void updateAsset(String userId, { AssetBuilder builder = new AssetBuilder(qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, typeGUID, @@ -1258,9 +1290,10 @@ public void updateAsset(String userId, * @param externalSourceName unique name of software capability representing the caller * @param assetGUID unique identifier of the metadata element to update * @param assetGUIDParameterName parameter name that supplied the assetGUID - * @param qualifiedName unique name for this database - * @param displayName the stored display name property for the database - * @param description the stored description property associated with the database + * @param qualifiedName unique name for this asset + * @param name the stored name property for the asset + * @param versionIdentifier the stored versionIdentifier property for the asset + * @param description the stored description property associated with the asset * @param additionalProperties any arbitrary properties not part of the type system * @param typeGUID identifier of the type that is a subtype of Database - or null to create standard type * @param typeName name of the type that is a subtype of Database - or null to create standard type @@ -1284,7 +1317,8 @@ public void updateAssetWithConnection(String userId, String assetGUID, String assetGUIDParameterName, String qualifiedName, - String displayName, + String name, + String versionIdentifier, String description, Map additionalProperties, String typeGUID, @@ -1307,7 +1341,8 @@ public void updateAssetWithConnection(String userId, assetGUID, assetGUIDParameterName, qualifiedName, - displayName, + name, + versionIdentifier, description, additionalProperties, typeGUID, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java index 6791b45f5ff..06b4511a157 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ConnectionHandler.java @@ -868,8 +868,8 @@ public void addAssetConnection(String userId, /* * A connector type is present, so it is possible to create a connection. */ - String endpointName = assetTypeName + ":" + assetQualifiedName + " Endpoint"; - String connectionName = assetTypeName + ":" + assetQualifiedName + " Connection"; + String endpointName = assetQualifiedName + " Endpoint"; + String connectionName = assetQualifiedName + " Connection"; String anchorGUID = null; diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java index b36b5b31d6c..f28c86dba7a 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/FilesAndFoldersHandler.java @@ -5,12 +5,14 @@ import org.odpi.openmetadata.adapters.connectors.datastore.csvfile.CSVFileStoreProvider; import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.generichandlers.ffdc.GenericHandlersErrorCode; import org.odpi.openmetadata.commonservices.repositoryhandler.RepositoryHandler; 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.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.InstanceStatus; import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper; @@ -368,13 +370,14 @@ public String createFileSystem(String userId, /** - * Create the requested asset. + * Create the requested FileFolder asset. * * @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 pathName qualified name for the file system - * @param displayName short display name + * @param pathName full path name for the file system + * @param name short display name + * @param versionIdentifier version identifier for the folder * @param description description of the file system * @param typeName type of file system * @param effectiveFrom starting time for this relationship (null for all time) @@ -394,7 +397,8 @@ private String createFolder(String userId, String externalSourceGUID, String externalSourceName, String pathName, - String displayName, + String name, + String versionIdentifier, String description, String typeName, Date effectiveFrom, @@ -403,8 +407,8 @@ private String createFolder(String userId, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + UserNotAuthorizedException, + PropertyServerException { final String folderAssetGUIDParameterName = "folderAssetGUID"; @@ -414,16 +418,21 @@ private String createFolder(String userId, folderAssetTypeName = typeName; } + Map extendedProperties = new HashMap<>(); + + extendedProperties.put(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME, pathName); + return folderHandler.createAssetWithConnection(userId, externalSourceGUID, externalSourceName, folderAssetGUIDParameterName, - pathName, - displayName, + this.createQualifiedName(folderAssetTypeName, pathName, versionIdentifier), + name, + versionIdentifier, description, null, folderAssetTypeName, - null, + extendedProperties, InstanceStatus.ACTIVE, true, null, @@ -447,8 +456,10 @@ private String createFolder(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param fileType file extension name + * @param fileName name of the file * @param pathName qualified name for the file system * @param displayName short display name + * @param versionIdentifier version identifier for the file system * @param description description of the file system * @param typeName type of file system * @param initialExtendedProperties extended properties for a specific file type @@ -470,8 +481,10 @@ private String createFileAsset(String userId, String externalSourceGUID, String externalSourceName, String fileType, + String fileName, String pathName, String displayName, + String versionIdentifier, String description, String typeName, Map initialExtendedProperties, @@ -494,6 +507,8 @@ private String createFileAsset(String userId, } extendedProperties.put(OpenMetadataAPIMapper.FILE_TYPE_PROPERTY_NAME, fileType); + extendedProperties.put(OpenMetadataAPIMapper.FILE_NAME_PROPERTY_NAME, fileName); + extendedProperties.put(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME, pathName); String fileAssetTypeName = OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME; if (typeName != null) @@ -505,8 +520,9 @@ private String createFileAsset(String userId, externalSourceGUID, externalSourceName, fileAssetGUIDParameterName, - pathName, + this.createQualifiedName(fileAssetTypeName, pathName, versionIdentifier), displayName, + versionIdentifier, description, null, fileAssetTypeName, @@ -524,7 +540,29 @@ private String createFileAsset(String userId, forDuplicateProcessing, effectiveTime, methodName); + } + + /** + * Construct the qualified name for a file resource. + * + * @param typeName type of element + * @param pathName pathname in file system + * @param versionIdentifier version identifier + * @return qualified name + */ + private String createQualifiedName(String typeName, + String pathName, + String versionIdentifier) + { + if (versionIdentifier == null) + { + return typeName + ":" + pathName; + } + else + { + return typeName + ":" + pathName + ":" + versionIdentifier; + } } @@ -539,6 +577,7 @@ private String createFileAsset(String userId, * @param connectToGUID root object to connect the folder to * @param pathName pathname of the folder (or folders) * @param folderName name of the leaf folder + * @param versionIdentifier version identifier for the asset * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned @@ -558,6 +597,7 @@ private String createFolderInCatalog(String userId, String connectToGUID, String pathName, String folderName, + String versionIdentifier, Date effectiveFrom, Date effectiveTo, boolean forLineage, @@ -575,6 +615,7 @@ private String createFolderInCatalog(String userId, externalSourceName, pathName, folderName, + versionIdentifier, null, OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, effectiveFrom, @@ -730,6 +771,7 @@ private List createFolderStructureInCatalog(String userId, nextConnectToGUID, pathName, folderName, + null, effectiveFrom, effectiveTo, forLineage, @@ -1438,7 +1480,8 @@ private List addFileAssetPath(String userId, * @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 displayName display name for the folder in the catalog + * @param name name for the folder in the catalog + * @param versionIdentifier version identifier for the folder in the catalog * @param description description of the folder in the catalog * @param pathName pathname of the file * @param effectiveFrom starting time for this relationship (null for all time) @@ -1457,7 +1500,8 @@ private List addFileAssetPath(String userId, public List addDataFileAssetToCatalog(String userId, String externalSourceGUID, String externalSourceName, - String displayName, + String name, + String versionIdentifier, String description, String pathName, Date effectiveFrom, @@ -1476,13 +1520,15 @@ public List addDataFileAssetToCatalog(String userId, invalidParameterHandler.validateName(pathName, pathParameterName, methodName); String fileType = this.getFileType(pathName); - + String fileName = this.getFileName(pathName); String fileAssetGUID = this.createFileAsset(userId, externalSourceGUID, externalSourceName, fileType, + fileName, pathName, - displayName, + name, + versionIdentifier, description, OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, null, @@ -1602,7 +1648,8 @@ private Map getExtendedProperties(String pathName, * @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 pathName pathname of the file - * @param displayName display name for the folder in the catalog + * @param name name for the folder in the catalog + * @param versionIdentifier version identifier for the folder in the catalog * @param description description of the folder in the catalog * @param createTime time that the folder was created * @param modifiedTime the time of the latest change to the file @@ -1631,7 +1678,8 @@ public List addDataFolderAssetToCatalog(String userId, String externalSourceGUID, String externalSourceName, String pathName, - String displayName, + String name, + String versionIdentifier, String description, Date createTime, Date modifiedTime, @@ -1681,7 +1729,8 @@ public List addDataFolderAssetToCatalog(String userId, externalSourceName, folderAssetParameterName, pathName, - displayName, + name, + versionIdentifier, description, additionalProperties, folderAssetTypeName, @@ -1726,7 +1775,8 @@ public List addDataFolderAssetToCatalog(String userId, * @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 displayName display name for the folder in the catalog + * @param name name for the folder in the catalog + * @param versionIdentifier versionIdentifier for the folder in the catalog * @param description description of the folder in the catalog * @param pathName pathname of the file * @param effectiveFrom starting time for this relationship (null for all time) @@ -1746,7 +1796,8 @@ public List addDataFolderAssetToCatalog(String userId, String externalSourceGUID, String externalSourceName, String pathName, - String displayName, + String name, + String versionIdentifier, String description, Date effectiveFrom, Date effectiveTo, @@ -1767,7 +1818,8 @@ public List addDataFolderAssetToCatalog(String userId, externalSourceGUID, externalSourceName, pathName, - displayName, + name, + versionIdentifier, description, OpenMetadataAPIMapper.DATA_FOLDER_TYPE_NAME, effectiveFrom, @@ -1798,7 +1850,8 @@ public List addDataFolderAssetToCatalog(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param qualifiedName unique name for the file - typically path and file name - * @param displayName short display name for file (defaults to the file name without the path) + * @param name short name for file (defaults to the file name without the path) + * @param versionIdentifier version identifier for the file * @param description description of the file * @param pathName the fully qualified physical location of the data store - default is qualified name * @param createTime the time that the file was created @@ -1829,7 +1882,8 @@ public List addFileToCatalog(String userId, String externalSourceGUID, String externalSourceName, String qualifiedName, - String displayName, + String name, + String versionIdentifier, String description, String pathName, Date createTime, @@ -1904,7 +1958,8 @@ else if (defaultAvroFileType.equals(fileType)) externalSourceName, fileAssetParameterName, fullPath, - displayName, + name, + versionIdentifier, description, additionalProperties, fileAssetTypeName, @@ -1950,7 +2005,8 @@ else if (defaultAvroFileType.equals(fileType)) * @param externalSourceName name of the software capability entity that represented the external source * @param templateGUID unique identifier of the asset description to copy * @param fullPath unique path and file name for file - * @param displayName short display name for file (defaults to the file name without the path) + * @param name short display name for file (defaults to the file name without the path) + * @param versionIdentifier version identifier of the file * @param description description of the file * @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 @@ -1967,7 +2023,8 @@ public List addFileToCatalogFromTemplate(String userId, String externalSourceName, String templateGUID, String fullPath, - String displayName, + String name, + String versionIdentifier, String description, boolean forLineage, boolean forDuplicateProcessing, @@ -1977,12 +2034,12 @@ public List addFileToCatalogFromTemplate(String userId, PropertyServerException { final String templateGUIDParameterName = "templateGUID"; - final String qualifiedNameParameterName = "fullPath"; + final String pathNameParameterName = "fullPath"; final String fileAssetParameterName = "fileAssetGUID"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); - invalidParameterHandler.validateName(fullPath, qualifiedNameParameterName, methodName); + invalidParameterHandler.validateName(fullPath, pathNameParameterName, methodName); String fileAssetGUID = fileHandler.addAssetFromTemplate(userId, externalSourceGUID, @@ -1991,11 +2048,13 @@ public List addFileToCatalogFromTemplate(String userId, templateGUIDParameterName, OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, - fullPath, - qualifiedNameParameterName, - displayName, + createQualifiedName(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, fullPath, versionIdentifier), + pathNameParameterName, + name, + versionIdentifier, description, fullPath, + fullPath, forLineage, forDuplicateProcessing, effectiveTime, @@ -2009,7 +2068,7 @@ public List addFileToCatalogFromTemplate(String userId, fileAssetGUID, fileAssetParameterName, fullPath, - qualifiedNameParameterName, + pathNameParameterName, forLineage, forDuplicateProcessing, effectiveTime, @@ -2021,14 +2080,15 @@ public List addFileToCatalogFromTemplate(String userId, /** - * Create a new file asset based on an existing asset but with the supplied path name, display name and description. + * Create a new folder asset based on an existing asset but with the supplied path name, display name and description. * * @param userId calling user (assumed to be the owner) * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param templateGUID unique identifier of the asset description to copy * @param pathName unique path and file name for file - * @param displayName short display name for file (defaults to the file name without the path) + * @param name short name for file (defaults to the file name without the path) + * @param versionIdentifier version identifier for the file * @param description description of the file * @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 @@ -2045,7 +2105,8 @@ public List addFolderToCatalogFromTemplate(String userId, String externalSourceName, String templateGUID, String pathName, - String displayName, + String name, + String versionIdentifier, String description, boolean forLineage, boolean forDuplicateProcessing, @@ -2055,25 +2116,27 @@ public List addFolderToCatalogFromTemplate(String userId, PropertyServerException { final String templateGUIDParameterName = "templateGUID"; - final String qualifiedNameParameterName = "pathName"; + final String pathNameParameterName = "pathName"; final String fileAssetParameterName = "folderAssetGUID"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); - invalidParameterHandler.validateName(pathName, qualifiedNameParameterName, methodName); + invalidParameterHandler.validateName(pathName, pathNameParameterName, methodName); String folderAssetGUID = fileHandler.addAssetFromTemplate(userId, externalSourceGUID, externalSourceName, templateGUID, templateGUIDParameterName, - OpenMetadataAPIMapper.DATA_FOLDER_TYPE_GUID, - OpenMetadataAPIMapper.DATA_FOLDER_TYPE_NAME, - pathName, - qualifiedNameParameterName, - displayName, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, + this.createQualifiedName(OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, pathName, versionIdentifier), + pathNameParameterName, + name, + versionIdentifier, description, pathName, + pathName, forLineage, forDuplicateProcessing, effectiveTime, @@ -2087,7 +2150,7 @@ public List addFolderToCatalogFromTemplate(String userId, folderAssetGUID, fileAssetParameterName, pathName, - qualifiedNameParameterName, + pathNameParameterName, forLineage, forDuplicateProcessing, effectiveTime, @@ -2104,7 +2167,8 @@ public List addFolderToCatalogFromTemplate(String userId, * @param userId calling user (assumed to be the owner) * @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 displayName display name for the file in the catalog + * @param name display name for the file in the catalog + * @param versionIdentifier version identifier for the file * @param description description of the file in the catalog * @param fullPath full path of the file - used to access the file through the connector * @param effectiveFrom starting time for this relationship (null for all time) @@ -2123,7 +2187,8 @@ public List addFolderToCatalogFromTemplate(String userId, public List addAvroFileToCatalog(String userId, String externalSourceGUID, String externalSourceName, - String displayName, + String name, + String versionIdentifier, String description, String fullPath, Date effectiveFrom, @@ -2142,6 +2207,7 @@ public List addAvroFileToCatalog(String userId, invalidParameterHandler.validateName(fullPath, pathParameterName, methodName); String fileType = this.getFileType(fullPath); + String fileName = this.getFileName(fullPath); if (fileType == null) { @@ -2152,8 +2218,10 @@ public List addAvroFileToCatalog(String userId, externalSourceGUID, externalSourceName, fileType, + fileName, fullPath, - displayName, + name, + versionIdentifier, description, OpenMetadataAPIMapper.AVRO_FILE_TYPE_NAME, null, @@ -2185,7 +2253,8 @@ public List addAvroFileToCatalog(String userId, * @param userId calling user (assumed to be the owner) * @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 displayName display name for the file in the catalog + * @param name name for the file in the catalog + * @param versionIdentifier version identifier for the file * @param description description of the file in the catalog * @param fullPath full path of the file - used to access the file through the connector * @param columnHeaders does the first line of the file contain the column names. If not pass the list of column headers. @@ -2207,7 +2276,8 @@ public List addAvroFileToCatalog(String userId, public List addCSVFileToCatalog(String userId, String externalSourceGUID, String externalSourceName, - String displayName, + String name, + String versionIdentifier, String description, String fullPath, List columnHeaders, @@ -2231,6 +2301,7 @@ public List addCSVFileToCatalog(String userId, invalidParameterHandler.validateName(fullPath, pathParameterName, methodName); String fileType = this.getFileType(fullPath); + String fileName = this.getFileName(fullPath); if (fileType == null) { @@ -2266,8 +2337,10 @@ public List addCSVFileToCatalog(String userId, externalSourceGUID, externalSourceName, fileType, + fileName, fullPath, - displayName, + name, + versionIdentifier, description, OpenMetadataAPIMapper.CSV_FILE_TYPE_NAME, extendedProperties, @@ -2389,6 +2462,7 @@ public List addCSVFileToCatalog(String userId, * @param isMergeUpdate should the new properties be merged with the existing properties or completely replace them? * @param fullPath unique path and file name for file * @param displayName short display name for file (defaults to the file name without the path) + * @param versionIdentifier versionIdentifier property * @param description description of the file * @param createTime the time that the file was created * @param modifiedTime the time of the latest change to the file @@ -2417,6 +2491,7 @@ public void updateFileInCatalog(String userId, boolean isMergeUpdate, String fullPath, String displayName, + String versionIdentifier, String description, Date createTime, Date modifiedTime, @@ -2441,6 +2516,18 @@ public void updateFileInCatalog(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(dataFileGUID, dataFileGUIDParameterName, methodName); + String qualifiedName = null; + String fileType = suppliedFileType; + + if ((fullPath != null) && (fileType == null)) + { + fileType = this.getFileType(fullPath); + } + if (! isMergeUpdate) + { + qualifiedName = this.createQualifiedName(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, fullPath, versionIdentifier); + } + Map assetExtendedProperties = this.getExtendedProperties(fullPath, createTime, modifiedTime, @@ -2448,17 +2535,27 @@ public void updateFileInCatalog(String userId, encodingLanguage, encodingDescription, encodingProperties, - suppliedFileType, + fileType, extendedProperties); + if (fullPath != null) + { + if (assetExtendedProperties != null) + { + assetExtendedProperties = new HashMap<>(); + } + + assetExtendedProperties.put(OpenMetadataAPIMapper.FILE_NAME_PROPERTY_NAME, this.getFileName(fullPath)); + } fileHandler.updateAsset(userId, externalSourceGUID, externalSourceName, dataFileGUID, dataFileGUIDParameterName, - fullPath, + qualifiedName, displayName, + versionIdentifier, description, additionalProperties, OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, @@ -2484,7 +2581,8 @@ public void updateFileInCatalog(String userId, * @param dataFileGUID guid of the file asset * @param isMergeUpdate should the new properties be merged with the existing properties or completely replace them? * @param fullPath unique path and file name for file - * @param displayName short display name for file (defaults to the file name without the path) + * @param versionIdentifier version identifier for the file + * @param displayName short name for file * @param description description of the file * @param createTime the time that the file was created * @param modifiedTime the time of the latest change to the file @@ -2512,6 +2610,7 @@ public void updateFolderInCatalog(String userId, boolean isMergeUpdate, String fullPath, String displayName, + String versionIdentifier, String description, Date createTime, Date modifiedTime, @@ -2530,10 +2629,17 @@ public void updateFolderInCatalog(String userId, UserNotAuthorizedException, PropertyServerException { - final String dataFolderGUIDParameterName = "dataFolderGUID"; + final String dataFileGUIDParameterName = "dataFileGUID"; invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(dataFileGUID, dataFolderGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(dataFileGUID, dataFileGUIDParameterName, methodName); + + String qualifiedName = null; + + if (! isMergeUpdate) + { + qualifiedName = this.createQualifiedName(OpenMetadataAPIMapper.DATA_FOLDER_TYPE_NAME, fullPath, versionIdentifier); + } Map assetExtendedProperties = this.getExtendedProperties(fullPath, createTime, @@ -2550,9 +2656,10 @@ public void updateFolderInCatalog(String userId, externalSourceGUID, externalSourceName, dataFileGUID, - dataFolderGUIDParameterName, - fullPath, + dataFileGUIDParameterName, + qualifiedName, displayName, + versionIdentifier, description, additionalProperties, OpenMetadataAPIMapper.DATA_FOLDER_TYPE_GUID, @@ -2761,7 +2868,6 @@ public void archiveFolderInCatalog(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param dataFileGUID guid of the file asset - * @param fullPathname unique path and file name for file * @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) @@ -2775,7 +2881,6 @@ public void deleteFileFromCatalog(String userId, String externalSourceGUID, String externalSourceName, String dataFileGUID, - String fullPathname, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, @@ -2795,8 +2900,8 @@ public void deleteFileFromCatalog(String userId, dataFileGUIDParameterName, OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - fullPathname, + null, + null, forLineage, forDuplicateProcessing, effectiveTime, @@ -2812,7 +2917,6 @@ public void deleteFileFromCatalog(String userId, * @param externalSourceGUID guid of the software capability entity that represented the external source - null for local * @param externalSourceName name of the software capability entity that represented the external source * @param dataFolderGUID guid of the file asset - * @param fullPathname unique path and file name for file * @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) @@ -2826,7 +2930,6 @@ public void deleteFolderFromCatalog(String userId, String externalSourceGUID, String externalSourceName, String dataFolderGUID, - String fullPathname, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, @@ -2846,8 +2949,8 @@ public void deleteFolderFromCatalog(String userId, dataFolderGUIDParameterName, OpenMetadataAPIMapper.DATA_FOLDER_TYPE_GUID, OpenMetadataAPIMapper.DATA_FOLDER_TYPE_NAME, - OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, - fullPathname, + null, + null, forLineage, forDuplicateProcessing, effectiveTime, @@ -3033,17 +3136,44 @@ private String getFolderGUIDByPathName(String userId, UserNotAuthorizedException, PropertyServerException { - final String nameName = "pathName"; + final String pathNameParameterName = "pathName"; - return folderHandler.getBeanGUIDByQualifiedName(userId, - OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, - OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, - pathName, - nameName, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME); + + List entities = fileHandler.getEntitiesByValue(userId, + pathName, + pathNameParameterName, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + 0, + 0, + effectiveTime, + methodName); + if (entities == null) + { + return null; + } + else if (entities.size() == 1) + { + return entities.get(0).getGUID(); + } + + throw new PropertyServerException(GenericHandlersErrorCode.MULTIPLE_ENTITIES_FOUND.getMessageDefinition(OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, + pathName, + entities.toString(), + methodName, + pathNameParameterName, + serverName), + this.getClass().getName(), + methodName); } @@ -3072,17 +3202,44 @@ public FOLDER getFolderByPathName(String userId, UserNotAuthorizedException, PropertyServerException { - final String nameName = "pathName"; + final String pathNameParameterName = "pathName"; + + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME); + + List folders = folderHandler.getBeansByValue(userId, + pathName, + pathNameParameterName, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + 0, + 0, + effectiveTime, + methodName); + if (folders == null) + { + return null; + } + else if (folders.size() == 1) + { + return folders.get(0); + } - return folderHandler.getBeanByQualifiedName(userId, - OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, - OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, - pathName, - nameName, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); + throw new PropertyServerException(GenericHandlersErrorCode.MULTIPLE_ENTITIES_FOUND.getMessageDefinition(OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, + pathName, + folders.toString(), + methodName, + pathNameParameterName, + serverName), + this.getClass().getName(), + methodName); } @@ -3092,6 +3249,8 @@ public FOLDER getFolderByPathName(String userId, * * @param userId calling user * @param pathName path name + * @param startingFrom starting point in the list + * @param pageSize maximum number of results * @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) @@ -3103,28 +3262,38 @@ public FOLDER getFolderByPathName(String userId, * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - public List findFolderByPathName(String userId, - String pathName, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List findFoldersByPathName(String userId, + String pathName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { - final String nameName = "pathName"; - - return folderHandler.findBeansByQualifiedName(userId, - OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, - OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, - pathName, - nameName, - forLineage, - forDuplicateProcessing, - 0, - invalidParameterHandler.getMaxPagingSize(), - effectiveTime, - methodName); + final String pathNameParameterName = "pathName"; + + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME); + + return folderHandler.getBeansByValue(userId, + pathName, + pathNameParameterName, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_GUID, + OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, + specificMatchPropertyNames, + false, + null, + null, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + startingFrom, + pageSize, + effectiveTime, + methodName); } @@ -3133,6 +3302,8 @@ public List findFolderByPathName(String userId, * * @param userId calling user * @param name wildcard name + * @param startingFrom starting point in the list + * @param pageSize maximum number of results * @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) @@ -3144,14 +3315,16 @@ public List findFolderByPathName(String userId, * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - public List findFolderByName(String userId, - String name, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + public List findFoldersByName(String userId, + String name, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { final String nameName = "name"; @@ -3160,8 +3333,8 @@ public List findFolderByName(String userId, OpenMetadataAPIMapper.FILE_FOLDER_TYPE_NAME, name, nameName, - 0, - invalidParameterHandler.getMaxPagingSize(), + startingFrom, + pageSize, forLineage, forDuplicateProcessing, effectiveTime, @@ -3374,21 +3547,48 @@ public FILE getDataFileByPathName(String userId, UserNotAuthorizedException, PropertyServerException { - return fileHandler.getBeanByQualifiedName(userId, - OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, - OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, - pathName, - pathNameParameterName, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME); + + List files = fileHandler.getBeansByValue(userId, + pathName, + pathNameParameterName, + OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, + OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + 0, + 0, + effectiveTime, + methodName); + if (files == null) + { + return null; + } + else if (files.size() == 1) + { + return files.get(0); + } + + throw new PropertyServerException(GenericHandlersErrorCode.MULTIPLE_ENTITIES_FOUND.getMessageDefinition(OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, + pathName, + files.toString(), + methodName, + pathNameParameterName, + serverName), + this.getClass().getName(), + methodName); } /** - * Retrieve a data file by its fully qualified path name. In theory there should be none or one asset returned. - * However, in complex environments, duplicates are possible. + * Find data file by a full or partial path name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * pathName property. * * @param userId calling user * @param pathName path name @@ -3406,34 +3606,43 @@ public FILE getDataFileByPathName(String userId, * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem */ - public List findDataFileByPathName(String userId, - String pathName, - String pathNameParameterName, - int startingFrom, - int pageSize, - boolean forLineage, - boolean forDuplicateProcessing, - Date effectiveTime, - String methodName) throws InvalidParameterException, + public List findDataFilesByPathName(String userId, + String pathName, + String pathNameParameterName, + int startingFrom, + int pageSize, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException { - return fileHandler.findBeansByQualifiedName(userId, - OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, - OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, - pathName, - pathNameParameterName, - forLineage, - forDuplicateProcessing, - startingFrom, - pageSize, - effectiveTime, - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME); + + return fileHandler.getBeansByValue(userId, + pathName, + pathNameParameterName, + OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, + OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, + specificMatchPropertyNames, + false, + null, + null, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + startingFrom, + pageSize, + effectiveTime, + methodName); } /** - * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx). + * Retrieve data files by the supplied wildcard name. The wildcard is specified using regular expressions (RegEx) and the method matches on the + * qualifiedName, name and pathName property. * * @param userId calling user * @param name wildcard name @@ -3463,16 +3672,26 @@ public List findDataFilesByName(String userId, UserNotAuthorizedException, PropertyServerException { - return fileHandler.findAssetsByName(userId, - OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, - OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, - name, - nameParameterName, - startingFrom, - pageSize, - forLineage, - forDuplicateProcessing, - effectiveTime, - methodName); + List specificMatchPropertyNames = new ArrayList<>(); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME); + specificMatchPropertyNames.add(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME); + + return fileHandler.getBeansByValue(userId, + name, + nameParameterName, + OpenMetadataAPIMapper.DATA_FILE_TYPE_GUID, + OpenMetadataAPIMapper.DATA_FILE_TYPE_NAME, + specificMatchPropertyNames, + true, + null, + null, + forLineage, + forDuplicateProcessing, + OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, + startingFrom, + pageSize, + effectiveTime, + methodName); } } diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericBuilder.java index e19787a739b..6250c411280 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericBuilder.java @@ -387,7 +387,7 @@ public void setLatestChange(String userId, * @param attachmentTypeName type name of the attached entity * @param relationshipTypeName relationship used to attach the entity * @param userId userId making the change - * @param actionDescription human readable description of the change + * @param actionDescription human-readable description of the change * @param methodName calling method * @return properties for classification * @throws InvalidParameterException problem with the enum types 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 5f764c8f42f..2f45bc8b707 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 @@ -1188,6 +1188,28 @@ protected String removeName(InstanceProperties instanceProperties) } + /** + * Extract and delete the version identifier property from the supplied instance properties. + * + * @param instanceProperties properties from entity + * @return string name or null + */ + protected String removeVersionIdentifier(InstanceProperties instanceProperties) + { + final String methodName = "removeVersionIdentifier"; + + if (instanceProperties != null) + { + return repositoryHelper.removeStringProperty(serviceName, + OpenMetadataAPIMapper.VERSION_IDENTIFIER_PROPERTY_NAME, + instanceProperties, + methodName); + } + + return null; + } + + /** * Extract the description property from the supplied instance properties. * diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java index 3fcba15e7d0..2e1fe27f9b0 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java @@ -5557,6 +5557,12 @@ private TemplateProgress createBeanFromTemplate(String us propertyBuilder.setAnchors(userId, templateProgress.beanAnchorGUID, methodName); } + /* + * Set the properties and classifications from the template entity as the default properties. + */ + propertyBuilder.setTemplateProperties(templateEntity.getProperties()); + propertyBuilder.setTemplateClassifications(userId, externalSourceGUID, externalSourceName, templateEntity.getClassifications(), methodName); + /* * Verify that the user is permitted to create a new bean. */ 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 12a9dfe6e19..a41cdda6f15 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 @@ -36,11 +36,12 @@ public class OpenMetadataAPIMapper /* Asset */ public static final String NAME_PROPERTY_NAME = "name"; /* from Asset entity */ + public static final String VERSION_IDENTIFIER_PROPERTY_NAME = "versionIdentifier"; /* from Asset entity */ public static final String FORMULA_PROPERTY_NAME = "formula"; /* from Process entity */ public static final String IS_PUBLIC_PROPERTY_NAME = "isPublic"; /* from feedback relationships - Area 1 */ public static final String DISPLAY_NAME_PROPERTY_NAME = "displayName"; /* from many entities */ - public static final String DESCRIPTION_PROPERTY_NAME = "description"; /* from many entity */ + public static final String DESCRIPTION_PROPERTY_NAME = "description"; /* from many entities */ public static final String ANCHORS_CLASSIFICATION_TYPE_GUID = "aa44f302-2e43-4669-a1e7-edaae414fc6e"; public static final String ANCHORS_CLASSIFICATION_TYPE_NAME = "Anchors"; @@ -979,6 +980,7 @@ public class OpenMetadataAPIMapper /* DataStore */ public static final String FILE_TYPE_PROPERTY_NAME = "fileType"; /* from DataFile entity */ + public static final String FILE_NAME_PROPERTY_NAME = "fileName"; /* from DataFile entity */ public static final String MEDIA_FILE_TYPE_GUID = "c5ce5499-9582-42ea-936c-9771fbd475f8"; /* from Area 2 */ public static final String MEDIA_FILE_TYPE_NAME = "MediaFile"; diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessBuilder.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessBuilder.java index 2f626d4876e..5a71a7a0d4b 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessBuilder.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessBuilder.java @@ -45,6 +45,7 @@ public class ProcessBuilder extends AssetBuilder * * @param qualifiedName unique name * @param technicalName new value for the name + * @param versionIdentifier new value for the versionIdentifier * @param technicalDescription new description for the process * @param formula description of the logic that is implemented by this process * @param implementationLanguage language used to implement this process (DeployedSoftwareComponent and subtypes only) @@ -58,6 +59,7 @@ public class ProcessBuilder extends AssetBuilder */ ProcessBuilder(String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, String formula, String implementationLanguage, @@ -71,6 +73,7 @@ public class ProcessBuilder extends AssetBuilder { super(qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, typeGUID, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessHandler.java index d7a8a9d34dd..879681ccd2f 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ProcessHandler.java @@ -153,8 +153,9 @@ public ProcessHandler(OpenMetadataAPIGenericConverter converter * @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 this asset - * @param technicalName the stored display name property for the asset - * @param technicalDescription the stored description property associated with the asset + * @param technicalName the stored name property for the process + * @param versionIdentifier the stored version identifier property for the process + * @param technicalDescription the stored description property associated with the process * @param formula the formula that characterize the processing behavior of the process * @param implementationLanguage the implementation language used to create the process * @param additionalProperties any arbitrary properties not part of the type system @@ -177,6 +178,7 @@ public String createProcess(String userId, String externalSourceName, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, String formula, String implementationLanguage, @@ -231,6 +233,7 @@ public String createProcess(String userId, externalSourceName, qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, typeName, @@ -253,8 +256,9 @@ public String createProcess(String userId, * @param templateGUIDParameterName parameter supplying templateGUID * @param qualifiedName unique name for the term - used in other configuration * @param qualifiedNameParameterName parameter supplying qualifiedName - * @param displayName short display name for the term - * @param description description of the term + * @param technicalName short name for the process + * @param versionIdentifier version identifier for the process + * @param description description of the process * @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) @@ -273,7 +277,8 @@ public String createProcessFromTemplate(String userId, String templateGUIDParameterName, String qualifiedName, String qualifiedNameParameterName, - String displayName, + String technicalName, + String versionIdentifier, String description, boolean forLineage, boolean forDuplicateProcessing, @@ -291,9 +296,11 @@ public String createProcessFromTemplate(String userId, OpenMetadataAPIMapper.PROCESS_TYPE_NAME, qualifiedName, qualifiedNameParameterName, - displayName, + technicalName, + versionIdentifier, description, null, + null, forLineage, forDuplicateProcessing, effectiveTime, @@ -311,13 +318,16 @@ public String createProcessFromTemplate(String userId, * @param processGUIDParameterName unique identifier of the process in the external process manager * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? * @param qualifiedName unique name for this asset - * @param technicalName the stored display name property for the asset - * @param technicalDescription the stored description property associated with the asset + * @param technicalName the stored name property for the process + * @param versionIdentifier version identifier for the process + * @param technicalDescription the stored description property associated with the process * @param formula the formula that characterize the processing behavior of the process * @param implementationLanguage the implementation language used to create the process * @param additionalProperties any arbitrary properties not part of the type system * @param suppliedTypeName name of the type that is a subtype of asset - or null to create standard type * @param suppliedExtendedProperties properties from any subtype + * @param effectiveFrom time when this process becomes visible to queries - null for any time + * @param effectiveTo time when this process stops being visible to queries - null for never * @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) @@ -335,12 +345,15 @@ public void updateProcess(String userId, boolean isMergeUpdate, String qualifiedName, String technicalName, + String versionIdentifier, String technicalDescription, String formula, String implementationLanguage, Map additionalProperties, String suppliedTypeName, Map suppliedExtendedProperties, + Date effectiveFrom, + Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, @@ -390,14 +403,15 @@ public void updateProcess(String userId, processGUIDParameterName, qualifiedName, technicalName, + versionIdentifier, technicalDescription, additionalProperties, typeGUID, typeName, supportedZones, extendedProperties, - null, - null, + effectiveFrom, + effectiveTo, isMergeUpdate, forLineage, forDuplicateProcessing, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java index c692d2e72dc..78a8b5fe846 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/RelationalDataHandler.java @@ -195,7 +195,8 @@ public RelationalDataHandler(OpenMetadataAPIGenericConverter databaseC * @param databaseManagerGUID unique identifier of software server capability representing the DBMS * @param databaseManagerName unique name of software server capability representing the DBMS * @param qualifiedName unique name for this database - * @param displayName the stored display name property for the database + * @param technicalName the stored name property for the database + * @param versionIdentifier version identifier for the database * @param description the stored description property associated with the database * @param owner identifier of the owner * @param ownerTypeOrdinal is the owner identifier a user id, personal profile or team profile @@ -235,7 +236,8 @@ public String createDatabase(String userId, String databaseManagerGUID, String databaseManagerName, String qualifiedName, - String displayName, + String technicalName, + String versionIdentifier, String description, String owner, int ownerTypeOrdinal, @@ -316,7 +318,8 @@ public String createDatabase(String userId, databaseManagerGUID, databaseManagerName, qualifiedName, - displayName, + technicalName, + versionIdentifier, description, zoneMembership, owner, @@ -409,9 +412,10 @@ public String createDatabase(String userId, * @param databaseManagerGUID unique identifier of software capability representing the DBMS * @param databaseManagerName unique name of software capability representing the DBMS * @param qualifiedName unique name for this database - * @param displayName the stored display name property for the database + * @param name the stored name property for the database + * @param versionIdentifier the stored version property for the database * @param description the stored description property associated with the database - * @param pathName the fully qualified physical location of the data store + * @param pathName the fully qualified physical location of the database * @param createTime the time that the database was created * @param modifiedTime the last known time the data store was modified * @param encodingType the name of the encoding style used in the database @@ -443,7 +447,8 @@ public String createDatabase(String userId, String databaseManagerGUID, String databaseManagerName, String qualifiedName, - String displayName, + String name, + String versionIdentifier, String description, String pathName, Date createTime, @@ -513,7 +518,8 @@ public String createDatabase(String userId, databaseManagerGUID, databaseManagerName, qualifiedName, - displayName, + name, + versionIdentifier, description, additionalProperties, assetTypeName, @@ -600,8 +606,10 @@ public String createDatabase(String userId, * @param databaseManagerName unique name of software capability representing the DBMS * @param templateGUID unique identifier of the metadata element to copy * @param qualifiedName unique name for this database - must not be null - * @param displayName the stored display name property for the database - if null, the value from the template is used + * @param technicalName the stored name property for the database - if null, the value from the template is used + * @param versionIdentifier version identifier property for the database - if null, the value from the template is used * @param description the stored description property associated with the database - if null, the value from the template is used + * @param pathName the fully qualified physical location of the data store * @param networkAddress physical location of the database - used to connect to it * @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 @@ -619,8 +627,10 @@ public String createDatabaseFromTemplate(String userId, String databaseManagerName, String templateGUID, String qualifiedName, - String displayName, + String technicalName, + String versionIdentifier, String description, + String pathName, String networkAddress, boolean forLineage, boolean forDuplicateProcessing, @@ -645,8 +655,10 @@ public String createDatabaseFromTemplate(String userId, OpenMetadataAPIMapper.DATABASE_TYPE_NAME, qualifiedName, qualifiedNameParameterName, - displayName, + technicalName, + versionIdentifier, description, + pathName, networkAddress, forLineage, forDuplicateProcessing, @@ -663,7 +675,7 @@ public String createDatabaseFromTemplate(String userId, * @param databaseManagerName unique name of software capability representing the DBMS * @param databaseGUID unique identifier of the metadata element to update * @param qualifiedName unique name for this database - * @param displayName the stored display name property for the database + * @param technicalName the stored name property for the database * @param description the stored description property associated with the database * @param owner identifier of the owner * @param ownerTypeOrdinal is the owner identifier a user id, personal profile or team profile @@ -702,7 +714,7 @@ public void updateDatabase(String userId, String databaseManagerName, String databaseGUID, String qualifiedName, - String displayName, + String technicalName, String description, String owner, int ownerTypeOrdinal, @@ -741,8 +753,10 @@ public void updateDatabase(String userId, databaseManagerName, databaseGUID, qualifiedName, - displayName, + technicalName, + null, description, + null, createTime, modifiedTime, encodingType, @@ -874,8 +888,10 @@ public void updateGovernanceClassifications(String userId, * @param databaseManagerName unique name of software capability representing the DBMS * @param databaseGUID unique identifier of the metadata element to update * @param qualifiedName unique name for this database - * @param displayName the stored display name property for the database + * @param technicalName the stored name property for the database + * @param versionIdentifier the stored version identifier for the database * @param description the stored description property associated with the database + * @param pathName the fully qualified physical location of the database * @param createTime the time that the database was created * @param modifiedTime the last known time the data store was modified * @param encodingType the name of the encoding style used in the database @@ -907,8 +923,10 @@ public void updateDatabase(String userId, String databaseManagerName, String databaseGUID, String qualifiedName, - String displayName, + String technicalName, + String versionIdentifier, String description, + String pathName, Date createTime, Date modifiedTime, String encodingType, @@ -959,6 +977,7 @@ public void updateDatabase(String userId, assetExtendedProperties.putAll(extendedProperties); } + assetExtendedProperties.put(OpenMetadataAPIMapper.PATH_NAME_PROPERTY_NAME, pathName); assetExtendedProperties.put(OpenMetadataAPIMapper.STORE_CREATE_TIME_PROPERTY_NAME, createTime); assetExtendedProperties.put(OpenMetadataAPIMapper.STORE_UPDATE_TIME_PROPERTY_NAME, modifiedTime); @@ -973,7 +992,8 @@ public void updateDatabase(String userId, databaseGUID, elementGUIDParameterName, qualifiedName, - displayName, + technicalName, + versionIdentifier, description, additionalProperties, assetTypeId, @@ -1461,8 +1481,9 @@ public DATABASE getDatabaseByGUID(String userId, * @param databaseManagerName unique name of software capability representing the DBMS * @param databaseGUID unique identifier of the database where the schema is located * @param qualifiedName unique name for this database schema - * @param displayName the stored display name property for the database schema - * @param description the stored description property associated with the database schema + * @param technicalName the stored name property for the database schema + * @param versionIdentifier versionIdentifier property + * @param technicalDescription the stored description property associated with the database schema * @param additionalProperties any arbitrary properties not part of the type system * @param typeName name of the type that is a subtype of DeployedDatabaseSchema - or null to create standard type * @param extendedProperties properties from any subtype @@ -1485,8 +1506,9 @@ public String createDatabaseSchema(String userId, String databaseManagerName, String databaseGUID, String qualifiedName, - String displayName, - String description, + String technicalName, + String versionIdentifier, + String technicalDescription, Map additionalProperties, String typeName, Map extendedProperties, @@ -1535,8 +1557,9 @@ public String createDatabaseSchema(String userId, databaseManagerGUID, databaseManagerName, qualifiedName, - displayName, - description, + technicalName, + versionIdentifier, + technicalDescription, additionalProperties, assetTypeName, extendedProperties, @@ -1594,8 +1617,9 @@ public String createDatabaseSchema(String userId, * @param databaseManagerName unique name of software capability representing the DBMS * @param databaseGUID unique identifier of the database where the schema is located * @param qualifiedName unique name for this database schema - * @param displayName the stored display name property for the database schema - * @param description the stored description property associated with the database schema + * @param technicalName the stored name property for the database schema + * @param versionIdentifier the stored versionIdentifier property for the database schema + * @param technicalDescription the stored description property associated with the database schema * @param owner identifier of the owner * @param ownerTypeOrdinal is the owner identifier a user id, personal profile or team profile * @param zoneMembership governance zones for the database schema - null means use the default zones set for this service @@ -1624,8 +1648,9 @@ public String createDatabaseSchema(String userId, String databaseManagerName, String databaseGUID, String qualifiedName, - String displayName, - String description, + String technicalName, + String versionIdentifier, + String technicalDescription, String owner, int ownerTypeOrdinal, List zoneMembership, @@ -1680,8 +1705,9 @@ public String createDatabaseSchema(String userId, databaseManagerGUID, databaseManagerName, qualifiedName, - displayName, - description, + technicalName, + versionIdentifier, + technicalDescription, zoneMembership, owner, ownerTypeOrdinal, @@ -1747,8 +1773,9 @@ public String createDatabaseSchema(String userId, * @param templateGUID unique identifier of the metadata element to copy * @param databaseGUID unique identifier of the database where the schema is located * @param qualifiedName unique name for the database schema - * @param displayName the stored display name property for the database schema - * @param description the stored description property associated with the database schema + * @param technicalName the stored name property for the database schema + * @param versionIdentifier the stored versionIdentifier property for the database schema + * @param technicalDescription the stored description property associated with the database schema * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned @@ -1768,8 +1795,9 @@ public String createDatabaseSchemaFromTemplate(String userId, String templateGUID, String databaseGUID, String qualifiedName, - String displayName, - String description, + String technicalName, + String versionIdentifier, + String technicalDescription, Date effectiveFrom, Date effectiveTo, boolean forLineage, @@ -1797,8 +1825,10 @@ public String createDatabaseSchemaFromTemplate(String userId, OpenMetadataAPIMapper.DEPLOYED_DATABASE_SCHEMA_TYPE_NAME, qualifiedName, qualifiedNameParameterName, - displayName, - description, + technicalName, + versionIdentifier, + technicalDescription, + null, null, forLineage, forDuplicateProcessing, @@ -1842,7 +1872,8 @@ public String createDatabaseSchemaFromTemplate(String userId, * @param databaseManagerName unique name of software capability representing the DBMS * @param databaseSchemaGUID unique identifier of the metadata element to update * @param qualifiedName unique name for the database schema - * @param displayName the stored display name property for the database schema + * @param technicalName the stored name property for the database schema + * @param versionIdentifier the stored versionIdentifier property for the database schema * @param description the stored description property associated with the database schema * @param owner identifier of the owner * @param ownerTypeOrdinal is the owner identifier a user id, personal profile or team profile @@ -1871,7 +1902,8 @@ public void updateDatabaseSchema(String userId, String databaseManagerName, String databaseSchemaGUID, String qualifiedName, - String displayName, + String technicalName, + String versionIdentifier, String description, String owner, int ownerTypeOrdinal, @@ -1919,7 +1951,8 @@ public void updateDatabaseSchema(String userId, databaseSchemaGUID, elementGUIDParameterName, qualifiedName, - displayName, + technicalName, + versionIdentifier, description, additionalProperties, assetTypeId, @@ -1988,7 +2021,7 @@ public void publishDatabaseSchema(String userId, UserNotAuthorizedException, PropertyServerException { - final String elementGUIDParameterName = "databaseSchemaGUID"; + final String elementGUIDParameterName = "databaseSchemaGUID"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(databaseSchemaGUID, elementGUIDParameterName, methodName); @@ -2727,7 +2760,7 @@ public String createDatabaseTableForSchemaType(String userId, * @param templateGUID unique identifier of the metadata element to copy * @param databaseAssetGUID unique identifier of the database or database schema where the database table is located. * @param qualifiedName unique name for the database schema - * @param displayName the stored display name property for the database table + * @param technicalName the stored name property for the database table * @param description the stored description property associated with the database table * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) @@ -2748,7 +2781,7 @@ public String createDatabaseTableFromTemplate(String userId, String templateGUID, String databaseAssetGUID, String qualifiedName, - String displayName, + String technicalName, String description, Date effectiveFrom, Date effectiveTo, @@ -2790,7 +2823,7 @@ public String createDatabaseTableFromTemplate(String userId, if (databaseSchemaTypeGUID != null) { SchemaAttributeBuilder builder = new SchemaAttributeBuilder(qualifiedName, - displayName, + technicalName, description, repositoryHelper, serviceName, diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/AssetConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/AssetConverter.java index 2b294f8efff..705c652ba74 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/AssetConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/AssetConverter.java @@ -73,7 +73,8 @@ public B getNewBean(Class beanClass, bean.setQualifiedName(this.removeQualifiedName(instanceProperties)); bean.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - bean.setDisplayName(this.removeName(instanceProperties)); + bean.setName(this.removeName(instanceProperties)); + bean.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); bean.setDescription(this.removeDescription(instanceProperties)); /* Note this value should be in the classification */ diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java index d4d74c7a1bd..db978c66703 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-server/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/server/converters/RelatedAssetConverter.java @@ -99,7 +99,8 @@ public B getNewBean(Class beanClass, bean.setQualifiedName(this.removeQualifiedName(instanceProperties)); bean.setAdditionalProperties(this.removeAdditionalProperties(instanceProperties)); - bean.setDisplayName(this.removeName(instanceProperties)); + bean.setName(this.removeName(instanceProperties)); + bean.setVersionIdentifier(this.removeVersionIdentifier(instanceProperties)); bean.setDescription(this.removeDescription(instanceProperties)); /* Note this value should be in the classification */ diff --git a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/PrimitiveTypePropertyValue.java b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/PrimitiveTypePropertyValue.java index 9194059bdca..74aa558a017 100644 --- a/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/PrimitiveTypePropertyValue.java +++ b/open-metadata-implementation/frameworks/governance-action-framework/src/main/java/org/odpi/openmetadata/frameworks/governanceaction/search/PrimitiveTypePropertyValue.java @@ -269,7 +269,7 @@ else if (primitiveTypeCategory == PrimitiveTypeCategory.OM_PRIMITIVE_TYPE_BYTE) { Integer castValue = (Integer)primitiveValue; - return new Byte(castValue.toString()); + return castValue.toString(); } else if (primitiveTypeCategory == PrimitiveTypeCategory.OM_PRIMITIVE_TYPE_CHAR) { @@ -281,19 +281,19 @@ else if (primitiveTypeCategory == PrimitiveTypeCategory.OM_PRIMITIVE_TYPE_FLOAT) { Double castValue = (Double)primitiveValue; - return new Float(castValue); + return castValue; } else if (primitiveTypeCategory == PrimitiveTypeCategory.OM_PRIMITIVE_TYPE_LONG) { Integer castValue = (Integer)primitiveValue; - return new Long(castValue); + return castValue; } else if (primitiveTypeCategory == PrimitiveTypeCategory.OM_PRIMITIVE_TYPE_SHORT) { Integer castValue = (Integer)primitiveValue; - return new Short(castValue.toString()); + return castValue.toString(); } else { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Asset.java b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Asset.java index fd45400652a..80075399df3 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Asset.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/main/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/Asset.java @@ -56,6 +56,8 @@ public class Asset extends GovernedReferenceable { private static final long serialVersionUID = 1L; + protected String name = null; + protected String versionIdentifier = null; protected String displayName = null; protected String shortDescription = null; protected String description = null; @@ -87,6 +89,8 @@ public Asset(Asset template) if (template != null) { + name = template.getName(); + versionIdentifier = template.getVersionIdentifier(); displayName = template.getDisplayName(); shortDescription = template.getShortDescription(); description = template.getDescription(); @@ -101,14 +105,63 @@ public Asset(Asset template) } + /** + * Return the name of the resource that this asset represents. + * + * @return string resource name + */ + public String getName() + { + return name; + } + + + /** + * Set up the name of the resource that this asset represents. + * + * @param name string resource name + */ + public void setName(String name) + { + this.name = name; + } + + + /** + * Set up the version identifier of the resource. + * + * @return string version name + */ + public String getVersionIdentifier() + { + return versionIdentifier; + } + + + /** + * Set up the version identifier of the resource. + * + * @param versionIdentifier string version name + */ + public void setVersionIdentifier(String versionIdentifier) + { + this.versionIdentifier = versionIdentifier; + } + + /** * Returns the stored display name property for the asset. - * If no display name is available then null is returned. + * If no display name is available then name is returned. * * @return String name */ public String getDisplayName() { + if (displayName == null) + { + return name; + } + return displayName; } @@ -353,25 +406,52 @@ public void setReferenceData(boolean referenceData) public String toString() { return "Asset{" + - "displayName='" + displayName + '\'' + + "name='" + name + '\'' + + ", versionIdentifier='" + versionIdentifier + '\'' + + ", displayName='" + displayName + '\'' + ", shortDescription='" + shortDescription + '\'' + ", description='" + description + '\'' + ", owner='" + owner + '\'' + + ", ownerTypeName='" + ownerTypeName + '\'' + + ", ownerPropertyName='" + ownerPropertyName + '\'' + ", ownerType=" + ownerType + - ", ownerTypeName=" + ownerTypeName + - ", ownerPropertyName=" + ownerPropertyName+ ", zoneMembership=" + zoneMembership + ", origin=" + origin + - ", latestChange='" + latestChange + '\'' + - ", qualifiedName='" + getQualifiedName() + '\'' + - ", additionalProperties=" + getAdditionalProperties() + - ", meanings=" + getMeanings() + + ", isReferenceData=" + isReferenceData + + ", assetOrigin=" + getAssetOrigin() + + ", referenceData=" + isReferenceData() + + ", url='" + url + '\'' + + ", extendedProperties=" + extendedProperties + + ", URL='" + getURL() + '\'' + + ", extendedProperties=" + getExtendedProperties() + + ", status=" + getStatus() + ", type=" + getType() + + ", versions=" + getVersions() + ", GUID='" + getGUID() + '\'' + - ", URL='" + getURL() + '\'' + ", classifications=" + getClassifications() + - ", extendedProperties=" + getExtendedProperties() + + ", meanings=" + meanings + + ", securityTags=" + securityTags + + ", searchKeywords=" + searchKeywords + + ", latestChange='" + latestChange + '\'' + + ", latestChangeDetails=" + latestChangeDetails + + ", confidentialityGovernanceClassification=" + confidentialityGovernanceClassification + + ", confidenceGovernanceClassification=" + confidenceGovernanceClassification + + ", criticalityGovernanceClassification=" + criticalityGovernanceClassification + + ", retentionGovernanceClassification=" + retentionGovernanceClassification + + ", meanings=" + getMeanings() + + ", securityTags=" + getSecurityTags() + + ", searchKeywords=" + getSearchKeywords() + + ", latestChange='" + getLatestChange() + '\'' + + ", latestChangeDetails=" + getLatestChangeDetails() + + ", confidentialityGovernanceClassification=" + getConfidentialityGovernanceClassification() + + ", confidenceGovernanceClassification=" + getConfidenceGovernanceClassification() + + ", criticalityGovernanceClassification=" + getCriticalityGovernanceClassification() + + ", retentionGovernanceClassification=" + getRetentionGovernanceClassification() + ", headerVersion=" + getHeaderVersion() + + ", qualifiedName='" + qualifiedName + '\'' + + ", additionalProperties=" + additionalProperties + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", additionalProperties=" + getAdditionalProperties() + '}'; } @@ -389,25 +469,20 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof Asset)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } Asset asset = (Asset) objectToCompare; - return isReferenceData == asset.isReferenceData && - Objects.equals(displayName, asset.displayName) && - Objects.equals(shortDescription, asset.shortDescription) && - Objects.equals(description, asset.description) && - Objects.equals(owner, asset.owner) && - Objects.equals(ownerTypeName, asset.ownerTypeName) && - Objects.equals(ownerPropertyName, asset.ownerPropertyName) && - ownerType == asset.ownerType && - Objects.equals(zoneMembership, asset.zoneMembership) && - Objects.equals(origin, asset.origin); + return isReferenceData == asset.isReferenceData && Objects.equals(name, asset.name) && Objects.equals(versionIdentifier, asset.versionIdentifier) && Objects.equals( + displayName, asset.displayName) && Objects.equals(shortDescription, asset.shortDescription) && Objects.equals( + description, asset.description) && Objects.equals(owner, asset.owner) && Objects.equals(ownerTypeName, asset.ownerTypeName) && Objects.equals( + ownerPropertyName, asset.ownerPropertyName) && ownerType == asset.ownerType && Objects.equals(zoneMembership, asset.zoneMembership) && Objects.equals( + origin, asset.origin); } @@ -419,7 +494,7 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), displayName, shortDescription, description, owner, ownerTypeName, ownerPropertyName, ownerType, - zoneMembership, origin, isReferenceData); + return Objects.hash(super.hashCode(), name, versionIdentifier, displayName, shortDescription, description, owner, ownerTypeName, + ownerPropertyName, ownerType, zoneMembership, origin, isReferenceData); } } \ No newline at end of file diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetSummary.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetSummary.java index 0978837e435..e990fae5d9c 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetSummary.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/TestAssetSummary.java @@ -203,7 +203,7 @@ private void validateNullObject(AssetSummary nullObject) Map propertyMap = new HashMap<>(); propertyMap.put("property1", "TestString"); - propertyMap.put("property2", new Integer(2)); + propertyMap.put("property2", 2); Asset assetBean = new Asset(); assetBean.setExtendedProperties(propertyMap); @@ -220,7 +220,7 @@ private void validateNullObject(AssetSummary nullObject) propertyName = iterator.next(); assertTrue(propertyName.equals("property2")); - assertTrue(assetProperties.get(propertyName).equals(new Integer(2))); + assertTrue(assetProperties.get(propertyName).equals(2)); propertyName = iterator.next(); assertTrue(propertyName.equals("property1")); diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestCommentType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestCommentType.java index 07e2c496363..026b29ca9d2 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestCommentType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestCommentType.java @@ -27,7 +27,7 @@ public class TestCommentType */ private boolean isUniqueOrdinal(int ordinal) { - Integer newOrdinal = new Integer(ordinal); + Integer newOrdinal = ordinal; if (existingOrdinals.contains(newOrdinal)) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestKeyPattern.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestKeyPattern.java index b672fc5399f..d52518379a0 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestKeyPattern.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestKeyPattern.java @@ -27,7 +27,7 @@ public class TestKeyPattern */ private boolean isUniqueOrdinal(int ordinal) { - Integer newOrdinal = new Integer(ordinal); + Integer newOrdinal = ordinal; if (existingOrdinals.contains(newOrdinal)) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaType.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaType.java index 1a48b01ce1f..7855542f962 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaType.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaType.java @@ -27,7 +27,7 @@ public class TestRelatedMediaType */ private boolean isUniqueOrdinal(int ordinal) { - Integer newOrdinal = new Integer(ordinal); + Integer newOrdinal = ordinal; if (existingOrdinals.contains(newOrdinal)) { diff --git a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaUsage.java b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaUsage.java index 15d6322c13c..8350478dfac 100644 --- a/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaUsage.java +++ b/open-metadata-implementation/frameworks/open-connector-framework/src/test/java/org/odpi/openmetadata/frameworks/connectors/properties/beans/TestRelatedMediaUsage.java @@ -27,7 +27,7 @@ public class TestRelatedMediaUsage */ private boolean isUniqueOrdinal(int ordinal) { - Integer newOrdinal = new Integer(ordinal); + Integer newOrdinal = ordinal; if (existingOrdinals.contains(newOrdinal)) { 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 6c6781544fa..2541811edc5 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 @@ -162,8 +162,11 @@ public void getOriginalTypes() /* * Calls for new and changed types go here */ + update0010BaseModel(); update0022Translations(); addArea1Actors(); + add0222DataFilesAndFolders(); + add0223DataFeed(); add0430ServiceLevelObjectives(); update0481Licenses(); add0483TermsAndConditions(); @@ -173,6 +176,47 @@ public void getOriginalTypes() update0715DigitalServiceOwnership(); } + /* + * ------------------------------------------------------------------------------------------------------- + */ + + private void update0010BaseModel() + { + this.archiveBuilder.addTypeDefPatch(updateAsset()); + } + + + private TypeDefPatch updateAsset() + { + /* + * Create the Patch + */ + final String typeName = "Asset"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "versionIdentifier"; + final String attribute1Description = "Version identifier to allow different versions of the same resource to appear in the catalog as separate assets."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } /* * ------------------------------------------------------------------------------------------------------- @@ -446,6 +490,96 @@ private TypeDefPatch updateCrowdSourcingContribution() } + /* + * ------------------------------------------------------------------------------------------------------- + */ + + + private void add0222DataFilesAndFolders() + { + this.archiveBuilder.addEntityDef(getParquetFileEntity()); + this.archiveBuilder.addTypeDefPatch(updateDataFileEntity()); + } + + + private TypeDefPatch updateDataFileEntity() + { + /* + * Create the Patch + */ + final String typeName = "DataFile"; + + TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName); + + typeDefPatch.setUpdatedBy(originatorName); + typeDefPatch.setUpdateTime(creationDate); + + /* + * Build the attributes + */ + List properties = new ArrayList<>(); + TypeDefAttribute property; + + final String attribute1Name = "fileName"; + final String attribute1Description = "The name of the file with extension."; + final String attribute1DescriptionGUID = null; + + property = archiveHelper.getStringTypeDefAttribute(attribute1Name, + attribute1Description, + attribute1DescriptionGUID); + properties.add(property); + + typeDefPatch.setPropertyDefinitions(properties); + + return typeDefPatch; + } + + + + private EntityDef getParquetFileEntity() + { + final String guid = "97cba3a0-1dfd-4129-82b6-798de3eec0a4"; + final String name = "ParquetFile"; + final String description = "A data file which is formatted using the Apache Parquet format."; + final String descriptionGUID = null; + + final String superTypeName = "DataFile"; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + } + + + /* + * ------------------------------------------------------------------------------------------------------- + */ + + + private void add0223DataFeed() + { + this.archiveBuilder.addEntityDef(getDataFeedEntity()); + + } + + private EntityDef getDataFeedEntity() + { + final String guid = "e87836ad-f8bd-4c52-aecd-0f1872c692e5"; + final String name = "DataFeed"; + final String description = "A data source that provides a constant stream of data, such as a sensor monitoring the environment."; + final String descriptionGUID = null; + + final String superTypeName = "Asset"; + + return archiveHelper.getDefaultEntityDef(guid, + name, + this.archiveBuilder.getEntityDef(superTypeName), + description, + descriptionGUID); + } + /* * ------------------------------------------------------------------------------------------------------- diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java index 1bea6545bde..3b76e852056 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java @@ -451,8 +451,8 @@ else if (topicList.size() != 1) * @throws FVTUnexpectedCondition the test case failed */ private String getTopic(EventBrokerClient client, - String eventBrokerGUID, - String userId) throws FVTUnexpectedCondition + String eventBrokerGUID, + String userId) throws FVTUnexpectedCondition { final String activityName = "getTopic"; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/discovery-engine-fvt/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/fvt/discovery/CreateDiscoveryReportTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/discovery-engine-fvt/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/fvt/discovery/CreateDiscoveryReportTest.java index 13073e33af2..a90b4c0dd26 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/discovery-engine-fvt/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/fvt/discovery/CreateDiscoveryReportTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/discovery-engine-fvt/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/fvt/discovery/CreateDiscoveryReportTest.java @@ -12,7 +12,6 @@ import org.odpi.openmetadata.accessservices.discoveryengine.client.rest.ODFRESTClient; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.frameworks.discovery.DiscoveryAnalysisReportStore; import org.odpi.openmetadata.frameworks.discovery.properties.DiscoveryRequestStatus; import org.odpi.openmetadata.fvt.utilities.FVTResults; import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/stewardship-action-fvt/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/fvt/duplicateprocessing/DuplicateAssetTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/stewardship-action-fvt/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/fvt/duplicateprocessing/DuplicateAssetTest.java index 12b22acd88d..40626f1fe6c 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/stewardship-action-fvt/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/fvt/duplicateprocessing/DuplicateAssetTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/stewardship-action-fvt/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/fvt/duplicateprocessing/DuplicateAssetTest.java @@ -12,17 +12,12 @@ import org.odpi.openmetadata.accessservices.stewardshipaction.client.StewardshipAction; import org.odpi.openmetadata.accessservices.stewardshipaction.client.rest.StewardshipActionRESTClient; import org.odpi.openmetadata.accessservices.stewardshipaction.metadataelements.AssetElement; -import org.odpi.openmetadata.accessservices.stewardshipaction.properties.PrimitiveSchemaTypeProperties; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; 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; - /** * CreateAssetTest calls the StewardshipActionClient to create an asset with with attachments diff --git a/settings.gradle b/settings.gradle index f9cc83d67f6..2a44d03092b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -195,6 +195,7 @@ include(':open-metadata-implementation:access-services:digital-architecture:digi include(':open-metadata-implementation:access-services:digital-architecture:digital-architecture-spring') include(':open-metadata-implementation:access-services:digital-architecture') include(':open-metadata-implementation:access-services:digital-service:digital-service-api') +include(':open-metadata-implementation:access-services:digital-service:digital-service-client') include(':open-metadata-implementation:access-services:digital-service:digital-service-server') include(':open-metadata-implementation:access-services:digital-service:digital-service-spring') include(':open-metadata-implementation:access-services:digital-service') @@ -599,6 +600,7 @@ project(':open-metadata-implementation:access-services:digital-architecture:digi project(':open-metadata-implementation:access-services:digital-architecture:digital-architecture-spring').projectDir = file('open-metadata-implementation/access-services/digital-architecture/digital-architecture-spring') project(':open-metadata-implementation:access-services:digital-architecture').projectDir = file('open-metadata-implementation/access-services/digital-architecture') project(':open-metadata-implementation:access-services:digital-service:digital-service-api').projectDir = file('open-metadata-implementation/access-services/digital-service/digital-service-api') +project(':open-metadata-implementation:access-services:digital-service:digital-service-client').projectDir = file('open-metadata-implementation/access-services/digital-service/digital-service-client') project(':open-metadata-implementation:access-services:digital-service:digital-service-server').projectDir = file('open-metadata-implementation/access-services/digital-service/digital-service-server') project(':open-metadata-implementation:access-services:digital-service:digital-service-spring').projectDir = file('open-metadata-implementation/access-services/digital-service/digital-service-spring') project(':open-metadata-implementation:access-services:digital-service').projectDir = file('open-metadata-implementation/access-services/digital-service')