|
© 2001 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.bea.commerce.platform.mail.MailServiceBean
Remote interface to the MailService stateless session bean. This bean provides basic mail-sending capabilities for sending text email messages.
The smtp server can be specified in the bean's deployment descriptor, or in the weblogic commerce properties file (entries in the deployment descriptor will override those in the properties file).
Constructor Summary | |
MailServiceBean()
|
Method Summary | |
void |
addToBatch(MailMessage message,
java.lang.String batch)
Add a MailMessage to a batch so that it can be sent later. |
protected void |
close(java.sql.Connection conn)
|
protected void |
close(java.sql.PreparedStatement ps)
|
protected void |
close(java.sql.ResultSet rs)
|
protected MailRecipients |
createRecipients(java.util.ArrayList toAddresses,
java.util.ArrayList ccAddresses,
java.util.ArrayList bccAddresses)
|
void |
deleteBatch(java.lang.String batch)
Delete a batch and all of its messages |
void |
ejbActivate()
This method is required by the EJB Specification, but is not used by this class. |
void |
ejbCreate()
Creates the session bean. |
void |
ejbPassivate()
This method is required by the EJB Specification, but is not used by this class. |
void |
ejbRemove()
This method is required by the EJB Specification, but is not used by this class. |
java.util.ArrayList |
getBatchNames()
Return all batch names in the system |
int |
getBatchSize(java.lang.String batch)
Return the size of a batch. |
protected java.sql.Connection |
getConnection()
|
ServletResults |
getJSPResults(java.lang.String url,
java.util.Map params)
Similar to getTextFromJSP; but will retrieve contents of the jsp page as a byte array to cut down on string encoding hassles. |
protected com.bea.commerce.platform.mail.Session |
getMailSession()
|
java.util.ArrayList |
getMessagesInBatch(java.lang.String batch,
boolean getText)
Retrieve all messages in a batch. |
protected long |
getNextAddressId(java.sql.Connection con)
|
protected long |
getNextBatchId(java.sql.Connection con)
|
protected long |
getNextHeaderId(java.sql.Connection con)
|
protected long |
getNextMessageId(java.sql.Connection con)
|
protected javax.ejb.SessionContext |
getSessionContext()
|
java.lang.String |
getTextFromJSP(java.lang.String url,
java.util.Map params)
Generate text from a JSP page for use in an email message. |
boolean |
isValidAddress(java.lang.String address)
|
void |
sendBatch(java.lang.String batch,
boolean delete)
Send all the messages in a batch. |
void |
sendMail(MailMessage message)
Send an email message immediately. |
void |
sendMail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String text)
The simplest way to send a mail message; supply the basic information and the message will be sent immediately. |
void |
setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context. |
protected void |
validateMailRecipients(MailRecipients recipients)
Utility method to check that a MailRecipients object is valid; it must contain at least one 'to' address, and all addresses must be valid addresses. |
Constructor Detail |
public MailServiceBean()
Method Detail |
public void ejbCreate()
public void ejbActivate()
public void ejbRemove()
public void ejbPassivate()
public void setSessionContext(javax.ejb.SessionContext ctx)
ctx
- Context for sessionprotected javax.ejb.SessionContext getSessionContext()
public void sendMail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String text) throws java.lang.IllegalArgumentException
to
- The address to mail tofrom
- The "from" addresssubject
- The message's subject. Can be null.text
- The message's text. Can be null.java.lang.IllegalArgumentException
- If the "to" address is null or invalidpublic void sendMail(MailMessage message) throws java.lang.IllegalArgumentException
message
- A MailMessage to send.java.lang.IllegalArgumentException
- if the MailMessage is not validpublic void addToBatch(MailMessage message, java.lang.String batch) throws java.lang.IllegalArgumentException
message
- A MailMessage to batchbatch
- the name of the batch to add it tojava.lang.IllegalArgumentException
- if the MailMessage is not validpublic void sendBatch(java.lang.String batch, boolean delete)
batch
- the name of the batch to sendpublic void deleteBatch(java.lang.String batch)
batch
- the name of the batch to deletepublic java.util.ArrayList getMessagesInBatch(java.lang.String batch, boolean getText)
batch
- the name of the batch to examinegetText
- flag to retrieve message textpublic int getBatchSize(java.lang.String batch)
batch
- the name of the batch to examinepublic java.util.ArrayList getBatchNames()
public java.lang.String getTextFromJSP(java.lang.String url, java.util.Map params) throws java.io.IOException
url
- the URL of the jsp page.params
- a map of parameters to pass to the JSPpublic ServletResults getJSPResults(java.lang.String url, java.util.Map params) throws java.io.IOException
protected void validateMailRecipients(MailRecipients recipients) throws java.lang.IllegalArgumentException
recipients
- the MailRecipients object to checkpublic boolean isValidAddress(java.lang.String address)
protected com.bea.commerce.platform.mail.Session getMailSession()
protected java.sql.Connection getConnection() throws java.sql.SQLException
protected void close(java.sql.Connection conn)
protected void close(java.sql.PreparedStatement ps)
protected void close(java.sql.ResultSet rs)
protected MailRecipients createRecipients(java.util.ArrayList toAddresses, java.util.ArrayList ccAddresses, java.util.ArrayList bccAddresses)
protected long getNextMessageId(java.sql.Connection con) throws java.sql.SQLException
protected long getNextBatchId(java.sql.Connection con) throws java.sql.SQLException
protected long getNextHeaderId(java.sql.Connection con) throws java.sql.SQLException
protected long getNextAddressId(java.sql.Connection con) throws java.sql.SQLException
|
© 2001 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |