Class GenericWatchdogGovernanceActionConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.openwatchdog.WatchdogActionServiceConnector
org.odpi.openmetadata.adapters.connectors.governanceactions.watchdog.GenericWatchdogGovernanceActionConnector
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,VirtualConnectorExtension,WatchdogActionService
- Direct Known Subclasses:
GenericElementWatchdogGovernanceActionConnector,GenericFolderWatchdogGovernanceActionConnector
public abstract class GenericWatchdogGovernanceActionConnector
extends WatchdogActionServiceConnector
GenericWatchdogGovernanceActionConnector provides a base class for generic watchdog functions.
It runs as a watchdog action service in a watchdog action engine, such as EgeriaWatchdog.
-
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.openwatchdog.WatchdogActionServiceConnector
connector, embeddedConnectors, objectMapper, propertyHelper, watchdogActionServiceName, watchdogContextFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompleteMonitoring(WatchdogActionGuard guard, String completionMessage) Record that the monitoring is over and stop listening for events.protected StringdiffProperties(ElementProperties oldProperties, ElementProperties newProperties) Return a comma separated list of properties that have changed.protected StringgetProperty(String propertyName, String defaultValue) Retrieve a property value from the request parameters, falling back to the configuration properties of the connection and then the default value.protected booleaninitiateProcess(String processName, Map<String, String> requestParameters, List<NewActionTarget> actionTargets) Initiates the request for the new process to start if a process name has been configured.Methods inherited from class org.odpi.openmetadata.frameworks.openwatchdog.WatchdogActionServiceConnector
disconnect, getConnectorComponentDescription, getJSONProperties, handleUnexpectedException, processEvent, setAuditLog, setWatchdogActionServiceName, setWatchdogContext, startMethods 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
-
GenericWatchdogGovernanceActionConnector
public GenericWatchdogGovernanceActionConnector()
-
-
Method Details
-
getProperty
protected String getProperty(String propertyName, String defaultValue) throws UserNotAuthorizedException Retrieve a property value from the request parameters, falling back to the configuration properties of the connection and then the default value.- Parameters:
propertyName- name of the propertydefaultValue- value to use if the property is not set- Returns:
- property value
- Throws:
UserNotAuthorizedException- the connector was disconnected
-
completeMonitoring
Record that the monitoring is over and stop listening for events. Once complete, any further events that were already queued are ignored.- Parameters:
guard- guard that describes the outcomecompletionMessage- optional message describing the outcome
-
diffProperties
Return a comma separated list of properties that have changed. This is saved in the request parameters and can be retrieved by the receiving governance service. The changed properties can be retrieved by the StringTokenizer class.- Parameters:
oldProperties- original property valuesnewProperties- new property values- Returns:
- comma separated list of property names where the value has changed
-
initiateProcess
protected boolean initiateProcess(String processName, Map<String, String> requestParameters, List<NewActionTarget> actionTargets) throws GovernanceServiceExceptionInitiates the request for the new process to start if a process name has been configured.- Parameters:
processName- name of the process to startrequestParameters- parameters to pass to the processactionTargets- the elements that this process should work on- Returns:
- true if a process was started; false if no process is configured for this kind of event
- Throws:
GovernanceServiceException- unable to start the process
-