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 the user making the 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 externalSourceGUID, String externalSourceName, String userId, Map<String,ClassificationProperties> initialClassifications, NotificationProperties firstNotificationProperties, NotificationProperties subsequentNotificationProperties, NotificationProperties lastNotificationProperties, String notificationTypeGUID, Map<String,String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets, String requester) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a notification/action for the subscribers if the notificationType is eligible for delivering notifications. Each subscriber is considered in turn. Each subscriber may be in a different state which affects whether it is notified and how. This method determines if the subscriber is eligible to receive the notification. It also determines if this is the first notification for the subscriber, or later one, since it affects the notification properties. The notification type is updated if it is eligible for delivering notifications (even if it has no subscribers).
      Parameters:
      externalSourceGUID - unique identifier of the external source - null means local
      externalSourceName - name of the external source
      userId - caller's userId
      initialClassifications - classification to add to the action
      firstNotificationProperties - properties for the first notification sent to this subscriber by this service
      subsequentNotificationProperties - properties for a follow-on notification sent to this subscriber by this service
      lastNotificationProperties - properties for the last notification sent to this subscriber by this service
      notificationTypeGUID - unique identifier of the cause for the action to be raised
      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
      requester - name of the service making the request
      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
    • 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 the user making the 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.