| |
|
| java.lang.Object vqwiki.file.FileReminders
FileReminders | public class FileReminders implements Reminders(Code) | | Implementation of Reminders which stores reminder records in text files.
Reminder files use the same filename as the associated topic and use
the extension ".rmd". Only one reminder is allowed per user per topic;
the user must either create a new page to set an additional reminder,
or plan to alter the existing reminder on a recurring basis to simulate
recurring reminders. Each Reminders object represents a single topic,
which must be specified at instantiation, either by name or by File.
author: Robert E Brewer version: 0.1 |
Constructor Summary | |
public | FileReminders() No-arg constructor for compatibility only; always use FileReminders(newTopicName)
or FileReminders(newRemindFile) instead. | public | FileReminders(String newTopicName) Opens and reads a Reminders object using the topic name. | public | FileReminders(File newRemindFile) Reads a Reminders object from a File which has already been opened. |
Method Summary | |
public void | addReminder(String userName, Date dateToRemind) Adds a reminder to this topic. | public Date | dateToRemind(String userName) Returns the date specified for a reminder for this user for this topic. | protected String | fileBase() Retrieves the home directory of the VQWiki installation. | public boolean | hasReminder(String userName) Checks whether the specified user has a reminder set for this topic. | public synchronized void | removeReminder(String userName) Removes reminder for the specified user for this topic. | public boolean | sendReminders(Date remindDate) Sends reminders via email to all users who have requested a reminder
on the specified date for this topic. |
FileReminders | public FileReminders()(Code) | | No-arg constructor for compatibility only; always use FileReminders(newTopicName)
or FileReminders(newRemindFile) instead.
|
FileReminders | public FileReminders(String newTopicName) throws WikiException(Code) | | Opens and reads a Reminders object using the topic name.
Parameters: newTopicName - the name of the topic exception: vqwiki.WikiException - if the reminder file could not be opened or read |
FileReminders | public FileReminders(File newRemindFile) throws WikiException(Code) | | Reads a Reminders object from a File which has already been opened.
Parameters: newRemindFile - the open File from which to read Reminders data. exception: vqwiki.WikiException - if the reminder file could not be read |
addReminder | public void addReminder(String userName, Date dateToRemind) throws WikiException(Code) | | Adds a reminder to this topic. If a reminder already exists for this user, it will be
replaced with the new reminder date.
Parameters: userName - the name of the user to add Parameters: dateToRemind - the date on which to send a reminder to the specified user exception: vqwiki.WikiException - if the file could not be written |
dateToRemind | public Date dateToRemind(String userName)(Code) | | Returns the date specified for a reminder for this user for this topic.
Parameters: userName - the name of the user to check Date the date of the reminder, or null if no reminder is set |
fileBase | protected String fileBase()(Code) | | Retrieves the home directory of the VQWiki installation.
String the home directory |
hasReminder | public boolean hasReminder(String userName)(Code) | | Checks whether the specified user has a reminder set for this topic.
Parameters: userName - the name of the user to check boolean True if the specified user has a reminder set for this topic. |
removeReminder | public synchronized void removeReminder(String userName) throws WikiException(Code) | | Removes reminder for the specified user for this topic. If the removal
empties the reminder list for this topic, the reminder file is deleted.
Parameters: userName - the name of the user for whom to remove reminders exception: vqwiki.WikiException - if the file could not be written |
sendReminders | public boolean sendReminders(Date remindDate) throws Exception(Code) | | Sends reminders via email to all users who have requested a reminder
on the specified date for this topic.
Parameters: remindDate - the date of reminders to send boolean true if the operation completes successfully exception: java.lang.ClassNotFoundException - , IOException if the mailer could not be instantiated |
|
|
|