Class OpenMetadataRowDataSetConnectorBase
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.jacquard.tabulardatasets.OpenMetadataDataSetConnectorBase
org.odpi.openmetadata.adapters.connectors.jacquard.tabulardatasets.OpenMetadataRowDataSetConnectorBase
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,ReadableTabularDataSource,VirtualConnectorExtension
- Direct Known Subclasses:
BusinessCapabilitiesTabularDataSetConnector,OpenMetadataDataTypesDataSetConnector,OrganizationStructureDataSetConnectorBase,SecretsCollectionsTabularDataSetConnector,SecretsStoresTabularDataSetConnector,ServersTabularDataSetConnector,SurveyReportDataSetConnectorBase,UserAccountsTabularDataSetConnector,UserIdentitiesTabularDataSetConnector,ZoneMembershipProfileTabularDataSetConnector,ZoneMembershipTotalsTabularDataSetConnector
OpenMetadataRowDataSetConnectorBase is the base class for tabular data sets whose rows are not one element
each. A row may be built from an element together with values the connector works out for itself - the
survey report an annotation was published in, the team a department reports to, a measurement from an
annotation's map of measurements - or from a relationship and the elements at its ends.
The subclass gathers its rows in
The subclass gathers its rows in
collectRows() by calling addRow(org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader, org.odpi.openmetadata.frameworks.openmetadata.properties.OpenMetadataRootProperties, java.util.Map<java.lang.String, java.lang.String>). The whole data set is
rebuilt on each refresh, which keeps the rows consistent with each other: these data sets join several
queries together, so a row-by-row refresh of the kind the single-type data sets use would leave rows built
from different moments in the repository's history.-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
Fields inherited from class org.odpi.openmetadata.adapters.connectors.jacquard.tabulardatasets.OpenMetadataDataSetConnectorBase
connectorContext, connectorName, productDefinition, propertyHelperFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
ConstructorsConstructorDescriptionOpenMetadataRowDataSetConnectorBase(String connectorName, ProductDefinition productDefinition) Constructor used to set up the name of this connector (supplied by the subclasses). -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRow(ElementHeader elementHeader, OpenMetadataRootProperties properties, Map<String, String> suppliedValues) Add a row to the data set being built.protected voidaddRow(OpenMetadataRootElement element, Map<String, String> suppliedValues) Add a row for an element.protected abstract voidGather the rows of the data set by calling addRow for each one.protected List<OpenMetadataRootElement> getAllElements(String typeName, int graphQueryDepth) Retrieve every element of a type (and its subtypes).protected List<OpenMetadataRootElement> getAllElements(String typeName, int graphQueryDepth, List<String> includeOnlyRelationships) Retrieve every element of a type (and its subtypes), with only the named relationships.protected List<MetadataRelationshipSummary> getAllRelationships(String relationshipTypeName) Retrieve every relationship of a type (and its subtypes).longReturn the record count in the data source.protected booleanisTypeOf(ElementHeader elementHeader, String typeName) Is the element of the named type, or one of its subtypes?Start a map of supplied values.protected voidAdd a value to the supplied values.readRecord(long rowNumber) Return the requested data record.voidRebuild the rows of the data set.voidstart()Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.adapters.connectors.jacquard.tabulardatasets.OpenMetadataDataSetConnectorBase
disconnect, getClientUserId, getColumnDescriptions, getColumnDescriptions, getColumnNumber, getConnectorComponentDescription, getElementHeaderRecordValue, getElementRecordValue, getElementRecordValue, getHeaderAndPropertiesOptions, getHeaderAndPropertiesQueryOptions, getRecordValues, getRecordValues, getRelatedElementGUIDRecordValue, getRelatedElementRecordValue, getTableDescription, getTableName, getTabularColumnDescription, setAuditLog, setColumnDescriptions, setLocalEnvironmentMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCamelToCanonicalCase, fromCanonicalToCamelCase, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayValue, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getSecretsCollectionName, getSecretsLocation, getSecretsProvider, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingElement, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestamp
-
Constructor Details
-
OpenMetadataRowDataSetConnectorBase
public OpenMetadataRowDataSetConnectorBase(String connectorName, ProductDefinition productDefinition) Constructor used to set up the name of this connector (supplied by the subclasses).- Parameters:
connectorName- name of the connectorproductDefinition- definition of the product that this connector serves
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
startin classOpenMetadataDataSetConnectorBase- Throws:
ConnectorCheckedException- the connector detected a problem.UserNotAuthorizedException- the connector was disconnected before/during start
-
refreshCache
Rebuild the rows of the data set.- Specified by:
refreshCachein classOpenMetadataDataSetConnectorBase- Throws:
ConnectorCheckedException- unable to refresh
-
collectRows
Gather the rows of the data set by calling addRow for each one.- Throws:
Exception- any problem retrieving the metadata - it is logged and returned as a ConnectorCheckedException
-
addRow
protected void addRow(ElementHeader elementHeader, OpenMetadataRootProperties properties, Map<String, String> suppliedValues) throws ConnectorCheckedExceptionAdd a row to the data set being built. Each column is filled from, in order: the supplied values (keyed by the column's display name, so a null value there is an explicit null), the element's header, the element's properties. A column that none of these can fill is null.- Parameters:
elementHeader- header of the element that the row describes (may be null)properties- properties of the element that the row describes (may be null)suppliedValues- values worked out by the connector, keyed by ProductDataFieldDefinition display name- Throws:
ConnectorCheckedException- a column that is part of the unique identifier has no value
-
addRow
protected void addRow(OpenMetadataRootElement element, Map<String, String> suppliedValues) throws ConnectorCheckedExceptionAdd a row for an element.- Parameters:
element- element that the row describessuppliedValues- values worked out by the connector, keyed by ProductDataFieldDefinition display name- Throws:
ConnectorCheckedException- a column that is part of the unique identifier has no value
-
newValues
Start a map of supplied values.- Returns:
- empty map
-
putValue
Add a value to the supplied values.- Parameters:
values- map of valuesfield- field that the value belongs tovalue- value (may be null, which forces the column to be null)
-
getAllElements
protected List<OpenMetadataRootElement> getAllElements(String typeName, int graphQueryDepth) throws Exception Retrieve every element of a type (and its subtypes).- Parameters:
typeName- name of the typegraphQueryDepth- how many levels of related elements to return with each element- Returns:
- list of elements, oldest first
- Throws:
Exception- problem retrieving the elements
-
getAllElements
protected List<OpenMetadataRootElement> getAllElements(String typeName, int graphQueryDepth, List<String> includeOnlyRelationships) throws Exception Retrieve every element of a type (and its subtypes), with only the named relationships.- Parameters:
typeName- name of the typegraphQueryDepth- how many levels of related elements to return with each elementincludeOnlyRelationships- relationship types to return with each element (null for all)- Returns:
- list of elements, oldest first
- Throws:
Exception- problem retrieving the elements
-
getAllRelationships
protected List<MetadataRelationshipSummary> getAllRelationships(String relationshipTypeName) throws Exception Retrieve every relationship of a type (and its subtypes).- Parameters:
relationshipTypeName- name of the relationship type- Returns:
- list of relationships, oldest first
- Throws:
Exception- problem retrieving the relationships
-
isTypeOf
Is the element of the named type, or one of its subtypes?- Parameters:
elementHeader- header of the elementtypeName- type to test for- Returns:
- boolean
-
getRecordCount
public long getRecordCount()Return the record count in the data source.- Returns:
- count
-
readRecord
Return the requested data record. The first record is record 0.- Parameters:
rowNumber- long- Returns:
- list of values (as strings) where each string is the value from a column. The order is the same as the columns
- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-