Class GovernanceServiceHandler
java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceServiceHandler
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
DiscoveryServiceHandler
,GovernanceActionServiceHandler
,RepositoryGovernanceServiceHandler
GovernanceServiceHandler provides the thread to run a governance service. A new instance is created for each request.
The subclasses implement the run method.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disconnect the governance action service.Return the unique name for the hosting governance engine.Return the unique identifier of this governance service.Return the unique name of this governance service.void
recordCompletionStatus
(CompletionStatus status, List<String> outputGuards, Map<String, String> requestParameters, List<NewActionTarget> newActionTargets, String completionMessage) Declare that all the processing for the governance action service is finished and the status of the work.void
updateActionTargetStatus
(String actionTargetGUID, GovernanceActionStatus status, Date startDate, Date completionDate, String completionMessage) Update the status of a specific action target.
-
Field Details
-
governanceEngineProperties
-
governanceEngineGUID
-
engineHostUserId
-
governanceServiceGUID
-
governanceServiceName
-
governanceService
-
governanceActionGUID
-
serviceRequestType
-
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 logginggovernanceEngineGUID
- unique identifier of the governance engine - used for message loggingengineHostUserId
- userId for making updates to the governance actionsgovernanceActionGUID
- unique identifier of the governance action that triggered this governance servicegovernanceActionClient
- client for processing governance actionsserviceRequestType
- incoming request typegovernanceServiceGUID
- unique identifier of the governance servicegovernanceServiceName
- name of this governance service - used for message logginggovernanceService
- implementation of governance serviceauditLog
- destination for log messages
-
-
Method Details
-
getGovernanceServiceName
Return the unique name of this governance service.- Returns:
- string name
-
getGovernanceServiceGUID
Return the unique identifier of this governance service.- Returns:
- string guid
-
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 progressstartDate
- date/time that the governance action service started processing the targetcompletionDate
- 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 recognizedUserNotAuthorizedException
- the governance action service is not authorized to update the action target propertiesPropertyServerException
- 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, PropertyServerExceptionDeclare that all the processing for the governance action service is finished and the status of the work.- Parameters:
status
- completion status enum valueoutputGuards
- optional guard strings for triggering subsequent action(s)requestParameters
- properties to pass to the next governance action servicenewActionTargets
- map of action target names to GUIDs for the resulting governance action servicecompletionMessage
- message to describe completion results or reasons for failure- Throws:
InvalidParameterException
- the completion status is nullUserNotAuthorizedException
- the governance action service is not authorized to update the governance action service statusPropertyServerException
- there is a problem connecting to the metadata store
-
disconnect
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
-