Class SurveyDatabaseElementResolver
java.lang.Object
org.odpi.openmetadata.frameworks.opensurvey.SurveyDatabaseElementResolver
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:
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
-
Method Summary
Modifier and TypeMethodDescriptionforDatabase(OpenMetadataStore openMetadataStore, String databaseGUID) Return a resolver for a survey of a single database.forServer(OpenMetadataStore openMetadataStore, String serverGUID) Return a resolver for a survey of a database server, whose annotations cover many databases.getDescribedElementGUID(DatabaseElementAnnotation annotation) Return the unique identifier of the catalogued element that the annotation describes, or the surveyed asset if that element has not been catalogued.
-
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 metadatadatabaseGUID- 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 metadataserverGUID- unique identifier of the surveyed software server asset- Returns:
- resolver
-
getDescribedElementGUID
public String getDescribedElementGUID(DatabaseElementAnnotation annotation) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException 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 invalidUserNotAuthorizedException- the connector is not able to access the elementsPropertyServerException- a problem accessing the metadata store
-