public class NotificationHandler extends GovernanceDefinitionHandler
NotificationHandler is the handler for managing notifications for notification types.
  • Constructor Details

    • NotificationHandler

      public NotificationHandler(String localServerName, AuditLog auditLog, String serviceName, OpenMetadataClient openMetadataClient, OpenGovernanceClient openGovernanceClient)
      Create a new handler.
      Parameters:
      localServerName - name of this server (view server)
      auditLog - logging destination
      serviceName - local service name
      openMetadataClient - access to open metadata
  • Method Details

    • getMonitoredResources

      public List<OpenMetadataRootElement> getMonitoredResources(String userId, String notificationTypeGUID, QueryOptions queryOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the list of resources linked to the supplied notification type.
      Parameters:
      userId - userId of user making request.
      notificationTypeGUID - unique identifier of the notification type
      queryOptions - options to control the query
      Returns:
      list of resources to monitor
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the watchdog action service is not authorized to continue
      PropertyServerException - a problem connecting to the metadata store
    • notifySubscribers

      public void notifySubscribers(String userId, boolean firstNotification, Map<String,ClassificationProperties> initialClassifications, NotificationProperties outboundNotificationProperties, String notificationTypeGUID, Map<String,String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets, long minimumNotificationInterval, Date nextScheduledNotificationTime, ActivityStatus newSubscriberStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a notification/action for the subscribers. The caller determines if a notification is required. This method determines if the subscriber is eligible to receive the notification.
      Parameters:
      userId - caller's userId
      firstNotification - is this the first notification sent to this subscriber by this governance service instance?
      outboundNotificationProperties - properties of the action
      notificationTypeGUID - unique identifier of the cause for the action to be raised
      initialClassifications - initial classifications to add to the action
      requestParameters - properties to pass to the next governance service
      actionRequesterGUID - unique identifier of the source of the action
      actionTargets - the list of elements that should be acted upon
      minimumNotificationInterval - minimum time between notifications
      nextScheduledNotificationTime - next notification trigger time - either from the notification type or monitored resource activity
      newSubscriberStatus - set the subscriber relationship to this value after a successful notification; null means leave it alone
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the watchdog action service is not authorized to continue
      PropertyServerException - a problem connecting to the metadata store
    • welcomeSubscriber

      public String welcomeSubscriber(String userId, String subscriberGUID, Map<String,ClassificationProperties> initialClassifications, NotificationProperties outboundNotificationProperties, String notificationTypeGUID, Map<String,String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets, long minimumNotificationInterval, ActivityStatus newSubscriberStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a notification/action for the new subscriber.
      Parameters:
      userId - caller's userId
      subscriberGUID - unique identifier of the subscriber
      outboundNotificationProperties - properties of the action
      initialClassifications - initial classifications to add to the action
      notificationTypeGUID - unique identifier of the cause for the action to be raised
      requestParameters - properties to pass to any governance action subscriber
      actionRequesterGUID - unique identifier of the source of the action
      actionTargets - the list of elements that should be acted upon
      minimumNotificationInterval - minimum time between notifications
      newSubscriberStatus - set the subscriber relationship to this value after a successful notification; null means leave it alone
      Returns:
      unique identifier of the action
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to continue
      PropertyServerException - a problem connecting to the metadata store
    • dismissSubscriber

      public String dismissSubscriber(String userId, String subscriberGUID, Map<String,ClassificationProperties> initialClassifications, NotificationProperties outboundNotificationProperties, String notificationTypeGUID, Map<String,String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a notification/action for an unsubscribed subscriber.
      Parameters:
      userId - caller's userId
      subscriberGUID - unique identifier of the subscriber
      outboundNotificationProperties - properties of the action
      initialClassifications - initial classifications to add to the action
      notificationTypeGUID - unique identifier of the cause for the action to be raised
      requestParameters - properties to pass to any governance action subscriber
      actionRequesterGUID - unique identifier of the source of the action
      actionTargets - the list of elements that should be acted upon
      Returns:
      unique identifier of the action
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to continue
      PropertyServerException - a problem connecting to the metadata store
    • getNotificationSubscribers

      public List<OpenMetadataRootElement> getNotificationSubscribers(String userId, String notificationTypeGUID, QueryOptions queryOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the list of subscribers linked to the supplied notification type.
      Parameters:
      userId - userId of user making request.
      notificationTypeGUID - unique identifier of the notification type
      queryOptions - options to control the query
      Returns:
      list of resources to monitor
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.