Class SurveyDatabaseElementResolver

java.lang.Object
org.odpi.openmetadata.frameworks.opensurvey.SurveyDatabaseElementResolver

public class SurveyDatabaseElementResolver extends Object
SurveyDatabaseElementResolver finds the catalogued element that a database survey annotation describes, so that the annotation's AssociatedAnnotation relationship links to the schema, table or column it measures rather than to the surveyed asset.

The catalogued elements are found by following relationships down from the surveyed asset and matching on the name the database uses: resourceName for a database, which the database templates set to the database name (or displayName for a database catalogued without a resourceName), and displayName for schemas, tables and columns, which the JDBC cataloguer sets to their names. This means it does not depend on how the qualified names of the catalogued elements were formed. The path followed is:
  • SoftwareServer - SupportedSoftwareCapability - capability - CapabilityAssetUse - RelationalDatabase (only when the surveyed asset is a database server)
  • RelationalDatabase - DataSetContent - DeployedDatabaseSchema
  • DeployedDatabaseSchema - Schema - schema type - AttributeForSchema - RelationalTable
  • RelationalTable - NestedSchemaAttribute - RelationalColumn
If the element an annotation describes has not been catalogued, the annotation is linked to the surveyed asset. A survey produces its annotations database by database, schema by schema and table by table, so only the children of the most recently used database, schema and table are cached.
  • Method Details

    • forDatabase

      public static SurveyDatabaseElementResolver forDatabase(OpenMetadataStore openMetadataStore, String databaseGUID)
      Return a resolver for a survey of a single database. The database annotations are linked to the surveyed asset, and the database name in each annotation is ignored.
      Parameters:
      openMetadataStore - access to the metadata
      databaseGUID - unique identifier of the surveyed database asset
      Returns:
      resolver
    • forServer

      public static SurveyDatabaseElementResolver forServer(OpenMetadataStore openMetadataStore, String serverGUID)
      Return a resolver for a survey of a database server, whose annotations cover many databases.
      Parameters:
      openMetadataStore - access to the metadata
      serverGUID - unique identifier of the surveyed software server asset
      Returns:
      resolver
    • getDescribedElementGUID

      Return the unique identifier of the catalogued element that the annotation describes, or the surveyed asset if that element has not been catalogued.
      Parameters:
      annotation - annotation and the names of the resource it describes
      Returns:
      element unique identifier
      Throws:
      InvalidParameterException - a parameter is invalid
      UserNotAuthorizedException - the connector is not able to access the elements
      PropertyServerException - a problem accessing the metadata store