Class GenericWatchdogGovernanceActionConnector

All Implemented Interfaces:
AuditLoggingComponent, SecureConnectorExtension, VirtualConnectorExtension, WatchdogActionService
Direct Known Subclasses:
GenericElementWatchdogGovernanceActionConnector, GenericFolderWatchdogGovernanceActionConnector

public abstract class GenericWatchdogGovernanceActionConnector extends WatchdogActionServiceConnector
GenericWatchdogGovernanceActionConnector provides a base class for generic watchdog functions. It runs as a watchdog action service in a watchdog action engine, such as EgeriaWatchdog.
  • Constructor Details

    • GenericWatchdogGovernanceActionConnector

      public GenericWatchdogGovernanceActionConnector()
  • Method Details

    • getProperty

      protected String getProperty(String propertyName, String defaultValue) throws UserNotAuthorizedException
      Retrieve a property value from the request parameters, falling back to the configuration properties of the connection and then the default value.
      Parameters:
      propertyName - name of the property
      defaultValue - value to use if the property is not set
      Returns:
      property value
      Throws:
      UserNotAuthorizedException - the connector was disconnected
    • completeMonitoring

      protected void completeMonitoring(WatchdogActionGuard guard, String completionMessage)
      Record that the monitoring is over and stop listening for events. Once complete, any further events that were already queued are ignored.
      Parameters:
      guard - guard that describes the outcome
      completionMessage - optional message describing the outcome
    • diffProperties

      protected String diffProperties(ElementProperties oldProperties, ElementProperties newProperties)
      Return a comma separated list of properties that have changed. This is saved in the request parameters and can be retrieved by the receiving governance service. The changed properties can be retrieved by the StringTokenizer class.
      Parameters:
      oldProperties - original property values
      newProperties - new property values
      Returns:
      comma separated list of property names where the value has changed
    • initiateProcess

      protected boolean initiateProcess(String processName, Map<String,String> requestParameters, List<NewActionTarget> actionTargets) throws GovernanceServiceException
      Initiates the request for the new process to start if a process name has been configured.
      Parameters:
      processName - name of the process to start
      requestParameters - parameters to pass to the process
      actionTargets - the elements that this process should work on
      Returns:
      true if a process was started; false if no process is configured for this kind of event
      Throws:
      GovernanceServiceException - unable to start the process