public class TopPriorityNotifier
extends java.lang.Object
Configuration Parameters
The configuration file for this class is a PVL style configuration file. The file should contain a NOTIFY parameter holding a list of one or more email addresses that should receive the email notification. In addition, the configuration should contain the parameters needed to initiate a database connection. Finally, the configuration file should contain a TopPriorityNotifier group that contains information about the minimum priorities to use for any science themes that will not use the default value.
Here is an example of what the TopPriorityNotifier group should look like:
Group = TopPriorityNotifier Group = Science_Theme_Priorities DEFAULT_PRIORITY = 9 GEOLOGIC_CONTACTS_STRATIGRAPHY = 7 End_Group End_GroupNote that if the science theme contains spaces or slashes in the database listing, these are replaced by underscores here. Science themes that do not have a minimum priority listed here will use the setting of the DEFAULT_PRIORITY parameter, and therefore this parameter is required.
Modifier and Type | Class and Description |
---|---|
static class |
TopPriorityNotifier.ExitCode
Exit status
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEBUG_CYCLE_PROPERTY
Setting any of the debugging
system properties to true will cause additional debugging information
to be output during the program execution that relates to operations
named by the property.
|
static java.lang.String |
DEBUG_MAIN_PROPERTY
Setting any of the debugging
system properties to true will cause additional debugging information
to be output during the program execution that relates to operations
named by the property.
|
static java.lang.String |
DEBUG_SEARCH_QUERY_PROPERTY
Setting any of the debugging
system properties to true will cause additional debugging information
to be output during the program execution that relates to operations
named by the property.
|
static java.lang.String |
DEFAULT_CONFIGURATION_FILENAME |
static java.lang.String |
ID
Class identifier
|
Constructor and Description |
---|
TopPriorityNotifier()
Construct the object using the default configuration file.
|
TopPriorityNotifier(java.lang.String configuration_filename)
Construct the object using the input string as filename containing
configuration information.
|
Modifier and Type | Method and Description |
---|---|
void |
addEmailAddress(java.lang.String email_address)
Add a single email address to the list of emails to notify.
|
void |
addEmailAddress(java.util.Vector<java.lang.String> email_list)
Any emails added in this list will be sent the notification email in
addition to any emails that may have been found in the configuration file.
|
int |
getCycle()
Retrieve the current MRO Cycle ID setting
|
boolean |
getVerbose()
Return the current verbosity setting
|
static void |
main(java.lang.String[] arguments)
Retrieve a list of the top priority suggestions and send them via email.
|
boolean |
NOOP()
Retrieve the current Noop setting.
|
void |
NOOP(boolean noop)
No operation.
|
void |
resetNotifiers()
Reset the list of email addresses that will receive the notification email.
|
void |
sendNotification()
Send a notification with the default minimum priority.
|
void |
sendNotification(int minimum_priority)
Search for the top priority suggestions and send an email listing the
set of top priority suggestions.
|
void |
setCycle(int cycle)
Set the MRO Planning cycle ID for this run
|
boolean |
setScienceTheme(java.lang.String theme)
Set the list of science themes to the input science theme.
|
void |
setVerbose(boolean verbose)
When set to true additional status information will be sent to stdout
|
static void |
Usage(org.apache.commons.cli.Options options)
Prints the command line usage syntax.
|
public static final java.lang.String ID
public static final java.lang.String DEFAULT_CONFIGURATION_FILENAME
public static final java.lang.String DEBUG_MAIN_PROPERTY
public static final java.lang.String DEBUG_SEARCH_QUERY_PROPERTY
public static final java.lang.String DEBUG_CYCLE_PROPERTY
public TopPriorityNotifier() throws PIRL.Configuration.Configuration_Exception, PIRL.Database.Database_Exception
PIRL.Configuration.Configuration_Exception
PIRL.Database.Database_Exception
TopPriorityNotifier(String)
public TopPriorityNotifier(java.lang.String configuration_filename) throws PIRL.Configuration.Configuration_Exception, PIRL.Database.Database_Exception
configuration_filename
- - the file name to use holding configuration
information required for the operation of the classPIRL.Configuration.Configuration_Exception
- if configuration cannot be read or required
parameters cannot be foundPIRL.Database.Database_Exception
- if the database connection cannot be initializedpublic void sendNotification() throws PIRL.Database.Database_Exception, javax.mail.MessagingException
PIRL.Database.Database_Exception
javax.mail.MessagingException
sendNotification(int)
public void sendNotification(int minimum_priority) throws PIRL.Database.Database_Exception, javax.mail.MessagingException
minimum_priority
- - the minimum priority a suggestion must have to be
included in the list. Note: This priority will not override any
priority settings defined in the configuration file.PIRL.Database.Database_Exception
- if a database error occurs while searching for
target suggestions in the database.javax.mail.MessagingException
- if an error occurs while sending the notification
emailNOOP(boolean)
,
setCycle(int)
,
setScienceTheme(String)
,
resetNotifiers()
,
addEmailAddress(String)
public boolean NOOP()
NOOP(boolean)
public void NOOP(boolean noop)
noop
- - set to true to prevent the notification email from being sentpublic boolean getVerbose()
setVerbose(boolean)
public void setVerbose(boolean verbose)
verbose
- - set to true to output additionals status information, defaults
to falsepublic void setCycle(int cycle) throws PIRL.Database.Database_Exception
cycle
- - an Integer MRO Cycle IDPIRL.Database.Database_Exception
- if a database error occurs while retrieving
the cycle information from the database, or if the cycle cannot be found.public int getCycle()
setCycle(int)
public void resetNotifiers()
addEmailAddress(String)
,
addEmailAddress(Vector)
public void addEmailAddress(java.lang.String email_address)
email_address
- resetNotifiers()
public void addEmailAddress(java.util.Vector<java.lang.String> email_list)
email_list
- resetNotifiers()
public boolean setScienceTheme(java.lang.String theme)
theme
- - the science theme to retrieve suggestions forpublic static void main(java.lang.String[] arguments)
Command line syntax is describe in the Usage(Options)
method.
Exit Status Values:
0 - Success 1 - Configuration Error 2 - Database Error 3 - Invalid Command Line Syntax 4 - Email Address Error
arguments
- Usage(Options)
public static void Usage(org.apache.commons.cli.Options options)
Usage: TopPriorityNotifier <Options> Options - [-Configuration <filename>] [-Email <user@host.domain>] [-Force_Cycle <cycle_number>] [-Help] [-Noop] [-Theme <Science_Theme>] [-Verbose]
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona