Class NotificationHandler
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
org.odpi.openmetadata.frameworks.openmetadata.handlers.GovernanceDefinitionHandler
org.odpi.openmetadata.frameworks.openwatchdog.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 TypeMethodDescriptiongetMonitoredResources
(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.notifySubscriber
(String userId, String subscriberGUID, NotificationProperties properties, String notificationTypeGUID, Map<String, String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) Create a notification/action for each of the subscribers.void
notifySubscribers
(String userId, NotificationProperties properties, String notificationTypeGUID, Map<String, String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) Create a notification/action for each of the subscribers.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.GovernanceDefinitionHandler
addElementToSubjectArea, addGovernanceDefinitionToElement, attachSupportingDefinition, certifyElement, createGovernanceDefinition, createGovernanceDefinitionFromTemplate, decertifyElement, deleteGovernanceDefinition, detachAssignmentScope, detachDesignFromImplementation, detachGovernanceResults, detachGovernanceZones, detachImplementationResource, detachPeerDefinitions, detachSubjectAreas, detachSupportingDefinition, findGovernanceDefinitions, getGovernanceDefinitionByGUID, getGovernanceDefinitionsByName, licenseElement, linkAssignmentScope, linkDesignToImplementation, linkGovernanceResults, linkGovernanceZones, linkImplementationResource, linkPeerDefinitions, linkSubjectAreas, removeElementFromSubjectArea, removeGovernanceDefinitionFromElement, unlicenseElement, updateCertification, updateGovernanceDefinition, updateLicense
Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
addDefaultType, addDefaultType, addDefaultType, addGovernanceDefinitionFamily, addMermaidToRootElement, convertRootElement, convertRootElement, convertRootElements, convertSolutionComponent, convertSolutionPort, createElementFromTemplate, createNewElement, findRootElements, getElementHierarchies, getElementHierarchy, getElementRelatedElements, getFullParentContext, getInformationSupplyChainContext, getQueryOptions, getQueryOptions, getQueryOptions, getRelatedRootElements, getRootElementByGUID, getRootElementByUniqueName, getRootElementsByName, updateElement, updateElementStatus
-
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 null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
notifySubscriber
public String notifySubscriber(String userId, String subscriberGUID, NotificationProperties properties, String notificationTypeGUID, Map<String, String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionCreate a notification/action for each of the subscribers.- Parameters:
userId
- caller's userIdsubscriberGUID
- unique identifier of the subscriberproperties
- properties of 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
- the completion status is nullUserNotAuthorizedException
- the governance action service is not authorized to update the governance action service statusPropertyServerException
- there is a problem connecting to the metadata store
-
notifySubscribers
public void notifySubscribers(String userId, NotificationProperties properties, String notificationTypeGUID, Map<String, String> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionCreate a notification/action for each of the subscribers.- Parameters:
userId
- caller's userIdproperties
- properties of the actionnotificationTypeGUID
- unique identifier of the cause for the action to be raisedrequestParameters
- properties to pass to the next governance serviceactionRequesterGUID
- unique identifier of the source of the actionactionTargets
- the list of elements that should be acted upon- Throws:
InvalidParameterException
- the completion status is nullUserNotAuthorizedException
- the governance action service is not authorized to update the governance action service statusPropertyServerException
- there is 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
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-