Class GovernanceEngineHandler
java.lang.Object
org.odpi.openmetadata.governanceservers.enginehostservices.admin.GovernanceEngineHandler
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 org.odpi.openmetadata.frameworks.auditlog.AuditLogprotected Stringprotected Stringprotected Stringprotected org.odpi.openmetadata.accessservices.governanceengine.properties.GovernanceEnginePropertiesprotected intprotected org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClientprotected Stringprotected String -
Constructor Summary
ConstructorsConstructorDescriptionGovernanceEngineHandler(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 TypeMethodDescriptionvoidexecuteGovernanceAction(String governanceActionGUID) Execute the requested governance action on or after the start time.Return the governance Engine name - used for error logging.protected GovernanceServiceCachegetServiceCache(String governanceRequestType) Retrieve the governance service for the requested type.org.odpi.openmetadata.governanceservers.enginehostservices.properties.GovernanceEngineSummaryReturn a summary of the governance enginevoidpublishWatchdogEvent(org.odpi.openmetadata.frameworks.governanceaction.events.WatchdogGovernanceEvent watchdogGovernanceEvent) Pass on the watchdog event to any governance service that supports them.voidRequest that the governance engine refresh its configuration by calling the metadata server.voidrefreshServiceConfig(String registeredGovernanceServiceGUID, String specificRequestType) Request that the governance engine refreshes its configuration for a single governance service by calling the metadata server.abstract GovernanceServiceHandlerrunGovernanceService(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).voidConfirms termination of the governance engine.protected voidvalidateGovernanceEngineInitialized(String expectedTypeName, String methodName) Validate that the governance engine is initialized.
-
Field Details
-
serverName
-
serverUserId
-
serverClient
protected org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient serverClient -
engineUserId
-
auditLog
protected org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog -
maxPageSize
protected int maxPageSize -
governanceEngineName
-
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 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 governance 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
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.PropertyServerExceptionRequest 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 configurationorg.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 entityspecificRequestType- 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 configurationorg.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 servicemethodName- calling method- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- governance engine is not initialized
-
getServiceCache
Retrieve the governance service for the requested type.- Parameters:
governanceRequestType- governance request type.- Returns:
- governance service
-
executeGovernanceAction
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.PropertyServerExceptionRun 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 analysegovernanceRequestType- governance request type to use when calling the governance enginestartDate- date/time to start the governance action servicerequestParameters- name-value properties to control the governance action servicerequestSourceElements- metadata elements associated with the request to the governance action serviceactionTargetElements- 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 outorg.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException- the governance service is not permitted to execute the governance actionorg.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.
-