Skip to content

Commit

Permalink
Merge pull request #645 from atlanhq/DVX-481
Browse files Browse the repository at this point in the history
Separates data mesh handling for custom metadata attributes
  • Loading branch information
cmgrote committed May 22, 2024
2 parents c563d7d + b1d2bc2 commit 5d9d09d
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public class AttributeDefOptions extends AtlanObject {
CubeField.TYPE_NAME,
CubeHierarchy.TYPE_NAME,
DataContract.TYPE_NAME,
DataDomain.TYPE_NAME,
DataProduct.TYPE_NAME,
DataStudioAsset.TYPE_NAME,
Database.TYPE_NAME,
DbtColumnProcess.TYPE_NAME,
Expand Down Expand Up @@ -227,6 +225,7 @@ public class AttributeDefOptions extends AtlanObject {
View.TYPE_NAME);
public static final Set<String> ALL_GLOSSARY_TYPES =
Set.of(Glossary.TYPE_NAME, GlossaryTerm.TYPE_NAME, GlossaryCategory.TYPE_NAME);
public static final Set<String> ALL_DOMAIN_TYPES = Set.of(DataDomain.TYPE_NAME, DataProduct.TYPE_NAME);
public static final Set<String> ALL_OTHER_TYPES = Set.of(File.TYPE_NAME);

/**
Expand All @@ -244,6 +243,8 @@ public static AttributeDefOptions of(AtlanCustomAttributePrimitiveType type, Str
.applicableAssetTypes(ALL_ASSET_TYPES)
.applicableGlossaries(Glossary.getAllQualifiedNames())
.applicableGlossaryTypes(ALL_GLOSSARY_TYPES)
.applicableDomains(Set.of("*/super"))
.applicableDomainTypes(ALL_DOMAIN_TYPES)
.applicableOtherAssetTypes(ALL_OTHER_TYPES);
switch (type) {
case USERS:
Expand Down Expand Up @@ -309,6 +310,16 @@ public static AttributeDefOptions of(AtlanCustomAttributePrimitiveType type, Str
@JsonDeserialize(using = StringToSetDeserializer.class)
Set<String> applicableGlossaries;

/**
* Qualified names of domains to which to restrict the attribute.
* Only domains and data products within one of these domains will have this attribute available.
* To further restrict the types of assets within the domains, see {@link #applicableDomainTypes}.
*/
@Singular
@JsonSerialize(using = SetToStringSerializer.class)
@JsonDeserialize(using = StringToSetDeserializer.class)
Set<String> applicableDomains;

/**
* Asset type names to which to restrict the attribute.
* Only assets of one of these types will have this attribute available.
Expand All @@ -331,6 +342,17 @@ public static AttributeDefOptions of(AtlanCustomAttributePrimitiveType type, Str
@JsonProperty("glossaryTypeList")
Set<String> applicableGlossaryTypes;

/**
* Data product type names to which to restrict the attribute.
* These cover asset types in data products and data domains.
* Only assets of one of these types will have this attribute available.
*/
@Singular
@JsonSerialize(using = SetToStringSerializer.class)
@JsonDeserialize(using = StringToSetDeserializer.class)
@JsonProperty("domainTypesList")
Set<String> applicableDomainTypes;

/**
* Any other asset type names to which to restrict the attribute.
* These cover any asset type that is not managed within a connection or a glossary.
Expand Down

0 comments on commit 5d9d09d

Please sign in to comment.