Class GovernanceActionServiceConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.opengovernance.GovernanceActionServiceConnector
- All Implemented Interfaces:
AuditLoggingComponent,SecureConnectorExtension,VirtualConnectorExtension,GovernanceActionService
- Direct Known Subclasses:
GeneralGovernanceActionService
public abstract class GovernanceActionServiceConnector
extends ConnectorBase
implements GovernanceActionService, AuditLoggingComponent
GovernanceActionService describes the base class for a governance action service connector that is responsible for preforming
specific governance actions on demand. There are five types of actions that s governance action service performs:
- Watchdog - monitors for changes to the metadata elements and initiates other governance actions depending on the nature of the change.
- Verification - tests values in the metadata elements to detect errors or to classify the status of the metadata elements.
- Triage - manages the choices on how to resolve a situation, often involving a human decision maker.
- Remediation - maintains the metadata elements.
- Provisioning - provisions resources in the digital landscape and maintains lineage.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection -
Field Summary
FieldsFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFree up any resources held since the connector is no longer needed.getArrayRequestParameter(String propertyName, Map<String, String> requestParameters, List<String> defaultValue) Retrieve a request parameter that is a comma-separated list of strings.protected booleangetBooleanRequestParameter(String propertyName, Map<String, String> requestParameters) Retrieve a request parameter that is a boolean.Return the component description that is used by this connector in the audit log.protected intgetIntRequestParameter(String propertyName, Map<String, String> requestParameters) Retrieve a request parameter that is an integer.protected longgetLongRequestParameter(String propertyName, Map<String, String> requestParameters) Retrieve a request parameter that is a long.protected StringgetStringRequestParameter(String propertyName, Map<String, String> requestParameters) Retrieve a request parameter that is a string or null if not set.protected voidhandleUnexpectedException(String methodName, Throwable error) Provide a common exception for unexpected errors.voidsetAuditLog(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.abstract voidsetGovernanceContext(GovernanceActionContext governanceContext) Set up details of the governance action request and access to the metadata store.voidsetGovernanceServiceName(String governanceServiceName) Set up the governance action service name.voidvalidateContext(GovernanceContext governanceContext) Verify that the context has been set up in the subclassMethods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, start, throwMissingConfigurationProperty, 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
-
Field Details
-
governanceServiceName
-
auditLog
-
propertyHelper
-
-
Constructor Details
-
GovernanceActionServiceConnector
public GovernanceActionServiceConnector()
-
-
Method Details
-
setAuditLog
Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.- Specified by:
setAuditLogin interfaceAuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorComponentDescription
Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceAuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
setGovernanceServiceName
Set up the governance action service name. This is used in error messages.- Parameters:
governanceServiceName- name of the service
-
handleUnexpectedException
protected void handleUnexpectedException(String methodName, Throwable error) throws ConnectorCheckedException Provide a common exception for unexpected errors.- Parameters:
methodName- calling methoderror- caught exception- Throws:
GovernanceServiceException- wrapped exceptionConnectorCheckedException
-
setGovernanceContext
Set up details of the governance action request and access to the metadata store. This method is called before start and should not be null- Parameters:
governanceContext- specialist context for this type of governance action.
-
validateContext
Verify that the context has been set up in the subclass- Parameters:
governanceContext- context from the subclass- Throws:
ConnectorCheckedException- error to say that the connector (governance action service) is not able to proceed because it has not been set up correctly.
-
getArrayRequestParameter
protected List<String> getArrayRequestParameter(String propertyName, Map<String, String> requestParameters, List<String> defaultValue) Retrieve a request parameter that is a comma-separated list of strings.- Parameters:
propertyName- name of propertyrequestParameters- request parametersdefaultValue- value to use if the property is not specified.- Returns:
- list of strings or null if not set
-
getBooleanRequestParameter
protected boolean getBooleanRequestParameter(String propertyName, Map<String, String> requestParameters) Retrieve a request parameter that is a boolean. If any non-null value is set it returns true unless the value is set to FALSE, False or false.- Parameters:
propertyName- name of propertyrequestParameters- request parameter- Returns:
- boolean flag or false if not set
-
getIntRequestParameter
Retrieve a request parameter that is an integer.- Parameters:
propertyName- name of propertyrequestParameters- request parameter- Returns:
- integer value or zero if not supplied
-
getLongRequestParameter
Retrieve a request parameter that is a long.- Parameters:
propertyName- name of propertyrequestParameters- request parameter- Returns:
- long value or zero if not supplied
-
getStringRequestParameter
protected String getStringRequestParameter(String propertyName, Map<String, String> requestParameters) Retrieve a request parameter that is a string or null if not set.- Parameters:
propertyName- name of propertyrequestParameters- request parameter- Returns:
- string value of property or null if not supplied
-
disconnect
Free up any resources held since the connector is no longer needed.- Overrides:
disconnectin classConnectorBase- Throws:
ConnectorCheckedException- there is a problem within the connector.
-