| | |
| | | |
| | | |
| | | import java.io.File; |
| | | import java.net.InetAddress; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | |
| | | // removed from the set of scheduled tasks. |
| | | private long retentionTime; |
| | | |
| | | // The e-mail address to use for the sender from notification messages. |
| | | private String notificationSenderAddress; |
| | | |
| | | // The path to the task backing file. |
| | | private String taskBackingFile; |
| | | |
| | |
| | | retentionTime = cfg.getTaskRetentionTime(); |
| | | |
| | | |
| | | // Get the notification sender address. |
| | | notificationSenderAddress = cfg.getNotificationSenderAddress(); |
| | | if (notificationSenderAddress == null) |
| | | { |
| | | try |
| | | { |
| | | notificationSenderAddress = "opends-task-notification@" + |
| | | InetAddress.getLocalHost().getCanonicalHostName(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | notificationSenderAddress = "opends-task-notification@opends.org"; |
| | | } |
| | | } |
| | | |
| | | |
| | | // Get the path to the task data backing file. |
| | | taskBackingFile = cfg.getTaskBackingFile(); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | String tmpNotificationAddress = configEntry.getNotificationSenderAddress(); |
| | | if (tmpNotificationAddress == null) |
| | | { |
| | | try |
| | | { |
| | | tmpNotificationAddress = "opends-task-notification@" + |
| | | InetAddress.getLocalHost().getCanonicalHostName(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | tmpNotificationAddress = "opends-task-notification@opends.org"; |
| | | } |
| | | } |
| | | notificationSenderAddress = tmpNotificationAddress; |
| | | |
| | | |
| | | currentConfig = configEntry; |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the sender address that should be used for e-mail notifications |
| | | * of task completion. |
| | | * |
| | | * @return The sender address that should be used for e-mail notifications of |
| | | * task completion. |
| | | */ |
| | | public String getNotificationSenderAddress() |
| | | { |
| | | return notificationSenderAddress; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the length of time in seconds that information for a task should |
| | | * be retained after processing on it has completed. |
| | | * |