Class OSSUnityCatalogInsideCatalogSyncBase
java.lang.Object
org.odpi.openmetadata.adapters.connectors.unitycatalog.sync.OSSUnityCatalogInsideCatalogSyncBase
- Direct Known Subclasses:
OSSUnityCatalogInsideCatalogSyncFunctions,OSSUnityCatalogInsideCatalogSyncRegisteredModels,OSSUnityCatalogInsideCatalogSyncSchema,OSSUnityCatalogInsideCatalogSyncTables,OSSUnityCatalogInsideCatalogSyncVolumes,OSSUnityCatalogServerSyncCatalog
Common functions for the synchronizing between Egeria and Unity Catalog.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AssetClientprotected final AuditLogprotected final Stringprotected final Stringprotected final Stringprotected final Stringprotected final IntegrationContextprotected final UnityCatalogDeployedImplementationTypeprotected final Stringprotected final ExternalIdClientprotected final Stringprotected final OpenMetadataStoreprotected final PropertyFacetClientprotected final PropertyHelperprotected final PermittedSynchronizationprotected final Stringprotected final OSSUnityCatalogResourceConnectorprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionOSSUnityCatalogInsideCatalogSyncBase(String connectorName, IntegrationContext context, String catalogTargetName, String catalogGUID, String metadataCollectionQualifiedName, Map<String, String> ucFullNameToEgeriaGUID, PermittedSynchronization targetPermittedSynchronization, OSSUnityCatalogResourceConnector ucConnector, String ucServerEndpoint, String entityTypeName, UnityCatalogDeployedImplementationType deployedImplementationType, Map<String, String> templates, Map<String, Object> configurationProperties, List<String> excludeNames, List<String> includeNames, AuditLog auditLog) Set up the schema synchronizer. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalIdentifier(String openMetadataElementGUID, ElementBase ucElement, String schemaName, String elementName, String elementType, String id, PermittedSynchronization instanceSynchronizationDirection) Add a new external identifier to an existing open metadata element.protected voidaddPropertyFacet(String parentGUID, String parentQualifiedName, BasicElementProperties basicElementProperties, Map<String, String> facetProperties) Create the property facet for an Egeria element.protected voiddeleteElementInEgeria(MemberElement memberElement) Delete an element from open metadata.getArrayConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is a comma-separated list of strings.protected DategetDateFromLong(long valueFromUC) Convert the long value returned by UC into a date (or null).protected ExternalIdLinkPropertiesgetExternalIdLinkProperties(ElementBase ucElement, String schemaName, String elementName, PermittedSynchronization instanceSynchronizationDirection) Populate and return the external identifier properties for a UC Schema.protected ExternalIdPropertiesgetExternalIdProperties(ElementBase ucElement, String elementType, String id) Populate and return the external identifier properties for a UC Schema.protected StringgetPathNameFromStorageLocation(String storageLocation) Convert the US format for the storage location into a proper pathname.protected StringgetQualifiedName(String fullName) Return the qualified name of an element using UnityCatalog's full name.protected StringgetUCCatalogFromMember(MemberElement memberElement) Extract the comment for a UC element from the description attribute in an egeria element.protected StringgetUCCommentFomMember(MemberElement memberElement) Extract the comment for a UC element from the description attribute in an egeria element.protected StringgetUCNameFromMember(MemberElement memberElement) Extract the name of a UC element from the name attribute in an egeria element (which is the full name).getUCPropertiesFromMember(MemberElement memberElement) Extract the properties for a UC element from the additionalProperties attribute in an egeria element.protected StringgetUCSchemaFromMember(MemberElement memberElement) Extract the schema name for a UC element from the description attribute in an egeria element.protected StringgetUCStorageLocationFromMember(MemberElement memberElement) Extract the storage location from theprotected booleannoMismatchInExternalIdentifier(String thirdPartyExternalIdentifier, MemberElement memberElement) Check that the name of the third party element has not changed with respect to Egeria.protected abstract IntegrationIteratorrefreshEgeria(String parentGUID, String parentRelationshipTypeName, RelationshipBeanProperties relationshipProperties) Review all the elements for the subtype stored in Egeria.protected abstract voidrefreshUnityCatalog(String parentGUID, String parentRelationshipTypeName, RelationshipBeanProperties relationshipProperties, IntegrationIterator iterator) Review all the elements for the subtype stored in UC.protected voidthrowBadBeanClass(OpenMetadataType expectedType, String methodName, OpenMetadataRootElement element) Indicate that an element does not have properties of the expected bean class.protected voidthrowMissingPropertyValue(String missingPropertyName, String methodName, OpenMetadataRootElement element) Throw an exception because a necessary property is missing.
-
Field Details
-
propertyHelper
-
connectorName
-
context
-
catalogGUID
-
catalogTypeName
-
metadataCollectionQualifiedName
-
catalogTargetName
-
targetPermittedSynchronization
-
ucConnector
-
ucServerEndpoint
-
entityTypeName
-
deployedImplementationType
-
templates
-
configurationProperties
-
auditLog
-
openMetadataStore
-
externalIdClient
-
propertyFacetClient
-
assetClient
-
excludeNames
-
includeNames
-
templateGUID
-
ucFullNameToEgeriaGUID
-
-
Constructor Details
-
OSSUnityCatalogInsideCatalogSyncBase
public OSSUnityCatalogInsideCatalogSyncBase(String connectorName, IntegrationContext context, String catalogTargetName, String catalogGUID, String metadataCollectionQualifiedName, Map<String, String> ucFullNameToEgeriaGUID, PermittedSynchronization targetPermittedSynchronization, OSSUnityCatalogResourceConnector ucConnector, String ucServerEndpoint, String entityTypeName, UnityCatalogDeployedImplementationType deployedImplementationType, Map<String, throws UserNotAuthorizedException, InvalidParameterExceptionString> templates, Map<String, Object> configurationProperties, List<String> excludeNames, List<String> includeNames, AuditLog auditLog) Set up the schema synchronizer.- Parameters:
connectorName- name of this connectorcontext- context for the connectorcatalogTargetName- the catalog target namecatalogGUID- guid of the catalogmetadataCollectionQualifiedName- name of the metadata collection for this UC serverucFullNameToEgeriaGUID- map of full names from UC to the GUID of the entity in Egeria.targetPermittedSynchronization- the policy that controls the direction of metadata exchangeucConnector- connector for accessing UCentityTypeName- type name of asset entity used to represent this type of elementdeployedImplementationType- technology typeucServerEndpoint- the server endpoint used to constructing the qualified namestemplates- templates supplied through the catalog targetconfigurationProperties- configuration properties supplied through the catalog targetexcludeNames- list of catalogs to ignore (and include all others)includeNames- list of catalogs to include (and ignore all others) - overrides excludeCatalogsauditLog- logging destination- Throws:
UserNotAuthorizedException- connector disconnectedInvalidParameterException- missing template
-
-
Method Details
-
refreshEgeria
protected abstract IntegrationIterator refreshEgeria(String parentGUID, String parentRelationshipTypeName, RelationshipBeanProperties relationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ConnectorCheckedException Review all the elements for the subtype stored in Egeria.- Parameters:
parentGUID- unique identifier of the parentparentRelationshipTypeName- relationship type between parent and elements to iterate throughrelationshipProperties- optional properties for the relationship- Returns:
- iterator
- Throws:
InvalidParameterException- parameter errorPropertyServerException- repository errorUserNotAuthorizedException- security errorConnectorCheckedException- logic error in properties
-
refreshUnityCatalog
protected abstract void refreshUnityCatalog(String parentGUID, String parentRelationshipTypeName, RelationshipBeanProperties relationshipProperties, IntegrationIterator iterator) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ConnectorCheckedException Review all the elements for the subtype stored in UC.- Parameters:
parentGUID- unique identifier of the parentparentRelationshipTypeName- relationship type between parent and elements to iterate throughrelationshipProperties- optional properties for the relationshipiterator- iterator of choice- Throws:
InvalidParameterException- parameter errorPropertyServerException- repository errorUserNotAuthorizedException- security errorConnectorCheckedException- logic error in properties
-
getDateFromLong
Convert the long value returned by UC into a date (or null).- Parameters:
valueFromUC- long- Returns:
- date
-
getQualifiedName
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 errorPropertyServerException- repository errorUserNotAuthorizedException- authorization error
-
addExternalIdentifier
public void addExternalIdentifier(String openMetadataElementGUID, ElementBase ucElement, String schemaName, String elementName, String elementType, String id, PermittedSynchronization instanceSynchronizationDirection) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Add a new external identifier to an existing open metadata element.- Parameters:
openMetadataElementGUID- unique identifier (GUID) of the element in the open metadata ecosystemucElement- values from Unity Catalog elementschemaName- name of the schemaelementName- element type (from UC)instanceSynchronizationDirection- direction the metadata is flowing- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
getExternalIdProperties
protected ExternalIdProperties getExternalIdProperties(ElementBase ucElement, String elementType, String id) Populate and return the external identifier properties for a UC Schema.- Parameters:
ucElement- values from Unity Catalog elementelementType- element type (from UC)id- element id (from UC)- Returns:
- external identifier properties
-
getExternalIdLinkProperties
protected ExternalIdLinkProperties getExternalIdLinkProperties(ElementBase ucElement, String schemaName, String elementName, PermittedSynchronization instanceSynchronizationDirection) Populate and return the external identifier properties for a UC Schema.- Parameters:
ucElement- values from Unity Catalog elementschemaName- name of the schemaelementName- element type (from UC)instanceSynchronizationDirection- direction the metadata is flowing- Returns:
- external identifier properties
-
addPropertyFacet
protected void addPropertyFacet(String parentGUID, String parentQualifiedName, BasicElementProperties basicElementProperties, Map<String, String> facetProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionCreate the property facet for an Egeria element. This holds the vendor specific properties for the element.- Parameters:
parentGUID- the parent (and anchor) unique nameparentQualifiedName- qualifiedName of the parent elementbasicElementProperties- common properties of an elementfacetProperties- these are the specialist property for the linked element.- Throws:
InvalidParameterExceptionPropertyServerExceptionUserNotAuthorizedException
-
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 CatalogmemberElement- element from Egeria- Returns:
- boolean
-
throwMissingPropertyValue
protected void throwMissingPropertyValue(String missingPropertyName, String methodName, OpenMetadataRootElement element) throws ConnectorCheckedException Throw an exception because a necessary property is missing. The description portrays this a s logic error.- Parameters:
missingPropertyName- missing property namemethodName- calling methodelement- element in error- Throws:
ConnectorCheckedException- resulting exception
-
throwBadBeanClass
protected void throwBadBeanClass(OpenMetadataType expectedType, String methodName, OpenMetadataRootElement element) throws ConnectorCheckedException Indicate that an element does not have properties of the expected bean class. This is documented as a logic error.- Parameters:
expectedType- open metadata type informationmethodName- calling methodelement- element in error- Throws:
ConnectorCheckedException- resulting exception
-
getUCCatalogFromMember
protected String getUCCatalogFromMember(MemberElement memberElement) throws ConnectorCheckedException Extract the comment for a UC element from the description attribute in an egeria element.- Parameters:
memberElement- element from Egeria- Returns:
- catalog for UC
- Throws:
ConnectorCheckedException- logic error in properties
-
getUCSchemaFromMember
protected String getUCSchemaFromMember(MemberElement memberElement) throws ConnectorCheckedException Extract the schema name for a UC element from the description attribute in an egeria element.- Parameters:
memberElement- element from Egeria- Returns:
- schema for UC
- Throws:
ConnectorCheckedException- logic error in properties
-
getUCNameFromMember
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
- Throws:
ConnectorCheckedException- logic error in properties
-
getUCCommentFomMember
protected String getUCCommentFomMember(MemberElement memberElement) throws ConnectorCheckedException Extract the comment for a UC element from the description attribute in an egeria element.- Parameters:
memberElement- element from Egeria- Returns:
- comment for UC
- Throws:
ConnectorCheckedException- logic error in properties
-
getUCPropertiesFromMember
protected Map<String,String> getUCPropertiesFromMember(MemberElement memberElement) throws ConnectorCheckedException Extract the properties for a UC element from the additionalProperties attribute in an egeria element.- Parameters:
memberElement- element from Egeria- Returns:
- properties for UC
- Throws:
ConnectorCheckedException
-
getUCStorageLocationFromMember
Extract the storage location from the- Parameters:
memberElement- elements from egeria- Returns:
- storage location (may be null
-
getPathNameFromStorageLocation
Convert the US format for the storage location into a proper pathname.- Parameters:
storageLocation- storage location from UC- Returns:
- pathname
-
getArrayConfigurationProperty
protected List<String> getArrayConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is a comma-separated list of strings.- Parameters:
propertyName- name of propertyconfigurationProperties- configuration properties- Returns:
- list of strings or null if not set
-