public class AlertNoticeDispatchService
extends com.google.common.util.concurrent.AbstractScheduledService
AlertNoticeDispatchService is used to scan the database for
 AlertNoticeEntity that are in the NotificationState.PENDING
 state. It will then process them through the dispatch system.
 
 The dispatch system will then make a callback to
 AlertNoticeDispatchCallback so that the NotificationState can
 be updated to its final value.
 
 This class uses the templates that are defined via
 Configuration.getAlertTemplateFile() or the fallback internal
 template alert-templates.xml. These files are parsed during
 startUp(). If there is a problem parsing them, the service will
 still startup normally, producing an error in logs. It will fall back to
 simple string concatenation for Notification content in this case.| Modifier and Type | Class and Description | 
|---|---|
static class  | 
AlertNoticeDispatchService.AlertInfo
The  
AlertNoticeDispatchService.AlertInfo class encapsulates all information about a single
 alert for a single outbound Notification. | 
static class  | 
AlertNoticeDispatchService.AlertSummaryInfo
The  
AlertNoticeDispatchService.AlertSummaryInfo class encapsulates all of the alert
 information for the Notification. | 
static class  | 
AlertNoticeDispatchService.AmbariInfo
The  
AlertNoticeDispatchService.AmbariInfo class is used to provide the template engine with
 information about the Ambari installation. | 
static class  | 
AlertNoticeDispatchService.DispatchInfo
The  
AlertNoticeDispatchService.DispatchInfo class is used to provide the template engine with
 information about the intended target of the notification. | 
| Modifier and Type | Field and Description | 
|---|---|
static String | 
AMBARI_DISPATCH_CREDENTIAL_PASSWORD
The property containing the dispatch authentication password. 
 | 
static String | 
AMBARI_DISPATCH_CREDENTIAL_USERNAME
The property containing the dispatch authentication username. 
 | 
static String | 
AMBARI_DISPATCH_RECIPIENTS
The property containing the dispatch recipients 
 | 
| Constructor and Description | 
|---|
AlertNoticeDispatchService()
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
runOneIteration() | 
protected com.google.common.util.concurrent.AbstractScheduledService.Scheduler | 
scheduler()
 
 Returns a schedule that starts after 2 minute and runs every 2 minutes
 after  
runOneIteration() completes. | 
protected void | 
setExecutor(Executor executor)
Sets the  
Executor to use when dispatching Notifications. | 
protected void | 
startUp()
 
 Parse the XML template for  
Notification content. | 
public static final String AMBARI_DISPATCH_CREDENTIAL_USERNAME
public static final String AMBARI_DISPATCH_CREDENTIAL_PASSWORD
public static final String AMBARI_DISPATCH_RECIPIENTS
protected void startUp()
                throws Exception
Notification content. If there is a
 problem parsing the content, the service will still startup normally but
 the Notification content will fallback to plaintext.startUp in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionprotected void setExecutor(Executor executor)
Executor to use when dispatching Notifications.
 This should only be used by unit tests to provide a mock executor.executor - the executor to use (not {@code null).protected void runOneIteration()
                        throws Exception
runOneIteration in class com.google.common.util.concurrent.AbstractScheduledServiceExceptionprotected com.google.common.util.concurrent.AbstractScheduledService.Scheduler scheduler()
runOneIteration() completes.scheduler in class com.google.common.util.concurrent.AbstractScheduledServiceCopyright © 2022 Apache Software Foundation. All rights reserved.