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 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.voidnotifySubscribers(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) Create a notification/action for the subscribers if the notificationType is eligible for delivering notifications.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.GovernanceDefinitionHandler
addGovernanceDefinitionToElement, addRegulatorToRegulation, attachSupportingDefinition, certifyElement, clearControlPoint, clearEnforcementPoint, clearExecutionPoint, clearPolicyAdministrationPoint, clearPolicyDecisionPoint, clearPolicyEnforcementPoint, clearPolicyInformationPoint, clearPolicyManagementPoint, clearPolicyRetrievalPoint, clearVerificationPoint, clearZoneMembershipProfile, createGovernanceDefinition, createGovernanceDefinitionFromTemplate, decertifyElement, deleteGovernanceDefinition, detachApprovedPurpose, detachAssignmentScope, detachAssociatedSecurityList, detachDataProcessingSpecification, detachDesignFromImplementation, detachDetailedProcessingAction, detachException, detachGovernanceActionExecutor, detachGovernanceActionProcessFlow, detachGovernanceResults, detachGovernanceZones, detachImplementationResource, detachMonitoredResource, detachNextProcessStep, detachNotificationSubscriber, detachPeerDefinitions, detachRegulationCertificationType, detachSubjectAreas, detachSupportingDefinition, detachTargetForGovernanceAction, findGovernanceDefinitions, getGovernanceDefinitionByGUID, getGovernanceDefinitionsByName, licenseElement, linkApprovedPurpose, linkAssignmentScope, linkAssociatedSecurityList, linkDataProcessingSpecification, linkDesignToImplementation, linkDetailedProcessingAction, linkException, linkGovernanceActionExecutor, linkGovernanceActionProcessFlow, linkGovernanceResults, linkGovernanceZones, linkImplementationResource, linkMonitoredResource, linkNextProcessStep, linkNotificationSubscriber, linkPeerDefinitions, linkRegulationCertificationType, linkSubjectAreas, linkTargetForGovernanceAction, removeGovernanceDefinitionFromElement, removeRegulatorFromRegulation, setControlPoint, setEnforcementPoint, setExecutionPoint, setPolicyAdministrationPoint, setPolicyDecisionPoint, setPolicyEnforcementPoint, setPolicyInformationPoint, setPolicyManagementPoint, setPolicyRetrievalPoint, setVerificationPoint, setZoneMembershipProfile, unlicenseElement, updateAssociatedSecurityList, updateCertification, updateException, updateGovernanceDefinition, updateLicense, updateNextProcessStepMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
addDefaultType, addDefaultType, addDefaultType, addMermaidToRootElement, convertRootElement, convertRootElement, convertRootElements, createElementFromTemplate, createNewElement, findRootElements, getClassificationSearch, getDeletedElementByUniqueName, getElementHierarchies, getElementHierarchies, getElementHierarchy, getElementRelatedElements, getElementsByClassification, getFullParentContext, getLineageElementByUniqueName, getMermaidGraph, 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 the user making the 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 externalSourceGUID, String externalSourceName, String userId, Map<String, ClassificationProperties> initialClassifications, NotificationProperties firstNotificationProperties, NotificationProperties subsequentNotificationProperties, NotificationProperties lastNotificationProperties, String notificationTypeGUID, Map<String, throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionString> requestParameters, String actionRequesterGUID, List<NewActionTarget> actionTargets, String requester) 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 localexternalSourceName- name of the external sourceuserId- caller's userIdinitialClassifications- classification to add to the actionfirstNotificationProperties- properties for the first notification sent to this subscriber by this servicesubsequentNotificationProperties- properties for a follow-on notification sent to this subscriber by this servicelastNotificationProperties- properties for the last notification sent to this subscriber by this servicenotificationTypeGUID- 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 uponrequester- name of the service making the request- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the watchdog action service 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 the user making the 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.
-