Class BitolGeneratorBase
java.lang.Object
org.odpi.openmetadata.frameworks.integration.bitol.mapping.BitolGeneratorBase
- Direct Known Subclasses:
DataContractGenerator,DataProductGenerator
BitolGeneratorBase holds the logic shared by the generators that build Open Data Contract Standard (ODCS) and Open
Data Product Standard (ODPS) documents from open metadata: the reverse of BitolMapperBase. It reads the
fundamentals, tags, custom properties, authoritative definitions, support channels and team from an element and its
related elements. Values that the cataloguers kept in additional properties under the "bitol." prefix are read
back so that a document catalogued by Egeria regenerates faithfully; elements created directly in Egeria produce a
document from their native properties.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConnectorContextBaseprotected final PropertyHelper -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBitolGeneratorBase(ConnectorContextBase context) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static List<BitolCustomProperty> addEgeriaProperty(List<BitolCustomProperty> customProperties, String name, Object value, String description) Add a custom property attributed to Egeria to a list of custom properties.protected voidfillFundamentals(OpenMetadataRootElement element, BitolDocument document) Fill the fundamentals of a document from the properties of the element that represents it.protected static <T> TParse a JSON fragment kept in an additional property by the cataloguer.protected static <T> List<T> fromJSONList(String json, Class<T> type) Parse a JSON fragment holding a list, kept in an additional property by the cataloguer.protected List<BitolAuthoritativeDefinition> Return the external references of an element as authoritative definitions.protected static StringgetBitolValue(Map<String, String> additionalProperties, String name) Return a value stored by the cataloguers under the bitol prefix.protected static BitolContextgetContext(Map<String, String> additionalProperties) Return the AI context kept as JSON on an element.protected static List<BitolCustomProperty> getCustomProperties(Map<String, String> additionalProperties) Return the additional properties that are not bitol bookkeeping as custom properties.protected static BooleangetDeprecated(Map<String, String> additionalProperties) Return whether an element was recorded as deprecated.protected StringgetDisplayName(MetadataElementSummary summary) Return the display name of a summarized element.protected static StringgetGUID(OpenMetadataRootElement element) Return the unique identifier of an element for use in an error message.getRelatedNames(List<RelatedMetadataElementSummary> relatedElements, String typeName) Return the display names of the related elements of a particular type.protected List<BitolSupportChannel> Return the contact details of an element as support channels.protected static List<BitolSynonym> getSynonyms(Map<String, String> additionalProperties) Return the synonyms kept as JSON on an element.getTags(AttributedMetadataElement element) Return the search keywords of an element as tags.protected BitolTeamgetTeam(AttributedMetadataElement element) Return the team and person roles scoped to the element as a Bitol team.protected StringgetTenant(AttributedMetadataElement element) Return the organization that the element is scoped by as the tenant.protected static StringgetTypeName(OpenMetadataRootElement element) Return the type name of an element for use in an error message.
-
Field Details
-
context
-
propertyHelper
-
-
Constructor Details
-
BitolGeneratorBase
Constructor.- Parameters:
context- connector context providing access to the open metadata clients
-
-
Method Details
-
fillFundamentals
Fill the fundamentals of a document from the properties of the element that represents it. The identifier is the element's identifier property, or its GUID when there is none, so that a round trip preserves the original document identifier while an element created in Egeria still gets a stable id.- Parameters:
element- element representing the documentdocument- document to fill
-
getBitolValue
Return a value stored by the cataloguers under the bitol prefix.- Parameters:
additionalProperties- additional properties of the element (may be null)name- name without the prefix- Returns:
- value or null
-
getCustomProperties
protected static List<BitolCustomProperty> getCustomProperties(Map<String, String> additionalProperties) Return the additional properties that are not bitol bookkeeping as custom properties.- Parameters:
additionalProperties- additional properties of the element (may be null)- Returns:
- list of custom properties or null if there are none
-
addEgeriaProperty
protected static List<BitolCustomProperty> addEgeriaProperty(List<BitolCustomProperty> customProperties, String name, Object value, String description) Add a custom property attributed to Egeria to a list of custom properties. This is how the properties of an element that the Bitol standards have no place for are carried in a document; the vendor attribution lets the mapper recognise them when the document is catalogued again.- Parameters:
customProperties- existing list (may be null)name- property namevalue- value - nothing is added if it is null or an empty listdescription- description of the property- Returns:
- list including the new entry (null if the list was null and nothing was added)
-
getRelatedNames
protected List<String> getRelatedNames(List<RelatedMetadataElementSummary> relatedElements, String typeName) Return the display names of the related elements of a particular type.- Parameters:
relatedElements- related elements (may be null)typeName- type to select- Returns:
- list of names (empty if none)
-
getTags
Return the search keywords of an element as tags.- Parameters:
element- element with its related elements- Returns:
- list of tags or null
-
getAuthoritativeDefinitions
protected List<BitolAuthoritativeDefinition> getAuthoritativeDefinitions(AttributedMetadataElement element) Return the external references of an element as authoritative definitions.- Parameters:
element- element with its related elements- Returns:
- list of definitions or null
-
getSupportChannels
Return the contact details of an element as support channels.- Parameters:
element- element with its related elements- Returns:
- list of channels or null
-
getTenant
Return the organization that the element is scoped by as the tenant.- Parameters:
element- element with its related elements- Returns:
- organization name or null
-
getTeam
Return the team and person roles scoped to the element as a Bitol team.- Parameters:
element- element with its related elements- Returns:
- team or null if there is neither a team nor any roles
-
getDisplayName
Return the display name of a summarized element.- Parameters:
summary- element summary- Returns:
- display name, or qualified name, or null
-
getGUID
Return the unique identifier of an element for use in an error message.- Parameters:
element- element (may be null)- Returns:
- guid or "null"
-
getTypeName
Return the type name of an element for use in an error message.- Parameters:
element- element (may be null)- Returns:
- type name or "null"
-
fromJSON
Parse a JSON fragment kept in an additional property by the cataloguer.- Type Parameters:
T- bean type- Parameters:
json- json text (may be null)type- bean type- Returns:
- bean or null if absent or unreadable
-
fromJSONList
Parse a JSON fragment holding a list, kept in an additional property by the cataloguer.- Type Parameters:
T- element type- Parameters:
json- json text (may be null)type- element type- Returns:
- list or null if absent or unreadable
-
getSynonyms
Return the synonyms kept as JSON on an element.- Parameters:
additionalProperties- additional properties of the element- Returns:
- synonyms or null
-
getContext
Return the AI context kept as JSON on an element.- Parameters:
additionalProperties- additional properties of the element- Returns:
- context or null
-
getDeprecated
Return whether an element was recorded as deprecated.- Parameters:
additionalProperties- additional properties of the element- Returns:
- true if deprecated, otherwise null so the flag is omitted from the document
-