com.norconex.jef.mail
Class AbstractMailNotifier

java.lang.Object
  extended by com.norconex.jef.mail.AbstractMailNotifier
Direct Known Subclasses:
ErrorMailNotifier, SuiteCompletedMailNotifier

public abstract class AbstractMailNotifier
extends Object

Convenience base class for sending email notifications.

Author:
Pascal Essiembre

Constructor Summary
AbstractMailNotifier(String host, String sender, String recipient)
          Constructor.
AbstractMailNotifier(String host, String sender, String[] recipients)
          Constructor.
 
Method Summary
protected  String getLogTail(JobSuite suite, int lineQty)
          Gets the last lines from a suite log.
protected  SimpleMailer getMailer()
          Gets the mailer for this notifier.
protected  String[] getRecipients()
          Gets the email recipients for this notifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMailNotifier

public AbstractMailNotifier(String host,
                            String sender,
                            String recipient)
Constructor.

Parameters:
host - mail server host
sender - email address of sender ("From" field)
recipient - email address of recipient ("To" field)

AbstractMailNotifier

public AbstractMailNotifier(String host,
                            String sender,
                            String[] recipients)
Constructor.

Parameters:
host - mail server host
sender - email address of sender ("From" field)
recipients - email address of recipients ("To" field)
Method Detail

getMailer

protected final SimpleMailer getMailer()
Gets the mailer for this notifier.

Returns:
mailer

getRecipients

protected final String[] getRecipients()
Gets the email recipients for this notifier.

Returns:
email recipients

getLogTail

protected final String getLogTail(JobSuite suite,
                                  int lineQty)
                           throws IOException
Gets the last lines from a suite log.

Parameters:
suite - the suite to extract the log from
lineQty - the number of lines to retrieve
Returns:
string representation of log last lines
Throws:
IOException - problem getting lines


Copyright © 2007-2013 Norconex Inc.. All Rights Reserved.