org.tolven.core
Interface InvitationLocal

All Known Implementing Classes:
InvitationBean

public interface InvitationLocal


Method Summary
 Invitation createInvitation(java.lang.String principal, InvitationDetail detail)
          Create a new invitation using the supplied details directed to the specified user
 void executeInvitation(Invitation invitation, java.util.Date now)
          Execute an invitation and if the invitation is chained, carry out all chained invitations as well.
 void executeInvitation(long invitationId, java.util.Date now)
          Execute an invitation and if the invitation is chained, carry out all chained invitations as well.
 ActivateInvitation extractActivationDetails(Invitation invitation)
          Given an invitation, return the activation details contained within, if any, otherwise return null.
 java.util.List<AdministrativeDetail> extractDetails(Invitation invitation)
          Extract the details as a list of object trees from the invitation XML
 Invitation findInvitation(long invitationId)
          Get a Invitation by its internal ID
 java.util.List<Invitation> findOpenInvitations(TolvenUser user, java.util.Date now)
          Find open invitations for this user, regardless of account.
 void followup(Invitation invitation)
          If the userID isn't registered within an hour, cancel the activation
 void invitationQueueTest(int count)
           
 void queueInvitation(Invitation invitation)
          Send an invitation based on it's contents.
 void sendInvitation(Invitation invitation)
          Send an invitation based on it's contents.
 void sendNotifyMessage(java.lang.String subject, javax.mail.internet.InternetAddress addressee, java.lang.String message, java.lang.String emailFormat)
          Send an invitation to someone
 void sendTestMessage(java.lang.String addressee, java.lang.String emailFormat)
          Send a test message to the specified address.
 

Method Detail

sendTestMessage

void sendTestMessage(java.lang.String addressee,
                     java.lang.String emailFormat)
                     throws java.lang.Exception
Send a test message to the specified address. This will use the "/invitation/testMessage.xhtml" template. Note that the template has no access to information about the logged in user. This is because an invitation's context comes from the invitation object itself, not the logged in user and since a test message has no invitation object, the template only has generic information avalable to it. TODO: This method send the message in real-time whereas the real "sendInvitation" method is intended to be queued.

Parameters:
addressee - e-mail address of where to send test message.
Throws:
java.lang.Exception

sendNotifyMessage

void sendNotifyMessage(java.lang.String subject,
                       javax.mail.internet.InternetAddress addressee,
                       java.lang.String message,
                       java.lang.String emailFormat)
                       throws java.lang.Exception
Send an invitation to someone

Parameters:
addressee -
id -
message -
contextPath -
Throws:
java.lang.Exception

queueInvitation

void queueInvitation(Invitation invitation)
                     throws java.lang.Exception
Send an invitation based on it's contents. The actual work will occur later in a messageDrivenBean. This is for two reasons: 1) it offloads non-critical work to the background, and 2) the invitation must be committed to the database before the mail message is created because it is done in a separate "callback" process (the backend needs to call the frontend to format the html message body).

Parameters:
invitation -
Throws:
java.lang.Exception

invitationQueueTest

void invitationQueueTest(int count)
                         throws javax.jms.JMSException
Throws:
javax.jms.JMSException

sendInvitation

void sendInvitation(Invitation invitation)
                    throws java.lang.Exception
Send an invitation based on it's contents. Don't call this directly. It won't work. Use queueInvitation instead.

Parameters:
invitation -
Throws:
java.lang.Exception
See Also:
queueInvitation(org.tolven.doc.entity.Invitation)

findInvitation

Invitation findInvitation(long invitationId)
Get a Invitation by its internal ID

Parameters:
invitationId - the id of the Invitation
Returns:
the Invitation object

extractDetails

java.util.List<AdministrativeDetail> extractDetails(Invitation invitation)
                                                    throws javax.xml.bind.JAXBException
Extract the details as a list of object trees from the invitation XML

Parameters:
invitation -
Returns:
Throws:
javax.xml.bind.JAXBException

extractActivationDetails

ActivateInvitation extractActivationDetails(Invitation invitation)
                                            throws javax.xml.bind.JAXBException
Given an invitation, return the activation details contained within, if any, otherwise return null. This method is pretty special purpose for the UI and is intended for display only, not for executing the invitation.

Parameters:
invitation -
Returns:
Throws:
javax.xml.bind.JAXBException

createInvitation

Invitation createInvitation(java.lang.String principal,
                            InvitationDetail detail)
                            throws javax.xml.bind.JAXBException,
                                   java.io.IOException
Create a new invitation using the supplied details directed to the specified user

Throws:
java.io.IOException
javax.xml.bind.JAXBException

findOpenInvitations

java.util.List<Invitation> findOpenInvitations(TolvenUser user,
                                               java.util.Date now)
Find open invitations for this user, regardless of account. The invitation must be active and not expired.

Parameters:
user -
now -
Returns:
A list of invitations

executeInvitation

void executeInvitation(Invitation invitation,
                       java.util.Date now)
                       throws InvitationException,
                              javax.xml.bind.JAXBException,
                              java.io.IOException,
                              javax.naming.NamingException
Execute an invitation and if the invitation is chained, carry out all chained invitations as well. we stop either when we're done or if there's an error thrown.

Throws:
InvitationException
javax.xml.bind.JAXBException
java.io.IOException
javax.naming.NamingException

executeInvitation

void executeInvitation(long invitationId,
                       java.util.Date now)
                       throws InvitationException,
                              javax.xml.bind.JAXBException,
                              java.io.IOException,
                              javax.naming.NamingException
Execute an invitation and if the invitation is chained, carry out all chained invitations as well. we stop either when we're done or if there's an error thrown.

Throws:
InvitationException
javax.xml.bind.JAXBException
java.io.IOException
javax.naming.NamingException

followup

void followup(Invitation invitation)
If the userID isn't registered within an hour, cancel the activation