java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler

public abstract class GovernanceEngineHandler extends Object
The GovernanceEngineHandler is responsible for running governance services on demand. It is initialized with the configuration for the engine service it supports along with the clients to the metadata store where the definitions of the governance engine are managed.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.odpi.openmetadata.frameworks.auditlog.AuditLog
     
    protected String
     
    protected String
     
    protected String
     
    protected org.odpi.openmetadata.accessservices.governanceengine.properties.GovernanceEngineProperties
     
    protected int
     
    protected org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient
     
    protected String
     
    protected String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GovernanceEngineHandler(org.odpi.openmetadata.adminservices.configuration.properties.EngineConfig engineConfig, String serverName, String serverUserId, String engineServiceName, org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineConfigurationClient configurationClient, org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient serverClient, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog, int maxPageSize)
    Create a client-side object for calling a governance engine.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    executeGovernanceAction(String governanceActionGUID)
    Execute the requested governance action on or after the start time.
    Return the governance Engine name - used for error logging.
    getServiceCache(String governanceRequestType)
    Retrieve the governance service for the requested type.
    org.odpi.openmetadata.governanceservers.enginehostservices.properties.GovernanceEngineSummary
    Return a summary of the governance engine
    void
    publishWatchdogEvent(org.odpi.openmetadata.frameworks.governanceaction.events.WatchdogGovernanceEvent watchdogGovernanceEvent)
    Pass on the watchdog event to any governance service that supports them.
    void
    Request that the governance engine refresh its configuration by calling the metadata server.
    void
    refreshServiceConfig(String registeredGovernanceServiceGUID, String specificRequestType)
    Request that the governance engine refreshes its configuration for a single governance service by calling the metadata server.
    runGovernanceService(String governanceActionGUID, String governanceRequestType, Date startDate, Map<String,String> requestParameters, List<org.odpi.openmetadata.frameworks.governanceaction.properties.RequestSourceElement> requestSourceElements, List<org.odpi.openmetadata.frameworks.governanceaction.properties.ActionTargetElement> actionTargetElements)
    Run an instance of a governance action service in its own thread and return the handler (for disconnect processing).
    void
    Confirms termination of the governance engine.
    protected void
    validateGovernanceEngineInitialized(String expectedTypeName, String methodName)
    Validate that the governance engine is initialized.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serverName

      protected String serverName
    • serverUserId

      protected String serverUserId
    • serverClient

      protected org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient serverClient
    • engineUserId

      protected String engineUserId
    • auditLog

      protected org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog
    • maxPageSize

      protected int maxPageSize
    • governanceEngineName

      protected String governanceEngineName
    • governanceEngineGUID

      protected String governanceEngineGUID
    • governanceEngineProperties

      protected org.odpi.openmetadata.accessservices.governanceengine.properties.GovernanceEngineProperties governanceEngineProperties
  • Constructor Details

    • GovernanceEngineHandler

      public GovernanceEngineHandler(org.odpi.openmetadata.adminservices.configuration.properties.EngineConfig engineConfig, String serverName, String serverUserId, String engineServiceName, org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineConfigurationClient configurationClient, org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient serverClient, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog, int maxPageSize)
      Create a client-side object for calling a governance engine.
      Parameters:
      engineConfig - the properties of the governance engine.
      serverName - the name of the engine host server where the governance engine is running
      serverUserId - user id for the server to use
      engineServiceName - name of the OMES that is supporting this governance engine
      configurationClient - client to retrieve the configuration
      serverClient - client to control the execution of governance action requests
      auditLog - logging destination
      maxPageSize - maximum number of results that can be returned in a single request
  • Method Details

    • getGovernanceEngineName

      public String getGovernanceEngineName()
      Return the governance Engine name - used for error logging.
      Returns:
      governance engine name
    • getSummary

      public org.odpi.openmetadata.governanceservers.enginehostservices.properties.GovernanceEngineSummary getSummary()
      Return a summary of the governance engine
      Returns:
      governance engine summary
    • refreshConfig

      public void refreshConfig() throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Request that the governance engine refresh its configuration by calling the metadata server. This request ensures that the latest configuration is in use.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user id is not allowed to access configuration
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem in configuration server
    • refreshServiceConfig

      public void refreshServiceConfig(String registeredGovernanceServiceGUID, String specificRequestType) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Request that the governance engine refreshes its configuration for a single governance service by calling the metadata server. This request just ensures that the latest configuration is in use.
      Parameters:
      registeredGovernanceServiceGUID - unique identifier of the GovernanceService entity
      specificRequestType - specific request type to refresh
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user id is not allowed to access configuration
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem in configuration server
    • validateGovernanceEngineInitialized

      protected void validateGovernanceEngineInitialized(String expectedTypeName, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Validate that the governance engine is initialized. This is signified by the setting of the governance engine properties.
      Parameters:
      expectedTypeName - type of governance engine supported by the calling engine service
      methodName - calling method
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - governance engine is not initialized
    • getServiceCache

      protected GovernanceServiceCache getServiceCache(String governanceRequestType)
      Retrieve the governance service for the requested type.
      Parameters:
      governanceRequestType - governance request type.
      Returns:
      governance service
    • executeGovernanceAction

      public void executeGovernanceAction(String governanceActionGUID)
      Execute the requested governance action on or after the start time.
      Parameters:
      governanceActionGUID - unique identifier of potential governance action to run.
    • runGovernanceService

      public abstract GovernanceServiceHandler runGovernanceService(String governanceActionGUID, String governanceRequestType, Date startDate, Map<String,String> requestParameters, List<org.odpi.openmetadata.frameworks.governanceaction.properties.RequestSourceElement> requestSourceElements, List<org.odpi.openmetadata.frameworks.governanceaction.properties.ActionTargetElement> actionTargetElements) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Run an instance of a governance action service in its own thread and return the handler (for disconnect processing).
      Parameters:
      governanceActionGUID - unique identifier of the asset to analyse
      governanceRequestType - governance request type to use when calling the governance engine
      startDate - date/time to start the governance action service
      requestParameters - name-value properties to control the governance action service
      requestSourceElements - metadata elements associated with the request to the governance action service
      actionTargetElements - metadata elements that need to be worked on by the governance action service
      Returns:
      service handler for this request
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there was a problem detected by the governance action engine.
    • publishWatchdogEvent

      public void publishWatchdogEvent(org.odpi.openmetadata.frameworks.governanceaction.events.WatchdogGovernanceEvent watchdogGovernanceEvent) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Pass on the watchdog event to any governance service that supports them.
      Parameters:
      watchdogGovernanceEvent - element describing the changing metadata data.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - Vital fields of the governance action are not filled out
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the governance service is not permitted to execute the governance action
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem communicating with the open metadata stores
    • terminate

      public void terminate()
      Confirms termination of the governance engine.