Class OpenGovernanceClientBase
java.lang.Object
org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
- All Implemented Interfaces:
ActionControlInterface,GovernanceActionProcessInterface,GovernanceCompletionInterface
- Direct Known Subclasses:
EgeriaOpenGovernanceClient,GovernanceContextClientBase
public class OpenGovernanceClientBase
extends OpenGovernanceClient
implements GovernanceCompletionInterface
OpenGovernanceClientBase provides common governance services that originate in the Open Governance Framework (OGF).
This includes the ability to define and execute governance action processes as well as manage duplicates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InvalidParameterHandlerprotected final GAFRESTClientFields inherited from class org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
propertyHelper, serverName, serverPlatformURLRoot -
Constructor Summary
ConstructorsConstructorDescriptionOpenGovernanceClientBase(String serverName, String serverPlatformURLRoot, String localServerSecretsStoreProvider, String localServerSecretsStoreLocation, String localServerSecretsStoreCollection, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelEngineAction(String userId, String engineActionGUID) Request that execution of an engine action is stopped.voidclaimEngineAction(String userId, String engineActionGUID) Request that execution of a governance action is allocated to the caller.getActiveClaimedEngineActions(String userId, String governanceEngineGUID, int startFrom, int pageSize) Retrieve the engine actions that are still in process and that have been claimed by this caller's userId.getActiveEngineActions(String userId, int startFrom, int pageSize) Retrieve the engine actions that are still in process.getEngineAction(String userId, String engineActionGUID) Request the status of an executing engine action request.getGovernanceActionProcessGraph(String userId, String processGUID, QueryOptions queryOptions) Retrieve the governance action process metadata element with the supplied unique identifier along with its process flow implementation.initiateEngineAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String, String> requestParameters, String processName, String iscQualifiedName, String requestSourceName, String originatorServiceName, String originatorEngineName) Create an engine action in the metadata store which will trigger the governance service associated with the supplied request type.initiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String, String> requestParameters, String originatorServiceName, String originatorEngineName, String iscQualifiedName) Using the named governance action process as a template, initiate a chain of engine actions.initiateGovernanceActionType(String userId, String governanceActionTypeQualifiedName, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String, String> requestParameters, String originatorServiceName, String originatorEngineName, String iscQualifiedName) Using the named governance action type as a template, initiate an engine action.voidrecordCompletionStatus(String userId, String engineActionGUID, Map<String, String> requestParameters, CompletionStatus status, List<String> outputGuards, List<NewActionTarget> newActionTargets, String completionMessage) Declare that all the processing for the governance action service is finished and the status of the work.voidupdateActionTargetStatus(String userId, String actionTargetGUID, ActivityStatus status, Date startDate, Date completionDate, String completionMessage) Update the status of a specific action target.voidupdateEngineActionStatus(String userId, String engineActionGUID, ActivityStatus activityStatus) Update the status of the governance action - providing the caller is permitted.Methods inherited from class org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
toString
-
Field Details
-
restClient
-
invalidParameterHandler
-
-
Constructor Details
-
OpenGovernanceClientBase
public OpenGovernanceClientBase(String serverName, String serverPlatformURLRoot, String localServerSecretsStoreProvider, String localServerSecretsStoreLocation, String localServerSecretsStoreCollection, int maxPageSize, AuditLog auditLog) 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 serviceslocalServerSecretsStoreProvider- secrets store connector for bearer tokenlocalServerSecretsStoreLocation- secrets store location for bearer tokenlocalServerSecretsStoreCollection- secrets store collection for bearer tokenmaxPageSize- pre-initialized parameter limitauditLog- logging destination- Throws:
InvalidParameterException- a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
initiateEngineAction
public String initiateEngineAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String, String> requestParameters, String processName, String iscQualifiedName, String requestSourceName, String originatorServiceName, String originatorEngineName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionCreate an engine action in the metadata store which will trigger the governance service associated with the supplied request type. The engine action remains to act as a record of the actions taken for auditing.- Specified by:
initiateEngineActionin interfaceActionControlInterface- Parameters:
userId- caller's userIdqualifiedName- unique identifier to give this engine actiondomainIdentifier- governance domain associated with this action (0=ALL)displayName- display name for this actiondescription- description for this actionactionSourceGUIDs- request source elements for the resulting engine actionactionCauseGUIDs- request cause elements for the resulting engine actionactionTargets- list of action target names to GUIDs for the resulting engine actionreceivedGuards- list of guards to initiate the engine actionstartTime- future start time or null for "as soon as possible"governanceEngineName- name of the governance engine that should execute the requestrequestType- governance request type from the callerrequestParameters- properties to pass to the governance serviceprocessName- name of the process that this action is a part ofiscQualifiedName- unique name of an information supply chainrequestSourceName- source of the requestoriginatorServiceName- unique name of the requesting governance service (if initiated by a governance engine).originatorEngineName- optional unique name of the requesting governance engine (if initiated by a governance engine).- Returns:
- unique identifier of the engine action
- Throws:
InvalidParameterException- null qualified nameUserNotAuthorizedException- the caller is not authorized to create an engine actionPropertyServerException- a problem with the metadata store
-
initiateGovernanceActionType
public String initiateGovernanceActionType(String userId, String governanceActionTypeQualifiedName, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String, String> requestParameters, String originatorServiceName, String originatorEngineName, String iscQualifiedName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionUsing the named governance action type as a template, initiate an engine action.- Specified by:
initiateGovernanceActionTypein interfaceActionControlInterface- Parameters:
userId- caller's userIdgovernanceActionTypeQualifiedName- unique name of the governance action type to useactionSourceGUIDs- request source elements for the resulting engine actionactionCauseGUIDs- request cause elements for the resulting engine actionactionTargets- list of action target names to GUIDs for the resulting engine actionstartTime- future start time or null for "as soon as possible".requestParameters- request properties to be passed to the engine actionoriginatorServiceName- unique name of the requesting governance service (if initiated by a governance engine).originatorEngineName- optional unique name of the governance engine (if initiated by a governance engine).iscQualifiedName- unique name of an information supply chain- Returns:
- unique identifier of the engine action
- Throws:
InvalidParameterException- null or unrecognized qualified name of the typeUserNotAuthorizedException- the caller is not authorized to create an engine actionPropertyServerException- a problem with the metadata store
-
initiateGovernanceActionProcess
public String initiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String, String> requestParameters, String originatorServiceName, String originatorEngineName, String iscQualifiedName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionUsing the named governance action process as a template, initiate a chain of engine actions.- Specified by:
initiateGovernanceActionProcessin interfaceActionControlInterface- Parameters:
userId- caller's userIdprocessQualifiedName- unique name of the governance action process to useactionSourceGUIDs- request source elements for the resulting engine actionactionCauseGUIDs- request cause elements for the resulting engine actionactionTargets- list of action target names to GUIDs for the resulting engine actionstartTime- future start time or null for "as soon as possible".requestParameters- request properties to be passed to the first engine actionoriginatorServiceName- unique name of the requesting governance service (if initiated by a governance engine).originatorEngineName- optional unique name of the governance engine (if initiated by a governance engine).iscQualifiedName- unique name of an information supply chain- Returns:
- unique identifier of the governance action process instance
- Throws:
InvalidParameterException- null or unrecognized qualified name of the processUserNotAuthorizedException- the caller is not authorized to create a governance action processPropertyServerException- a problem with the metadata store
-
getEngineAction
public EngineActionElement getEngineAction(String userId, String engineActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request the status of an executing engine action request.- Specified by:
getEngineActionin interfaceActionControlInterface- Parameters:
userId- identifier of calling userengineActionGUID- identifier of the engine action request.- Returns:
- status enum
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- the user is not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
cancelEngineAction
public void cancelEngineAction(String userId, String engineActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request that execution of an engine action is stopped.- Specified by:
cancelEngineActionin interfaceActionControlInterface- Parameters:
userId- identifier of calling userengineActionGUID- identifier of the engine action request.- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- the user is not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
getActiveEngineActions
public List<EngineActionElement> getActiveEngineActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the engine actions that are still in process.- Specified by:
getActiveEngineActionsin interfaceActionControlInterface- Parameters:
userId- userId of callerstartFrom- starting from positionpageSize- maximum elements to return- Returns:
- list of engine action elements
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- the user is not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
updateEngineActionStatus
public void updateEngineActionStatus(String userId, String engineActionGUID, ActivityStatus activityStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the status of the governance action - providing the caller is permitted.- Specified by:
updateEngineActionStatusin interfaceGovernanceCompletionInterface- Parameters:
userId- identifier of calling userengineActionGUID- identifier of the governance action requestactivityStatus- new status enum- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- the user is not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
claimEngineAction
public void claimEngineAction(String userId, String engineActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request that execution of a governance action is allocated to the caller.- Specified by:
claimEngineActionin interfaceGovernanceCompletionInterface- Parameters:
userId- identifier of calling userengineActionGUID- identifier of the governance action request.- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- the user is not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
getActiveClaimedEngineActions
public List<EngineActionElement> getActiveClaimedEngineActions(String userId, String governanceEngineGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the engine 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:
getActiveClaimedEngineActionsin interfaceGovernanceCompletionInterface- Parameters:
userId- userId of callergovernanceEngineGUID- unique identifier of governance enginestartFrom- starting from positionpageSize- maximum elements to return- Returns:
- list of governance action elements
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- the user is not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
updateActionTargetStatus
public void updateActionTargetStatus(String userId, String actionTargetGUID, ActivityStatus 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.- Specified by:
updateActionTargetStatusin interfaceGovernanceCompletionInterface- Parameters:
userId- caller's userIdactionTargetGUID- 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- a problem connecting to the metadata store
-
recordCompletionStatus
public void recordCompletionStatus(String userId, String engineActionGUID, Map<String, String> requestParameters, CompletionStatus status, List<String> outputGuards, 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.- Specified by:
recordCompletionStatusin interfaceGovernanceCompletionInterface- Parameters:
userId- caller's userIdengineActionGUID- unique identifier of the governance action to updaterequestParameters- request properties from the caller (will be passed onto any follow-on actions)status- completion status enum valueoutputGuards- optional guard strings for triggering subsequent action(s)newActionTargets- list 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- a problem connecting to the metadata store
-
getGovernanceActionProcessGraph
public GovernanceActionProcessGraph getGovernanceActionProcessGraph(String userId, String processGUID, QueryOptions queryOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance action process metadata element with the supplied unique identifier along with its process flow implementation. This includes the process steps and the links between them- Specified by:
getGovernanceActionProcessGraphin interfaceGovernanceActionProcessInterface- Parameters:
userId- calling userprocessGUID- unique identifier of the requested metadata elementqueryOptions- effective date/time for query- Returns:
- requested metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- a problem reported in the open metadata server(s)
-