Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add versionIdentifier and initial Digital Service OMAS APIs #6986

Merged
merged 5 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 4 additions & 0 deletions open-metadata-distribution/open-metadata-assemblies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@
<groupId>org.odpi.egeria</groupId>
<artifactId>digital-architecture-client</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>digital-service-client</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>discovery-engine-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
<groupId>org.odpi.egeria</groupId>
<artifactId>digital-architecture-client</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>digital-service-client</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>it-infrastructure-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,7 +45,7 @@ List<String> 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
Expand All @@ -67,7 +67,7 @@ List<String> 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).
Expand All @@ -87,7 +87,7 @@ List<String> 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.
Expand All @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@

/**
* 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:
* <ul>
* <li>type - metadata type information for the asset</li>
* <li>guid - globally unique identifier for the asset</li>
* <li>url - external link for the asset</li>
* <li>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)</li>
* <li>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)</li>
* <li>name - the name of the digital resource. (Sourced from attribute name within Asset - model 0010)</li>
* <li>versionIdentifier - the version of the digital resource. (Sourced from attribute versionIdentifier within Asset - model 0010)</li>
* <li>displayName - A consumable name for the asset. (Sourced from a linked glossary term - model 0395 - or the name property)</li>
* <li>shortDescription - short description about the asset.
* (Sourced from assetSummary within ConnectionsToAsset - model 0205)</li>
* (Sourced from assetSummary property within ConnectionsToAsset - model 0205)</li>
* <li>description - full description of the asset.
* (Sourced from attribute description within Asset - model 0010)</li>
* <li>owner - name of the person or organization that owns the asset.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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;
}

Expand Down Expand Up @@ -355,12 +413,14 @@ public void setOtherOriginValues(Map<String, String> 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 + '\'' +
Expand All @@ -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;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public B getNewBean(Class<B> 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 */
Expand Down
Loading