Class WatchdogGovernanceContext
- java.lang.Object
-
- org.odpi.openmetadata.frameworks.governanceaction.GovernanceContext
-
- org.odpi.openmetadata.frameworks.governanceaction.WatchdogGovernanceContext
-
public class WatchdogGovernanceContext extends GovernanceContext
WatchdogGovernanceContext provides the watchdog governance action service with access to information about the request, open metadata store, the ability to register a listener to receive governance events and initiate new governance activity.
-
-
Constructor Summary
Constructors Constructor Description WatchdogGovernanceContext(String userId, String governanceActionGUID, String requestType, Map<String,String> requestParameters, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements, OpenMetadataClient openMetadataStore)Constructor sets up the key parameters for processing the request to the governance action service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateIncidentReport(String qualifiedName, int domainIdentifier, String background, List<IncidentImpactedElement> impactedResources, List<IncidentDependency> previousIncidents, Map<String,Integer> incidentClassifiers, Map<String,String> additionalProperties)Create an incident report to capture the situation detected by this governance action service.StringinitiateGovernanceAction(String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters)Create a governance action in the metadata store which will trigger the governance action service associated with the supplied request type.StringinitiateGovernanceActionProcess(String processQualifiedName, Map<String,String> requestParameters, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime)Using the named governance action process as a template, initiate a chain of governance actions.voidregisterListener(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.StringtoString()Standard toString method.-
Methods inherited from class org.odpi.openmetadata.frameworks.governanceaction.GovernanceContext
getActionTargetElements, getCompletionStatus, getOpenMetadataStore, getRequestParameters, getRequestSourceElements, getRequestType, recordCompletionStatus, recordCompletionStatus, recordCompletionStatus, updateActionTargetStatus
-
-
-
-
Constructor Detail
-
WatchdogGovernanceContext
public WatchdogGovernanceContext(String userId, String governanceActionGUID, String requestType, Map<String,String> requestParameters, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements, OpenMetadataClient openMetadataStore)
Constructor sets up the key parameters for processing the request to the governance action service.- Parameters:
userId- calling usergovernanceActionGUID- unique identifier of the governance action that triggered this governance servicerequestType- unique identifier of the asset that the annotations should be attached torequestParameters- name-value properties to control the governance action servicerequestSourceElements- metadata elements associated with the request to the governance action serviceactionTargetElements- metadata elements that need to be worked on by the governance action serviceopenMetadataStore- client to the metadata store for use by the governance action service
-
-
Method Detail
-
registerListener
public 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. The type name specified in the interestingMetadataTypes refers to the subject of the event - so it is the type of the metadata element for metadata element types, the type of the relationship for related elements events and the name of the classification for classification events.- 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 (metadata element or relationship) to watch for- Throws:
InvalidParameterException- one or more of the type names are unrecognized
-
initiateGovernanceAction
public String initiateGovernanceAction(String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create 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.- Parameters:
qualifiedName- 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- map of action target names to GUIDs for the resulting governance action servicestartTime- future start time or null for "as soon as possible".governanceEngineName- name of the governance engine to run the requestrequestType- request type to identify the governance action service to runrequestParameters- properties to pass to the governance action service- 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 String initiateGovernanceActionProcess(String processQualifiedName, Map<String,String> requestParameters, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Using the named governance action process as a template, initiate a chain of governance actions.- Parameters:
processQualifiedName- unique name of the governance action process to userequestParameters- request parameters to pass to the governance actions called in the governance action processrequestSourceGUIDs- request source elements for the resulting governance action serviceactionTargets- map of action target names to GUIDs for the resulting governance action servicestartTime- future start time or null for "as soon as possible".- 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
-
createIncidentReport
public String createIncidentReport(String qualifiedName, int domainIdentifier, String background, List<IncidentImpactedElement> impactedResources, List<IncidentDependency> previousIncidents, Map<String,Integer> incidentClassifiers, Map<String,String> additionalProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create an incident report to capture the situation detected by this governance action service. This incident report will be processed by other governance activities.- Parameters:
qualifiedName- unique identifier to give this new incident reportdomainIdentifier- governance domain associated with this action (0=ALL)background- description of the situationimpactedResources- details of the resources impacted by this situationpreviousIncidents- links to previous incident reports covering this situationincidentClassifiers- initial classifiers for the incident reportadditionalProperties- additional arbitrary properties for the incident reports- Returns:
- unique identifier of the resulting incident report
- Throws:
InvalidParameterException- null or non-unique qualified name for the incident reportUserNotAuthorizedException- this governance action service is not authorized to create a incident reportPropertyServerException- there is a problem with the metadata store
-
toString
public String toString()
Standard toString method.- Overrides:
toStringin classGovernanceContext- Returns:
- print out of variables in a JSON-style
-
-