Class OpenGovernanceClientBase
java.lang.Object
org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
- All Implemented Interfaces:
ActionControlInterface,DuplicateManagementInterface,GovernanceActionProcessInterface
- Direct Known Subclasses:
EgeriaOpenGovernanceClient,GovernanceContextClientBase
OpenGovernanceClientBase provides common governance services that originate in the Open Survey 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 NullRequestBodyFields inherited from class org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
propertyHelper, serverName, serverPlatformURLRoot, serviceURLMarker -
Constructor Summary
ConstructorsConstructorDescriptionOpenGovernanceClientBase(String serviceURLMarker, String serverName, String serverPlatformURLRoot, int maxPageSize) Create a new client with no authentication embedded in the HTTP request.OpenGovernanceClientBase(String serviceURLMarker, String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword, int maxPageSize) Create a new client that passes userId and password in each HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelEngineAction(String userId, String engineActionGUID) Request that execution of an engine action is stopped.findEngineActions(String userId, String searchString, SearchOptions searchOptions) Retrieve the list of engine action metadata elements that contain the search string.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.getEngineActionsByName(String userId, String name, QueryOptions queryOptions) Retrieve the list of engine action metadata elements with a matching qualified or display name.getGovernanceActionProcessGraph(String userId, String processGUID, Date effectiveTime) 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 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) 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) Using the named governance action type as a template, initiate an engine action.voidlinkConsolidatedDuplicate(String userId, String consolidatedElementGUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, List<String> sourceElementGUIDs) Identify an element that acts as a consolidated version for a set of duplicate elements.voidlinkElementsAsPeerDuplicates(String userId, String metadataElement1GUID, String metadataElement2GUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, boolean setKnownDuplicate) Link elements as peer duplicates.Methods inherited from class org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
toString
-
Field Details
-
invalidParameterHandler
-
nullRequestBody
-
-
Constructor Details
-
OpenGovernanceClientBase
public OpenGovernanceClientBase(String serviceURLMarker, String serverName, String serverPlatformURLRoot, int maxPageSize) throws InvalidParameterException Create a new client with no authentication embedded in the HTTP request.- Parameters:
serviceURLMarker- the identifier of the access service (for example asset-owner for the Asset Owner OMAS)serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servicesmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
OpenGovernanceClientBase
public OpenGovernanceClientBase(String serviceURLMarker, String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword, 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:
serviceURLMarker- the identifier of the access service (for example asset-owner for the Asset Owner OMAS)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 requestsmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- there is 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 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.- 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 ofrequestSourceName- 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- there is 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) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionUsing the named governance action type as a template, initiate an engine action.- 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).- 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- there is 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) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionUsing the named governance action process as a template, initiate a chain of engine actions.- 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).- 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- there is 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.- 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- user 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.- Parameters:
userId- identifier of calling userengineActionGUID- identifier of the engine 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.
-
getActiveEngineActions
public List<EngineActionElement> getActiveEngineActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the engine actions that are still in process.- Parameters:
userId- userId of callerstartFrom- starting from elementpageSize- maximum elements to return- Returns:
- list of engine 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.
-
findEngineActions
public List<EngineActionElement> findEngineActions(String userId, String searchString, SearchOptions searchOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of engine action metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
userId- calling usersearchString- string to find in the propertiessearchOptions- additional options for the search- 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)
-
getEngineActionsByName
public List<EngineActionElement> getEngineActionsByName(String userId, String name, QueryOptions queryOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of engine action metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Parameters:
userId- calling username- name to search forqueryOptions- additional options to control the results of the query- 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)
-
linkElementsAsPeerDuplicates
public void linkElementsAsPeerDuplicates(String userId, String metadataElement1GUID, String metadataElement2GUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, boolean setKnownDuplicate) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link elements as peer duplicates. Create a simple relationship between two elements. If the relationship already exists, the properties are updated.- Parameters:
userId- caller's userIdmetadataElement1GUID- unique identifier of the metadata element at end 1 of the relationshipmetadataElement2GUID- unique identifier of the metadata element at end 2 of the relationshipstatusIdentifier- what is the status of this relationship (negative means untrusted, 0 means unverified and positive means trusted)steward- identifier of the stewardstewardTypeName- type of element used to identify the stewardstewardPropertyName- property name used to identify stewardsource- source of the duplicate detection processingnotes- notes for the stewardsetKnownDuplicate- boolean flag indicating whether the KnownDuplicate classification should be set on the linked entities.- Throws:
InvalidParameterException- the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationshipUserNotAuthorizedException- the caller is not authorized to create this type of relationshipPropertyServerException- there is a problem with the metadata store
-
linkConsolidatedDuplicate
public void linkConsolidatedDuplicate(String userId, String consolidatedElementGUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, List<String> sourceElementGUIDs) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Identify an element that acts as a consolidated version for a set of duplicate elements. (The consolidated element is created using createMetadataElement.)- Parameters:
userId- caller's userIdconsolidatedElementGUID- unique identifier of the metadata elementstatusIdentifier- what is the status of this relationship (negative means untrusted, 0 means unverified and positive means trusted)steward- identifier of the stewardstewardTypeName- type of element used to identify the stewardstewardPropertyName- property name used to identify stewardsource- source of the duplicate detection processingnotes- notes for the stewardsourceElementGUIDs- List of the source elements that must be linked to the consolidated element. It is assumed that they already have the KnownDuplicateClassification.- Throws:
InvalidParameterException- the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationshipUserNotAuthorizedException- the caller is not authorized to create this type of relationshipPropertyServerException- there is a problem with the metadata store
-
getGovernanceActionProcessGraph
public GovernanceActionProcessGraph getGovernanceActionProcessGraph(String userId, String processGUID, Date effectiveTime) 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- Parameters:
userId- calling userprocessGUID- unique identifier of the requested metadata elementeffectiveTime- 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- there is a problem reported in the open metadata server(s)
-