Class GovernanceEngineHandler
java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler
- Direct Known Subclasses:
DiscoveryEngineHandler
,GovernanceActionEngineHandler
,RepositoryGovernanceEngineHandler
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
FieldsModifier and TypeFieldDescriptionprotected AuditLog
protected String
protected String
protected String
protected GovernanceEngineProperties
protected int
protected GovernanceContextClient
protected String
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionGovernanceEngineHandler
(EngineConfig engineConfig, String serverName, String serverUserId, String engineServiceName, GovernanceEngineConfigurationClient configurationClient, GovernanceContextClient serverClient, AuditLog auditLog, int maxPageSize) Create a client-side object for calling a governance engine. -
Method Summary
Modifier and TypeMethodDescriptionvoid
executeEngineAction
(String engineActionGUID) Execute the requested governance action on or after the start time.Return the governance Engine name - used for error logging.protected GovernanceServiceCache
getServiceCache
(String governanceRequestType) Retrieve the governance service for the requested type.Return a summary of the governance enginevoid
publishWatchdogEvent
(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.abstract GovernanceServiceHandler
runGovernanceService
(String engineActionGUID, String governanceRequestType, Date startDate, Map<String, String> requestParameters, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements) Run an instance of a governance 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.
-
Field Details
-
serverName
-
serverUserId
-
serverClient
-
engineUserId
-
auditLog
-
maxPageSize
protected int maxPageSize -
governanceEngineName
-
governanceEngineGUID
-
governanceEngineProperties
-
-
Constructor Details
-
GovernanceEngineHandler
public GovernanceEngineHandler(EngineConfig engineConfig, String serverName, String serverUserId, String engineServiceName, GovernanceEngineConfigurationClient configurationClient, GovernanceContextClient serverClient, 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 runningserverUserId
- user id for the server to useengineServiceName
- name of the OMES that is supporting this governance engineconfigurationClient
- client to retrieve the configurationserverClient
- client to control the execution of engine action requestsauditLog
- logging destinationmaxPageSize
- maximum number of results that can be returned in a single request
-
-
Method Details
-
getGovernanceEngineName
Return the governance Engine name - used for error logging.- Returns:
- governance engine name
-
getSummary
Return a summary of the governance engine- Returns:
- governance engine summary
-
refreshConfig
public void refreshConfig() throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRequest that the governance engine refresh its configuration by calling the metadata server. This request ensures that the latest configuration is in use.- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user id is not allowed to access configurationPropertyServerException
- problem in configuration server
-
refreshServiceConfig
public void refreshServiceConfig(String registeredGovernanceServiceGUID, String specificRequestType) throws InvalidParameterException, UserNotAuthorizedException, 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 entityspecificRequestType
- specific request type to refresh- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user id is not allowed to access configurationPropertyServerException
- problem in configuration server
-
validateGovernanceEngineInitialized
protected void validateGovernanceEngineInitialized(String expectedTypeName, String methodName) throws 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 servicemethodName
- calling method- Throws:
PropertyServerException
- governance engine is not initialized
-
getServiceCache
Retrieve the governance service for the requested type.- Parameters:
governanceRequestType
- governance request type.- Returns:
- governance service
-
executeEngineAction
Execute the requested governance action on or after the start time.- Parameters:
engineActionGUID
- unique identifier of potential governance action to run.
-
runGovernanceService
public abstract GovernanceServiceHandler runGovernanceService(String engineActionGUID, String governanceRequestType, Date startDate, Map<String, String> requestParameters, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionRun an instance of a governance service in its own thread and return the handler (for disconnect processing).- Parameters:
engineActionGUID
- unique identifier of the engine actiongovernanceRequestType
- governance request type to use when calling the governance enginestartDate
- date/time to start the governance servicerequestParameters
- name-value properties to control the governance servicerequestSourceElements
- metadata elements associated with the request to the governance serviceactionTargetElements
- metadata elements that need to be worked on by the governance service- Returns:
- service handler for this request
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.UserNotAuthorizedException
- user not authorized to issue this request.PropertyServerException
- there was a problem detected by the governance engine.
-
publishWatchdogEvent
public void publishWatchdogEvent(WatchdogGovernanceEvent watchdogGovernanceEvent) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Pass on the watchdog event to any governance service that supports them.- Parameters:
watchdogGovernanceEvent
- element describing the changing metadata data.- Throws:
InvalidParameterException
- Vital fields of the engine action are not filled outUserNotAuthorizedException
- the governance service is not permitted to execute the engine actionPropertyServerException
- there is a problem communicating with the open metadata stores
-
terminate
public void terminate()Confirms termination of the governance engine.
-