java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceServiceHandler
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DiscoveryServiceHandler, GovernanceActionServiceHandler, RepositoryGovernanceServiceHandler

public abstract class GovernanceServiceHandler extends Object implements Runnable
GovernanceServiceHandler provides the thread to run a governance service. A new instance is created for each request. The subclasses implement the run method.
  • Field Details

    • governanceEngineProperties

      protected GovernanceEngineProperties governanceEngineProperties
    • governanceEngineGUID

      protected String governanceEngineGUID
    • engineHostUserId

      protected String engineHostUserId
    • governanceServiceGUID

      protected String governanceServiceGUID
    • governanceServiceName

      protected String governanceServiceName
    • governanceService

      protected Connector governanceService
    • governanceActionGUID

      protected String governanceActionGUID
    • serviceRequestType

      protected String serviceRequestType
    • auditLog

      protected AuditLog auditLog
  • Constructor Details

    • GovernanceServiceHandler

      protected GovernanceServiceHandler(GovernanceEngineProperties governanceEngineProperties, String governanceEngineGUID, String engineHostUserId, String governanceActionGUID, GovernanceEngineClient governanceActionClient, String serviceRequestType, String governanceServiceGUID, String governanceServiceName, Connector governanceService, AuditLog auditLog)
      Constructor sets up the key parameters for running the governance action service. This call is made on the REST call's thread so the properties are just cached. The action happens in the run() method.
      Parameters:
      governanceEngineProperties - properties of the governance engine - used for message logging
      governanceEngineGUID - unique identifier of the governance engine - used for message logging
      engineHostUserId - userId for making updates to the governance actions
      governanceActionGUID - unique identifier of the governance action that triggered this governance service
      governanceActionClient - client for processing governance actions
      serviceRequestType - incoming request type
      governanceServiceGUID - unique identifier of the governance service
      governanceServiceName - name of this governance service - used for message logging
      governanceService - implementation of governance service
      auditLog - destination for log messages
  • Method Details

    • getGovernanceServiceName

      public String getGovernanceServiceName()
      Return the unique name of this governance service.
      Returns:
      string name
    • getGovernanceServiceGUID

      public String getGovernanceServiceGUID()
      Return the unique identifier of this governance service.
      Returns:
      string guid
    • getGovernanceEngineName

      public String getGovernanceEngineName()
      Return the unique name for the hosting governance engine.
      Returns:
      string name
    • updateActionTargetStatus

      public void updateActionTargetStatus(String actionTargetGUID, GovernanceActionStatus status, Date startDate, Date completionDate, String completionMessage) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Update the status of a specific action target. By default, these values are derived from the values for the governance action service. However, if the governance action service has to process name target elements, then setting the status on each individual target will show the progress of the governance action service.
      Parameters:
      actionTargetGUID - unique identifier of the governance action service.
      status - status enum to show its progress
      startDate - date/time that the governance action service started processing the target
      completionDate - date/time that the governance process completed processing this target.
      completionMessage - message to describe completion results or reasons for failure
      Throws:
      InvalidParameterException - the action target GUID is not recognized
      UserNotAuthorizedException - the governance action service is not authorized to update the action target properties
      PropertyServerException - there is a problem connecting to the metadata store
    • recordCompletionStatus

      public void recordCompletionStatus(CompletionStatus status, List<String> outputGuards, Map<String,String> requestParameters, List<NewActionTarget> newActionTargets, String completionMessage) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Declare that all the processing for the governance action service is finished and the status of the work.
      Parameters:
      status - completion status enum value
      outputGuards - optional guard strings for triggering subsequent action(s)
      requestParameters - properties to pass to the next governance action service
      newActionTargets - map of action target names to GUIDs for the resulting governance action service
      completionMessage - message to describe completion results or reasons for failure
      Throws:
      InvalidParameterException - the completion status is null
      UserNotAuthorizedException - the governance action service is not authorized to update the governance action service status
      PropertyServerException - there is a problem connecting to the metadata store
    • disconnect

      public void disconnect() throws ConnectorCheckedException
      Disconnect the governance action service. Called because the governance action service had set a completion status or the server is shutting down.
      Throws:
      ConnectorCheckedException - connector is in trouble