Class GovernanceEngineClient
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.client.OpenGovernanceClient
org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient
- All Implemented Interfaces:
GovernanceProcessingInterface
,GovernanceCompletionInterface
,SpecialGovernanceActionInterface
public class GovernanceEngineClient
extends OpenGovernanceClientBase
implements GovernanceProcessingInterface
GovernanceEngineClient sits in the governance context of a governance action service when it is running in the engine host OMAG server.
It is however shared by all the governance action services running in an engine service so that we only need one connector to the topic
listener for the watchdog governance services.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
governanceListenerManager, invalidParameterHandler, listenerId
Fields inherited from class org.odpi.openmetadata.frameworks.governanceaction.client.OpenGovernanceClient
serverName, serverPlatformURLRoot
-
Constructor Summary
ConstructorsConstructorDescriptionGovernanceEngineClient
(String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request.GovernanceEngineClient
(String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword) Create a new client that passes userId and password in each HTTP request.GovernanceEngineClient
(String serverName, String serverPlatformURLRoot, GovernanceEngineRESTClient restClient, int maxPageSize) Create a new client that passes userId and password in each HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoid
claimGovernanceAction
(String userId, String governanceActionGUID) Request that execution of a governance action is allocated to the caller.findGovernanceActions
(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of governance action type metadata elements that contain the search string.getActiveClaimedGovernanceActions
(String userId, String governanceEngineGUID, int startFrom, int pageSize) Retrieve the governance actions that are still in process and that have been claimed by this caller's userId.getActiveGovernanceActions
(String userId, int startFrom, int pageSize) Retrieve the governance actions that are still in process.getGovernanceAction
(String userId, String governanceActionGUID) Request the status of an executing governance action request.getGovernanceActions
(String userId, int startFrom, int pageSize) Retrieve the governance actions known to the server.getGovernanceActionsByName
(String userId, String name, int startFrom, int pageSize) Retrieve the list of governance action type metadata elements with a matching qualified or display name.void
updateGovernanceActionStatus
(String userId, String governanceActionGUID, GovernanceActionStatus governanceActionStatus) Update the status of the governance action - providing the caller is permitted.Methods inherited from class org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
disconnectListener, initiateGovernanceAction, initiateGovernanceActionProcess, linkConsolidatedDuplicate, linkElementsAsPeerDuplicates, recordCompletionStatus, registerListener, setListenerManager, updateActionTargetStatus
Methods inherited from class org.odpi.openmetadata.frameworks.governanceaction.client.OpenGovernanceClient
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.odpi.openmetadata.accessservices.governanceengine.api.GovernanceProcessingInterface
recordCompletionStatus, updateActionTargetStatus
-
Constructor Details
-
GovernanceEngineClient
public GovernanceEngineClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName
- name of the server to connect toserverPlatformURLRoot
- the network address of the server running the OMAS REST services- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceEngineClient
public GovernanceEngineClient(String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword) throws InvalidParameterException Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName
- name of the server to connect toserverPlatformURLRoot
- the network address of the server running the OMAS REST servicesserverUserId
- caller's userId embedded in all HTTP requestsserverPassword
- caller's password embedded in all HTTP requests- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceEngineClient
public GovernanceEngineClient(String serverName, String serverPlatformURLRoot, GovernanceEngineRESTClient restClient, int maxPageSize) throws InvalidParameterException Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName
- name of the server to connect toserverPlatformURLRoot
- the network address of the server running the OMAS REST servicesrestClient
- pre-initialized REST clientmaxPageSize
- pre-initialized parameter limit- Throws:
InvalidParameterException
- there is a problem with the information about the remote OMAS
-
-
Method Details
-
updateGovernanceActionStatus
public void updateGovernanceActionStatus(String userId, String governanceActionGUID, GovernanceActionStatus governanceActionStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the status of the governance action - providing the caller is permitted.- Specified by:
updateGovernanceActionStatus
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- identifier of calling usergovernanceActionGUID
- identifier of the governance action requestgovernanceActionStatus
- new status enum- 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 metadata store.
-
getGovernanceAction
public GovernanceActionElement getGovernanceAction(String userId, String governanceActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request the status of an executing governance action request.- Specified by:
getGovernanceAction
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- identifier of calling usergovernanceActionGUID
- identifier of the governance action request.- Returns:
- status enum
- 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 metadata store.
-
claimGovernanceAction
public void claimGovernanceAction(String userId, String governanceActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request that execution of a governance action is allocated to the caller.- Specified by:
claimGovernanceAction
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- identifier of calling usergovernanceActionGUID
- identifier of the governance action 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 metadata store.
-
getGovernanceActions
public List<GovernanceActionElement> getGovernanceActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance actions known to the server.- Specified by:
getGovernanceActions
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- userId of callerstartFrom
- starting from elementpageSize
- maximum elements to return- Returns:
- list of governance action elements
- 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 metadata store.
-
getActiveGovernanceActions
public List<GovernanceActionElement> getActiveGovernanceActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance actions that are still in process.- Specified by:
getActiveGovernanceActions
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- userId of callerstartFrom
- starting from elementpageSize
- maximum elements to return- Returns:
- list of governance action elements
- 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 metadata store.
-
getActiveClaimedGovernanceActions
public List<GovernanceActionElement> getActiveClaimedGovernanceActions(String userId, String governanceEngineGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance actions that are still in process and that have been claimed by this caller's userId. This call is used when the caller restarts.- Specified by:
getActiveClaimedGovernanceActions
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- userId of callergovernanceEngineGUID
- unique identifier of governance enginestartFrom
- starting from elementpageSize
- maximum elements to return- Returns:
- list of governance action elements
- 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 metadata store.
-
findGovernanceActions
public List<GovernanceActionElement> findGovernanceActions(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of governance action type metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findGovernanceActions
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- calling usersearchString
- string to find in the propertiesstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getGovernanceActionsByName
public List<GovernanceActionElement> getGovernanceActionsByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of governance action type metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getGovernanceActionsByName
in interfaceGovernanceProcessingInterface
- Parameters:
userId
- calling username
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-