Class NotificationHandler
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
org.odpi.openmetadata.frameworks.openmetadata.handlers.GovernanceDefinitionHandler
org.odpi.openmetadata.frameworks.opengovernance.handlers.NotificationHandler
NotificationHandler is the handler for managing notifications for notification types.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
auditLog, classificationBuilder, elementBuilder, localServerName, localServiceName, metadataElementTypeName, openMetadataClient, propertyHelper, relationshipBuilder -
Constructor Summary
ConstructorsConstructorDescriptionNotificationHandler(String localServerName, AuditLog auditLog, String serviceName, OpenMetadataClient openMetadataClient, OpenGovernanceClient openGovernanceClient) Create a new handler. -
Method Summary
Modifier and TypeMethodDescriptiondismissSubscriber(String userId, String subscriberGUID, Map<String, ClassificationProperties> initialClassifications, NotificationProperties outboundNotificationProperties, String notificationTypeGUID, Map<String, String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) Create a notification/action for an unsubscribed subscriber.getMonitoredResources(String userId, String notificationTypeGUID, QueryOptions queryOptions) Return the list of resources linked to the supplied notification type.getNotificationSubscribers(String userId, String notificationTypeGUID, QueryOptions queryOptions) Return the list of subscribers linked to the supplied notification type.voidnotifySubscribers(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) Create a notification/action for the subscribers.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) Create a notification/action for the new subscriber.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.GovernanceDefinitionHandler
addGovernanceDefinitionToElement, attachSupportingDefinition, certifyElement, createGovernanceDefinition, createGovernanceDefinitionFromTemplate, decertifyElement, deleteGovernanceDefinition, detachAssignmentScope, detachDesignFromImplementation, detachGovernanceActionExecutor, detachGovernanceActionProcessFlow, detachGovernanceResults, detachGovernanceZones, detachImplementationResource, detachMonitoredResource, detachNextProcessStep, detachNotificationSubscriber, detachPeerDefinitions, detachSubjectAreas, detachSupportingDefinition, detachTargetForGovernanceAction, findGovernanceDefinitions, getGovernanceDefinitionByGUID, getGovernanceDefinitionsByName, licenseElement, linkAssignmentScope, linkDesignToImplementation, linkGovernanceActionExecutor, linkGovernanceActionProcessFlow, linkGovernanceResults, linkGovernanceZones, linkImplementationResource, linkMonitoredResource, linkNextProcessStep, linkNotificationSubscriber, linkPeerDefinitions, linkSubjectAreas, linkTargetForGovernanceAction, removeGovernanceDefinitionFromElement, unlicenseElement, updateCertification, updateGovernanceDefinition, updateLicense, updateNextProcessStepMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
addDefaultType, addDefaultType, addDefaultType, addGovernanceDefinitionFamily, addMermaidToRootElement, convertRootElement, convertRootElement, convertRootElements, createElementFromTemplate, createNewElement, findRootElements, getDeletedElementByUniqueName, getElementHierarchies, getElementHierarchies, getElementHierarchy, getElementRelatedElements, getFullParentContext, getLineageElementByUniqueName, getMermaidGraph, getQueryOptions, getQueryOptions, getQueryOptions, getRelatedRootElements, getRootElementByGUID, getRootElementByUniqueName, getRootElementByUniqueName, getRootElementsByName, getRootElementsByUniqueName, populateRootElement, updateElement
-
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 destinationserviceName- local service nameopenMetadataClient- 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 typequeryOptions- options to control the query- Returns:
- list of resources to monitor
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the watchdog action service is not authorized to continuePropertyServerException- 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, throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionString> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets, long minimumNotificationInterval, Date nextScheduledNotificationTime, ActivityStatus newSubscriberStatus) 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 userIdfirstNotification- is this the first notification sent to this subscriber by this governance service instance?outboundNotificationProperties- properties of the actionnotificationTypeGUID- unique identifier of the cause for the action to be raisedinitialClassifications- initial classifications to add to the actionrequestParameters- properties to pass to the next governance serviceactionRequesterGUID- unique identifier of the source of the actionactionTargets- the list of elements that should be acted uponminimumNotificationInterval- minimum time between notificationsnextScheduledNotificationTime- next notification trigger time - either from the notification type or monitored resource activitynewSubscriberStatus- set the subscriber relationship to this value after a successful notification; null means leave it alone- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the watchdog action service is not authorized to continuePropertyServerException- 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, throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionString> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets, long minimumNotificationInterval, ActivityStatus newSubscriberStatus) Create a notification/action for the new subscriber.- Parameters:
userId- caller's userIdsubscriberGUID- unique identifier of the subscriberoutboundNotificationProperties- properties of the actioninitialClassifications- initial classifications to add to the actionnotificationTypeGUID- unique identifier of the cause for the action to be raisedrequestParameters- properties to pass to any governance action subscriberactionRequesterGUID- unique identifier of the source of the actionactionTargets- the list of elements that should be acted uponminimumNotificationInterval- minimum time between notificationsnewSubscriberStatus- 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 invalidUserNotAuthorizedException- the user is not authorized to continuePropertyServerException- 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, throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionString> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) Create a notification/action for an unsubscribed subscriber.- Parameters:
userId- caller's userIdsubscriberGUID- unique identifier of the subscriberoutboundNotificationProperties- properties of the actioninitialClassifications- initial classifications to add to the actionnotificationTypeGUID- unique identifier of the cause for the action to be raisedrequestParameters- properties to pass to any governance action subscriberactionRequesterGUID- unique identifier of the source of the actionactionTargets- the list of elements that should be acted upon- Returns:
- unique identifier of the action
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to continuePropertyServerException- 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 typequeryOptions- 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.
-