Class OSSUnityCatalogInsideCatalogSyncBase

java.lang.Object
org.odpi.openmetadata.adapters.connectors.unitycatalog.sync.OSSUnityCatalogInsideCatalogSyncBase
Direct Known Subclasses:
OSSUnityCatalogInsideCatalogSyncFunctions, OSSUnityCatalogInsideCatalogSyncRegisteredModels, OSSUnityCatalogInsideCatalogSyncSchema, OSSUnityCatalogInsideCatalogSyncTables, OSSUnityCatalogInsideCatalogSyncVolumes, OSSUnityCatalogServerSyncCatalog

public abstract class OSSUnityCatalogInsideCatalogSyncBase extends Object
Common functions for the synchronizing between Egeria and Unity Catalog.
  • Field Details

  • Constructor Details

    • OSSUnityCatalogInsideCatalogSyncBase

      public OSSUnityCatalogInsideCatalogSyncBase(String connectorName, CatalogIntegratorContext context, String catalogName, String catalogGUID, String catalogQualifiedName, Map<String,String> ucFullNameToEgeriaGUID, PermittedSynchronization targetPermittedSynchronization, OSSUnityCatalogResourceConnector ucConnector, String ucServerEndpoint, UnityCatalogDeployedImplementationType deployedImplementationType, Map<String,String> templates, Map<String,Object> configurationProperties, List<String> excludeNames, List<String> includeNames, AuditLog auditLog)
      Set up the schema synchronizer.
      Parameters:
      connectorName - name of this connector
      context - context for the connector
      catalogName - the catalog target name
      catalogGUID - guid of the catalog
      catalogQualifiedName - name of the catalog
      ucFullNameToEgeriaGUID - map of full names from UC to the GUID of the entity in Egeria.
      targetPermittedSynchronization - the policy that controls the direction of metadata exchange
      ucConnector - connector for accessing UC
      deployedImplementationType - technology type
      ucServerEndpoint - the server endpoint used to constructing the qualified names
      templates - templates supplied through the catalog target
      configurationProperties - configuration properties supplied through the catalog target
      excludeNames - list of catalogs to ignore (and include all others)
      includeNames - list of catalogs to include (and ignore all others) - overrides excludeCatalogs
      auditLog - logging destination
  • Method Details

    • refreshEgeria

      Review all the elements for the subtype stored in Egeria.
      Returns:
      MetadataCollectionIterator
      Throws:
      InvalidParameterException - parameter error
      PropertyServerException - repository error
      UserNotAuthorizedException - security error
    • refreshUnityCatalog

      protected abstract void refreshUnityCatalog(IntegrationIterator iterator) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Review all the elements for the subtype stored in UC.
      Parameters:
      iterator - Metadata collection iterator
      Throws:
      InvalidParameterException - parameter error
      PropertyServerException - repository error
      UserNotAuthorizedException - security error
    • getDateFromLong

      protected Date getDateFromLong(long valueFromUC)
      Convert the long value returned by UC into a date (or null).
      Parameters:
      valueFromUC - long
      Returns:
      date
    • getQualifiedName

      protected String getQualifiedName(String fullName)
      Return the qualified name of an element using UnityCatalog's full name.
      Parameters:
      fullName - dotted name
      Returns:
      qualified name
    • deleteElementInEgeria

      protected void deleteElementInEgeria(MemberElement memberElement) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Delete an element from open metadata.
      Parameters:
      memberElement - element to delete
      Throws:
      InvalidParameterException - parameter error
      PropertyServerException - repository error
      UserNotAuthorizedException - authorization error
    • getExternalIdentifierProperties

      protected ExternalIdentifierProperties getExternalIdentifierProperties(ElementBase ucElement, String schemaName, String elementName, String id, PermittedSynchronization instanceSynchronizationDirection)
      Populate and return the external identifier properties for a UC Schema.
      Parameters:
      ucElement - values from Unity Catalog element
      schemaName - name of the schema
      Returns:
      external identifier properties
    • addPropertyFacet

      protected void addPropertyFacet(String parentGUID, String parentQualifiedName, BasicElementProperties basicElementProperties, Map<String,String> facetProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Create the property facet for an Egeria element. This holds the vendor specific properties for the element.
      Parameters:
      parentGUID - the parent (and anchor) unique name
      parentQualifiedName - qualifiedName of the parent element
      basicElementProperties - common properties of an element
      facetProperties - these are the specialist property for the linked element.
      Throws:
      InvalidParameterException
      PropertyServerException
      UserNotAuthorizedException
    • noMismatchInExternalIdentifier

      protected boolean noMismatchInExternalIdentifier(String thirdPartyExternalIdentifier, MemberElement memberElement)
      Check that the name of the third party element has not changed with respect to Egeria.
      Parameters:
      thirdPartyExternalIdentifier - id from Unity Catalog
      memberElement - element from Egeria
      Returns:
      boolean
    • getUCCatalogFromMember

      protected String getUCCatalogFromMember(MemberElement memberElement)
      Extract the comment for a UC element from the description attribute in an egeria element.
      Parameters:
      memberElement - element from Egeria
      Returns:
      comment for UC
    • getUCSchemaFromMember

      protected String getUCSchemaFromMember(MemberElement memberElement)
      Extract the schema name for a UC element from the description attribute in an egeria element.
      Parameters:
      memberElement - element from Egeria
      Returns:
      comment for UC
    • getUCNameFromMember

      protected String getUCNameFromMember(MemberElement memberElement)
      Extract the name of a UC element from the name attribute in an egeria element (which is the full name).
      Parameters:
      memberElement - element from Egeria
      Returns:
      name for UC
    • getUCCommentFomMember

      protected String getUCCommentFomMember(MemberElement memberElement)
      Extract the comment for a UC element from the description attribute in an egeria element.
      Parameters:
      memberElement - element from Egeria
      Returns:
      comment for UC
    • getUCPropertiesFromMember

      protected Map<String,String> getUCPropertiesFromMember(MemberElement memberElement)
      Extract the properties for a UC element from the additionalProperties attribute in an egeria element.
      Parameters:
      memberElement - element from Egeria
      Returns:
      properties for UC
    • getUCStorageLocationFromMember

      protected String getUCStorageLocationFromMember(MemberElement memberElement)
      Extract the storage location from the
      Parameters:
      memberElement - elements from egeria
      Returns:
      storage location (may be null
    • getPathNameFromStorageLocation

      protected String getPathNameFromStorageLocation(String storageLocation)
      Convert the US format for the storage location into a proper pathname.
      Parameters:
      storageLocation - storage location from UC
      Returns:
      pathname