Class GovernanceActionServiceConnector

java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.governanceaction.GovernanceActionServiceConnector
All Implemented Interfaces:
AuditLoggingComponent, SecureConnectorExtension, VirtualConnectorExtension, GovernanceActionService
Direct Known Subclasses:
GeneralGovernanceActionService, ProvisioningGovernanceActionService, RemediationGovernanceActionService, TriageGovernanceActionService, VerificationGovernanceActionService, WatchdogGovernanceActionService

public abstract class GovernanceActionServiceConnector extends ConnectorBase implements GovernanceActionService, AuditLoggingComponent
GovernanceActionServiceConnector describes the base class for a specific type of connector that is responsible for preforming specific governance actions on demand. There are six types of governance action service:
  • WatchdogGovernanceActionService - monitors for changes to the metadata elements and initiates other governance actions depending on the nature of the change.
  • VerificationGovernanceActionService - tests values in the metadata elements to detect errors or to classify the status of the metadata elements.
  • TriageGovernanceActionService - manages the choices on how to resolve a situation, often involving a human decision maker.
  • RemediationGovernanceActionService - maintains the metadata elements.
  • ProvisioningGovernanceActionService - provisions resources in the digital landscape and maintains lineage.
  • GeneralGovernanceActionService - combines all of the capability of the specialist services above.
Each type of governance action service is passed a specialized context that provides it with the metadata methods it needs for its specific role. When you build a governance action service, you extend the governance action service class that matches the purpose of your governance action to ensure your code receives a context with the appropriate interface. In addition, there is a generic governance action service called GeneralGovernanceActionService that combines all the functions of the five specialist types of governance action service. It is used when if is more efficient to combine the functions into one execution.
  • Field Details

    • governanceServiceName

      protected String governanceServiceName
    • auditLog

      protected AuditLog auditLog
    • propertyHelper

      protected PropertyHelper propertyHelper
  • Constructor Details

    • GovernanceActionServiceConnector

      public GovernanceActionServiceConnector()
  • Method Details

    • setAuditLog

      public void setAuditLog(AuditLog auditLog)
      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:
      setAuditLog in interface AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • setGovernanceServiceName

      public void setGovernanceServiceName(String governanceServiceName)
      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 method
      error - caught exception
      Throws:
      GovernanceServiceException - wrapped exception
      ConnectorCheckedException
    • setGovernanceContext

      public abstract void setGovernanceContext(GovernanceActionContext governanceContext)
      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

      public void validateContext(GovernanceContext governanceContext) throws ConnectorCheckedException
      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 property
      requestParameters - request parameters
      defaultValue - 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 property
      requestParameters - request parameter
      Returns:
      boolean flag or false if not set
    • getIntRequestParameter

      protected int getIntRequestParameter(String propertyName, Map<String,String> requestParameters)
      Retrieve a request parameter that is an integer.
      Parameters:
      propertyName - name of property
      requestParameters - request parameter
      Returns:
      integer value or zero if not supplied
    • getLongRequestParameter

      protected long getLongRequestParameter(String propertyName, Map<String,String> requestParameters)
      Retrieve a request parameter that is a long.
      Parameters:
      propertyName - name of property
      requestParameters - 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 property
      requestParameters - request parameter
      Returns:
      string value of property or null if not supplied
    • disconnect

      public void disconnect() throws ConnectorCheckedException
      Free up any resources held since the connector is no longer needed.
      Overrides:
      disconnect in class ConnectorBase
      Throws:
      ConnectorCheckedException - there is a problem within the connector.