Interface MailerIntf
- All Superinterfaces:
Serializable
- When an event is added/changed/deleted mail the chnage to all subscribers to that events calendar.
- When an email alarm fires, mail something, including the event, to the alarm receiver
Over time other needs may present themselves.
The subscribed case can be thought of as a mailing list. For each calendar, we have a list of subscribers who want events emailed. When a change occurs to the calendar we send the message out on the list. This interface allows implementors to use a list server to handle the, possibly large amount of, mail generated by this system.
The second case is less easily optimized. Each email is unique in content and usually has only one recipient.
In both cases it is useful to have some sort of mechanism for determining bad addresses. List servers often have their own mechanisms which usually result in a recipient being eventually deleted from the list. Thsi interface allows the calendar system to query the state of a given recipient on the list.
Because we are probably interfacing to a system which identifies users solely by their email-address, we have to give that system the chance to update itself correctly when the users email is changed. We present the new address to the system as well as the old one.
- Author:
- Mike Douglass douglm@bedework.edu
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddList(BwCalendar cal) Add a list corresponding to the given calendar.voidaddMember(BwCalendar cal, BwPrincipal member) Add a member to the list corresponding to the given calendar.booleancheckList(BwCalendar cal) Check a list corresponding to the given calendar exists.booleancheckMember(BwCalendar cal, BwPrincipal member) Check a member is on the list corresponding to the given calendar.voiddeleteList(BwCalendar cal) Delete a list corresponding to the given calendar.voidinit(MailConfigProperties config) Return a collection of mail list idslistMembers(BwCalendar cal) List members on the list corresponding to the given calendar.booleanmailEntity(net.fortuna.ical4j.model.Calendar cal, String originator, Collection<String> recipients, String subject) Mail the given calendar object to the given list of recipientsvoidvoidpostList(BwCalendar cal, Message val) Post a message to the list corresponding to the given calendar.voidremoveMember(BwCalendar cal, BwPrincipal member) Remove a member from the list corresponding to the given calendar.voidupdateMember(BwCalendar cal, BwPrincipal member, String newEmail) Update a members email address on the list corresponding to the given calendar.
-
Method Details
-
init
- Parameters:
config- MailConfigProperties object
-
mailEntity
boolean mailEntity(net.fortuna.ical4j.model.Calendar cal, String originator, Collection<String> recipients, String subject) throws CalFacadeException Mail the given calendar object to the given list of recipients- Parameters:
cal- The rfc2445,6,7 objectoriginator- - null if we use configured defaultrecipients- list of recipientssubject-- Returns:
- boolean true if message sent, false - probably disabled.
- Throws:
CalFacadeException
-
addList
Add a list corresponding to the given calendar.- Parameters:
cal-- Throws:
CalFacadeException
-
deleteList
Delete a list corresponding to the given calendar.- Parameters:
cal-- Throws:
CalFacadeException
-
listLists
Return a collection of mail list ids- Returns:
- collection of mail list ids
- Throws:
CalFacadeException
-
checkList
Check a list corresponding to the given calendar exists.- Parameters:
cal-- Returns:
- true if list exists
- Throws:
CalFacadeException
-
postList
Post a message to the list corresponding to the given calendar.- Parameters:
cal-val-- Throws:
CalFacadeException
-
addMember
Add a member to the list corresponding to the given calendar.- Parameters:
cal-member-- Throws:
CalFacadeException
-
removeMember
Remove a member from the list corresponding to the given calendar.- Parameters:
cal-member-- Throws:
CalFacadeException
-
checkMember
Check a member is on the list corresponding to the given calendar.- Parameters:
cal-member-- Returns:
- boolean
- Throws:
CalFacadeException
-
updateMember
Update a members email address on the list corresponding to the given calendar.- Parameters:
cal-member-newEmail-- Throws:
CalFacadeException
-
listMembers
List members on the list corresponding to the given calendar. This requires that the implementation has access to the database to match emails against members.- Parameters:
cal-- Returns:
- Collection
- Throws:
CalFacadeException
-
post
- Parameters:
val-- Throws:
CalFacadeException
-