Class OpenGovernanceClient
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.client.OpenGovernanceClient
- All Implemented Interfaces:
GovernanceCompletionInterface
,SpecialGovernanceActionInterface
- Direct Known Subclasses:
OpenGovernanceClientBase
public abstract class OpenGovernanceClient
extends Object
implements GovernanceCompletionInterface, SpecialGovernanceActionInterface
OpenGovernanceClient provides services to support the governance context. It is implemented by a
metadata repository provider. In Egeria, this class is implemented partly by the GAF metadata management
services and partly by the Governance Action OMES running in the engine host OMAG Server.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenGovernanceClient
(String serviceURLMarker, String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Unregister the listener from the event infrastructure.abstract String
initiateGovernanceAction
(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, 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 a governance action in the metadata store which will trigger the governance action service associated with the supplied request type.abstract String
initiateGovernanceActionProcess
(String userId, String processQualifiedName, List<String> requestSourceGUIDs, 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 governance actions.abstract void
linkConsolidatedDuplicate
(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.abstract void
linkElementsAsPeerDuplicates
(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.abstract void
recordCompletionStatus
(String userId, String governanceActionGUID, 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.abstract void
registerListener
(WatchdogGovernanceListener listener, List<WatchdogEventType> interestingEventTypes, List<String> interestingMetadataTypes, String specificInstance) Register a listener to receive events about changes to metadata elements in the open metadata store.toString()
Standard toString method.abstract void
updateActionTargetStatus
(String userId, String actionTargetGUID, GovernanceActionStatus status, Date startDate, Date completionDate, String completionMessage) Update the status of a specific action target.
-
Field Details
-
serverName
-
serviceURLMarker
-
serverPlatformURLRoot
-
-
Constructor Details
-
OpenGovernanceClient
public OpenGovernanceClient(String serviceURLMarker, String serverName, String serverPlatformURLRoot) 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 services
-
-
Method Details
-
updateActionTargetStatus
public abstract void updateActionTargetStatus(String userId, String actionTargetGUID, GovernanceActionStatus 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:
updateActionTargetStatus
in 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
- there is a problem connecting to the metadata store
-
recordCompletionStatus
public abstract void recordCompletionStatus(String userId, String governanceActionGUID, 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:
recordCompletionStatus
in interfaceGovernanceCompletionInterface
- Parameters:
userId
- caller's userIdgovernanceActionGUID
- unique identifier of the governance actionrequestParameters
- 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
- there is a problem connecting to the metadata store
-
initiateGovernanceAction
public abstract String initiateGovernanceAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, 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 a governance action in the metadata store which will trigger the governance action service associated with the supplied request type. The governance action remains to act as a record of the actions taken for auditing.- Specified by:
initiateGovernanceAction
in interfaceSpecialGovernanceActionInterface
- Parameters:
userId
- caller's userIdqualifiedName
- unique identifier to give this governance actiondomainIdentifier
- governance domain associated with this action (0=ALL)displayName
- display name for this actiondescription
- description for this actionrequestSourceGUIDs
- request source elements for the resulting governance action serviceactionTargets
- list of action target names to GUIDs for the resulting governance action servicereceivedGuards
- list of guards to initiate the governance 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 action 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 governance action
- Throws:
InvalidParameterException
- null qualified nameUserNotAuthorizedException
- this governance action service is not authorized to create a governance actionPropertyServerException
- there is a problem with the metadata store
-
initiateGovernanceActionProcess
public abstract String initiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> requestSourceGUIDs, 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 governance actions.- Specified by:
initiateGovernanceActionProcess
in interfaceSpecialGovernanceActionInterface
- Parameters:
userId
- caller's userIdprocessQualifiedName
- unique name of the governance action process to userequestSourceGUIDs
- request source elements for the resulting governance action serviceactionTargets
- list of action target names to GUIDs for the resulting governance action servicestartTime
- future start time or null for "as soon as possible".requestParameters
- request properties to be passed to the first governance 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 first governance action of the process
- Throws:
InvalidParameterException
- null or unrecognized qualified name of the processUserNotAuthorizedException
- this governance action service is not authorized to create a governance action processPropertyServerException
- there is a problem with the metadata store
-
linkElementsAsPeerDuplicates
public abstract 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.- Specified by:
linkElementsAsPeerDuplicates
in interfaceSpecialGovernanceActionInterface
- 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 governance action service is not authorized to create this type of relationshipPropertyServerException
- there is a problem with the metadata store
-
linkConsolidatedDuplicate
public abstract 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.)- Specified by:
linkConsolidatedDuplicate
in interfaceSpecialGovernanceActionInterface
- 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 governance action service is not authorized to create this type of relationshipPropertyServerException
- there is a problem with the metadata store
-
registerListener
public abstract void registerListener(WatchdogGovernanceListener listener, List<WatchdogEventType> interestingEventTypes, List<String> interestingMetadataTypes, String specificInstance) throws InvalidParameterException Register a listener to receive events about changes to metadata elements in the open metadata store. There can be only one registered listener. If this method is called more than once, the new parameters replace the existing parameters. This means the watchdog governance action service can change the listener and the parameters that control the types of events received while it is running. The types of events passed to the listener are controlled by the combination of the interesting event types and the interesting metadata types. That is an event is only passed to the listener if it matches both the interesting event types and the interesting metadata types. If specific instance, interestingEventTypes or interestingMetadataTypes are null, it defaults to "any". If the listener parameter is null, no more events are passed to the listener.- Parameters:
listener
- listener object to receive eventsinterestingEventTypes
- types of events that should be passed to the listenerinterestingMetadataTypes
- types of elements that are the subject of the interesting event typesspecificInstance
- unique identifier of a specific instance to watch for- Throws:
InvalidParameterException
- one or more of the type names are unrecognized
-
disconnectListener
public abstract void disconnectListener()Unregister the listener from the event infrastructure. -
toString
Standard toString method.
-