java.lang.Object
org.odpi.openmetadata.frameworks.integration.bitol.mapping.BitolMapperBase
org.odpi.openmetadata.frameworks.integration.bitol.mapping.DataContractMapper

public class DataContractMapper extends BitolMapperBase
DataContractMapper catalogues an Open Data Contract Standard (ODCS) document as an Agreement in open metadata.
  • The document becomes an Agreement classified as a DataSharingAgreement (one element per version, qualifiedName DataContract::{id}::{version}) whose identifier is also recorded as an ExternalId shared by all versions.
  • Each schema object becomes a DataStructure that is an item of the agreement; each property becomes a DataField member of the structure, with nested properties and array items as nested data fields. Primary key, classification and critical data element markers become the PrimaryKey, Confidentiality and Criticality classifications; relationships between properties become LinkedDataField relationships.
  • Each data quality check becomes a DataQualityRule governance control that governs the structure or field.
  • The SLA properties become a ServiceLevelObjective that governs the agreement; the description's limitations and usage become its restrictions and entitlements.
  • Servers become Endpoints listed as resources of the agreement. A SecurityAccessControl governs the agreement and each access role becomes a SecurityRole associated with it, with the access type as the operation name.
  • The tenant, tags, team, support channels and authoritative definitions are mapped as for data products (see BitolMapperBase).
Everything that has no home in the open metadata types is kept in additional properties with the prefix "bitol.".
  • Field Details

    • SLA_PROPERTIES_JSON

      public static final String SLA_PROPERTIES_JSON
      Additional property on the service level objective holding the SLA properties as JSON.
      See Also:
  • Constructor Details

    • DataContractMapper

      public DataContractMapper(ConnectorContextBase context)
      Constructor.
      Parameters:
      context - connector context providing access to the open metadata clients
  • Method Details

    • catalogueDataContract

      Catalogue a data contract. Republishing the same version updates the existing elements; a new version creates new elements linked to the same ExternalId.
      Parameters:
      dataContract - document to catalogue
      source - description of where the document came from (recorded on the ExternalId link)
      Returns:
      result describing what was done and anything that could not be fully represented
      Throws:
      InvalidParameterException - invalid parameter
      PropertyServerException - problem with the metadata store
      UserNotAuthorizedException - security problem
    • ensureInputContract

      public List<String> ensureInputContract(String processGUID, String productName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Make sure that a process that assembles a digital product's data has a data contract describing the data it reads, so that the input port named after it in the product's ODPS document has a contract identifier. If the process is not already an item of an agreement, and has no bitol.contractId additional property, a sparsely populated draft contract is catalogued for it - an identifier ({process qualified name}::input), a name, a description listing the elements the process reads, and a status of draft - with the process and its sources as the agreement's items. The draft is published with the product, so it can be filled out in the Bitol store and catalogued again; a new version of it shares the draft's ExternalId.
      Parameters:
      processGUID - unique identifier of the process
      productName - name of the product it assembles, for the description
      Returns:
      unique identifiers of the agreements the process is an item of, including any draft created here
      Throws:
      InvalidParameterException - invalid parameter
      PropertyServerException - problem with the metadata store
      UserNotAuthorizedException - security problem