Class GovernanceActionProcessClient
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceActionProcessClient
-
- All Implemented Interfaces:
GovernanceActionProcessInterface
public class GovernanceActionProcessClient extends Object implements GovernanceActionProcessInterface
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 of 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.
-
-
Constructor Summary
Constructors Constructor Description GovernanceActionProcessClient(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.GovernanceActionProcessClient(String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword)Create a new client that passes userId and password in each HTTP request.GovernanceActionProcessClient(String serverName, String serverPlatformURLRoot, GovernanceEngineRESTClient restClient, int maxPageSize)Create a new client that passes userId and password in each HTTP request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateGovernanceActionProcess(String userId, GovernanceActionProcessProperties processProperties, ProcessStatus initialStatus)Create a new metadata element to represent a governance action process.StringcreateGovernanceActionType(String userId, GovernanceActionTypeProperties actionTypeProperties)Create a new metadata element to represent a governance action type.List<GovernanceActionProcessElement>findGovernanceActionProcesses(String userId, String searchString, int startFrom, int pageSize)Retrieve the list of governance action process metadata elements that contain the search string.List<GovernanceActionTypeElement>findGovernanceActionTypes(String userId, String searchString, int startFrom, int pageSize)Retrieve the list of governance action type metadata elements that contain the search string.GovernanceActionTypeElementgetFirstActionType(String userId, String processGUID)Return the governance action type that is the first step in a governance action process.GovernanceActionProcessElementgetGovernanceActionProcessByGUID(String userId, String processGUID)Retrieve the governance action process metadata element with the supplied unique identifier.List<GovernanceActionProcessElement>getGovernanceActionProcessesByName(String userId, String name, int startFrom, int pageSize)Retrieve the list of governance action process metadata elements with a matching qualified or display name.GovernanceActionTypeElementgetGovernanceActionTypeByGUID(String userId, String actionTypeGUID)Retrieve the governance action type metadata element with the supplied unique identifier.List<GovernanceActionTypeElement>getGovernanceActionTypesByName(String userId, String name, int startFrom, int pageSize)Retrieve the list of governance action type metadata elements with a matching qualified or display name.List<NextGovernanceActionTypeElement>getNextGovernanceActionTypes(String userId, String actionTypeGUID, int startFrom, int pageSize)Return the lust of next action type defined for the governance action process.voidpublishGovernanceActionProcess(String userId, String processGUID)Update the zones for the asset so that it becomes visible to consumers.voidremoveFirstActionType(String userId, String processGUID)Remove the link between a governance process and that governance action type that defines its first step.voidremoveGovernanceActionProcess(String userId, String processGUID)Remove the metadata element representing a governance action process.voidremoveGovernanceActionType(String userId, String actionTypeGUID)Remove the metadata element representing a governance action type.voidremoveNextActionType(String userId, String actionLinkGUID)Remove a follow on step from a governance action process.voidsetupFirstActionType(String userId, String processGUID, String actionTypeGUID, String guard)Set up a link between an governance action process and a governance action type.StringsetupNextActionType(String userId, String currentActionTypeGUID, String nextActionTypeGUID, String guard, boolean mandatoryGuard, boolean ignoreMultipleTriggers)Add a link between two governance action types to show that one follows on from the other when a governance action process is executing.voidupdateGovernanceActionProcess(String userId, String processGUID, boolean isMergeUpdate, ProcessStatus processStatus, GovernanceActionProcessProperties processProperties)Update the metadata element representing a governance action process.voidupdateGovernanceActionType(String userId, String actionTypeGUID, boolean isMergeUpdate, GovernanceActionTypeProperties actionTypeProperties)Update the metadata element representing a governance action type.voidupdateNextActionType(String userId, String nextActionLinkGUID, String guard, boolean mandatoryGuard, boolean ignoreMultipleTriggers)Update the properties of the link between two governance action types that shows that one follows on from the other when a governance action process is executing.voidwithdrawGovernanceActionProcess(String userId, String processGUID)Update the zones for the asset so that it is no longer visible to consumers.
-
-
-
Constructor Detail
-
GovernanceActionProcessClient
public GovernanceActionProcessClient(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 servers- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceActionProcessClient
public GovernanceActionProcessClient(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 serversserverUserId- caller's userId embedded in all HTTP requestsserverPassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceActionProcessClient
public GovernanceActionProcessClient(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 serversrestClient- pre-initialized REST clientmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- there is a problem with the information about the remote OMAS
-
-
Method Detail
-
createGovernanceActionProcess
public String createGovernanceActionProcess(String userId, GovernanceActionProcessProperties processProperties, ProcessStatus initialStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element to represent a governance action process.- Specified by:
createGovernanceActionProcessin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessProperties- properties about the process to storeinitialStatus- status value for the new process (default = ACTIVE)- Returns:
- unique identifier of the new process
- 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)
-
updateGovernanceActionProcess
public void updateGovernanceActionProcess(String userId, String processGUID, boolean isMergeUpdate, ProcessStatus processStatus, GovernanceActionProcessProperties processProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the metadata element representing a governance action process.- Specified by:
updateGovernanceActionProcessin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the metadata element to updateisMergeUpdate- should the new properties be merged with existing properties (true) or completely replace them (false)?processStatus- new status for the processprocessProperties- new properties for the metadata element- 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)
-
publishGovernanceActionProcess
public void publishGovernanceActionProcess(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the zones for the asset so that it becomes visible to consumers. (The zones are set to the list of zones in the publishedZones option configured for each instance of the Governance Engine OMAS).- Specified by:
publishGovernanceActionProcessin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the metadata element to publish- 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)
-
withdrawGovernanceActionProcess
public void withdrawGovernanceActionProcess(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the zones for the asset so that it is no longer visible to consumers. (The zones are set to the list of zones in the defaultZones option configured for each instance of the Governance Engine OMAS. This is the setting when the process is first created).- Specified by:
withdrawGovernanceActionProcessin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the metadata element to withdraw- 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)
-
removeGovernanceActionProcess
public void removeGovernanceActionProcess(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the metadata element representing a governance action process.- Specified by:
removeGovernanceActionProcessin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the metadata element to remove- 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)
-
findGovernanceActionProcesses
public List<GovernanceActionProcessElement> findGovernanceActionProcesses(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of governance action process metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findGovernanceActionProcessesin interfaceGovernanceActionProcessInterface- 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)
-
getGovernanceActionProcessesByName
public List<GovernanceActionProcessElement> getGovernanceActionProcessesByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of governance action process metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getGovernanceActionProcessesByNamein interfaceGovernanceActionProcessInterface- 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)
-
getGovernanceActionProcessByGUID
public GovernanceActionProcessElement getGovernanceActionProcessByGUID(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance action process metadata element with the supplied unique identifier.- Specified by:
getGovernanceActionProcessByGUIDin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the requested metadata element- Returns:
- requested metadata element
- 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)
-
createGovernanceActionType
public String createGovernanceActionType(String userId, GovernanceActionTypeProperties actionTypeProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element to represent a governance action type.- Specified by:
createGovernanceActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling useractionTypeProperties- properties about the process to store- Returns:
- unique identifier of the new governance action type
- 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)
-
updateGovernanceActionType
public void updateGovernanceActionType(String userId, String actionTypeGUID, boolean isMergeUpdate, GovernanceActionTypeProperties actionTypeProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the metadata element representing a governance action type.- Specified by:
updateGovernanceActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling useractionTypeGUID- unique identifier of the metadata element to updateisMergeUpdate- should the new properties be merged with existing properties (true) or completely replace them (false)?actionTypeProperties- new properties for the metadata element- 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)
-
removeGovernanceActionType
public void removeGovernanceActionType(String userId, String actionTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the metadata element representing a governance action type.- Specified by:
removeGovernanceActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling useractionTypeGUID- unique identifier of the metadata element to remove- 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)
-
findGovernanceActionTypes
public List<GovernanceActionTypeElement> findGovernanceActionTypes(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:
findGovernanceActionTypesin interfaceGovernanceActionProcessInterface- 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)
-
getGovernanceActionTypesByName
public List<GovernanceActionTypeElement> getGovernanceActionTypesByName(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:
getGovernanceActionTypesByNamein interfaceGovernanceActionProcessInterface- 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)
-
getGovernanceActionTypeByGUID
public GovernanceActionTypeElement getGovernanceActionTypeByGUID(String userId, String actionTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance action type metadata element with the supplied unique identifier.- Specified by:
getGovernanceActionTypeByGUIDin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling useractionTypeGUID- unique identifier of the governance action type- Returns:
- requested metadata element
- 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)
-
setupFirstActionType
public void setupFirstActionType(String userId, String processGUID, String actionTypeGUID, String guard) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Set up a link between an governance action process and a governance action type. This defines the first step in the process.- Specified by:
setupFirstActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the governance action processactionTypeGUID- unique identifier of the governance action typeguard- optional guard for the first governance service to run- 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)
-
getFirstActionType
public GovernanceActionTypeElement getFirstActionType(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return the governance action type that is the first step in a governance action process.- Specified by:
getFirstActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the governance action process- Returns:
- properties of the governance action type
- 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)
-
removeFirstActionType
public void removeFirstActionType(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the link between a governance process and that governance action type that defines its first step.- Specified by:
removeFirstActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the governance action process- 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)
-
setupNextActionType
public String setupNextActionType(String userId, String currentActionTypeGUID, String nextActionTypeGUID, String guard, boolean mandatoryGuard, boolean ignoreMultipleTriggers) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Add a link between two governance action types to show that one follows on from the other when a governance action process is executing.- Specified by:
setupNextActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling usercurrentActionTypeGUID- unique identifier of the governance action type that defines the previous step in the governance action processnextActionTypeGUID- unique identifier of the governance action type that defines the next step in the governance action processguard- guard required for this next step to proceed - or null for always run the next step.mandatoryGuard- means that no next steps can run if this guard is not returnedignoreMultipleTriggers- prevent multiple instances of the next step to run (or not)- Returns:
- unique identifier of the new link
- 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)
-
updateNextActionType
public void updateNextActionType(String userId, String nextActionLinkGUID, String guard, boolean mandatoryGuard, boolean ignoreMultipleTriggers) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties of the link between two governance action types that shows that one follows on from the other when a governance action process is executing.- Specified by:
updateNextActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling usernextActionLinkGUID- unique identifier of the relationship between the governance action typesguard- guard required for this next step to proceed - or null for always run the next step.mandatoryGuard- means that no next steps can run if this guard is not returnedignoreMultipleTriggers- prevent multiple instances of the next step to run (or not)- 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)
-
getNextGovernanceActionTypes
public List<NextGovernanceActionTypeElement> getNextGovernanceActionTypes(String userId, String actionTypeGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return the lust of next action type defined for the governance action process.- Specified by:
getNextGovernanceActionTypesin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling useractionTypeGUID- unique identifier of the current governance action typestartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- return the list of relationships and attached governance action types.
- 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)
-
removeNextActionType
public void removeNextActionType(String userId, String actionLinkGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove a follow on step from a governance action process.- Specified by:
removeNextActionTypein interfaceGovernanceActionProcessInterface- Parameters:
userId- calling useractionLinkGUID- unique identifier of the relationship between the governance action types- 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)
-
-