Class SimonContributionRecorderConnector
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,VirtualConnectorExtension,IntegrationConnector,OpenMetadataEventListener
The karma points are gathered in memory as the events arrive and written on each refresh, so a busy user costs one read and one update per refresh rather than one per change. Karma points that could not be written are kept and tried again on the next refresh. The unique identifier of each user's contribution record is cached so that the actor profile is only looked up the first time.
The users whose userIds match one of the patterns in the ignoredUserIdPatterns configuration property are not awarded karma points. The core content pack sets them to match the non-personal accounts (ending in npa) and the governance engines (ending in engine), so only the contributions of people are recognized. The patterns are used rather than a list of userIds because the servers' userIds differ in each environment. The connector's own userId is always ignored, whether a pattern matches it or not - each update it makes to a contribution record produces an event of its own, and otherwise it would award itself a karma point for every one, without end.
-
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.frameworks.integration.connectors.IntegrationConnectorBase
catalogTargetsManager, connectorName, integrationContext, propertyHelperFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWrite any karma points that have not been recorded yet before the connector shuts down.voidAward a karma point to the user responsible for the change reported by an open metadata event.voidrefresh()Write the karma points awarded since the last refresh to the users' contribution records.voidstart()Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.frameworks.integration.connectors.IntegrationConnectorBase
engage, getConnectorComponentDescription, getNetworkAddress, passEventToCatalogTargets, refreshCatalogTargets, setAuditLog, setConnectorName, setContextMethods 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, setStatisticTimestampMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension
initializeEmbeddedConnectors
-
Constructor Details
-
SimonContributionRecorderConnector
public SimonContributionRecorderConnector()
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing. The listener is registered here rather than after the first refresh, since there is no backlog for a refresh to work through - the contributions are only seen as they happen.- Specified by:
startin interfaceIntegrationConnector- Overrides:
startin classIntegrationConnectorBase- Throws:
ConnectorCheckedException- the connector detected a problem.UserNotAuthorizedException- the connector was disconnected before/during start
-
refresh
Write the karma points awarded since the last refresh to the users' contribution records.- Specified by:
refreshin interfaceIntegrationConnector- Throws:
ConnectorCheckedException- a problem with the connector. It is not able to refresh the metadata.UserNotAuthorizedException- the connector was disconnected
-
processEvent
Award a karma point to the user responsible for the change reported by an open metadata event. The refresh events do not report a change - they are sent when an element is distributed around the cohort.- Specified by:
processEventin interfaceOpenMetadataEventListener- Parameters:
event- event object - call getEventType to find out what type of event.
-
disconnect
Write any karma points that have not been recorded yet before the connector shuts down.- Specified by:
disconnectin interfaceIntegrationConnector- Overrides:
disconnectin classIntegrationConnectorBase- Throws:
ConnectorCheckedException- there is a problem within the connector.
-