org.opennms.web
Class ReportMailer

java.lang.Object
  extended by org.opennms.web.ReportMailer
All Implemented Interfaces:
Runnable

public class ReportMailer
extends Object
implements Runnable

Author:
Jacinta Remedios , OpenNMS

Field Summary
protected  String categoryName
           
protected  String commandParms
           
protected  String filename
           
protected  String finalEmailAddr
           
protected  String format
           
protected  String logoUrl
           
protected  String monthFormat
           
protected  String scriptGenerateReport
           
protected  String scriptMailReport
           
protected  String startDate
           
protected  String startMonth
           
protected  String startYear
           
protected  UserManager userFactory
           
protected  boolean useScript
           
 
Constructor Summary
ReportMailer()
           
 
Method Summary
protected  void generateFile(String shellScript)
          returns the fully-qualified filename of the generated PDF report
 String getCategoryName()
           
 String getEmailAddress()
           
protected  String getEmailAddress(String username)
          returns null if no email address is configured for the user
 String getFormat()
           
 String getLogoUrl()
           
 String getMonthFormat()
           
 String getStartDate()
           
 String getStartMonth()
           
 String getStartYear()
           
 void initialise(String fileName, String userName, String generateReport, String mailReport, String parms, String fmt, String monthFmt, String startMonth, String startDate, String startYear)
           
 boolean isUseScript()
           
protected  void mailFileToUser(String filename, String emailAddr)
           
protected  void mailFileToUser(String mailScript, String filename, String emailAddr)
           
 void run()
           
 void setCategoryName(String categoryName)
           
 void setFormat(String format)
           
 void setLogoUrl(String logo)
           
 void setMonthFormat(String monthFormat)
           
 void setStartDate(String startDate)
           
 void setStartMonth(String startMonth)
           
 void setStartYear(String startYear)
           
 void setUseScript(boolean useScript)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scriptGenerateReport

protected String scriptGenerateReport

scriptMailReport

protected String scriptMailReport

finalEmailAddr

protected String finalEmailAddr

userFactory

protected UserManager userFactory

filename

protected String filename

commandParms

protected String commandParms

useScript

protected boolean useScript

logoUrl

protected String logoUrl

format

protected String format

monthFormat

protected String monthFormat

startMonth

protected String startMonth

startDate

protected String startDate

startYear

protected String startYear

categoryName

protected String categoryName
Constructor Detail

ReportMailer

public ReportMailer()
             throws ServletException
Throws:
ServletException
Method Detail

initialise

public void initialise(String fileName,
                       String userName,
                       String generateReport,
                       String mailReport,
                       String parms,
                       String fmt,
                       String monthFmt,
                       String startMonth,
                       String startDate,
                       String startYear)
                throws ServletException
Throws:
ServletException

getEmailAddress

public String getEmailAddress()

run

public void run()
Specified by:
run in interface Runnable

getEmailAddress

protected String getEmailAddress(String username)
                          throws IOException,
                                 org.exolab.castor.xml.MarshalException,
                                 org.exolab.castor.xml.ValidationException
returns null if no email address is configured for the user

Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

generateFile

protected void generateFile(String shellScript)
                     throws IOException,
                            InterruptedException
returns the fully-qualified filename of the generated PDF report

Throws:
IOException
InterruptedException

mailFileToUser

protected void mailFileToUser(String mailScript,
                              String filename,
                              String emailAddr)
                       throws IOException
Throws:
IOException

mailFileToUser

protected void mailFileToUser(String filename,
                              String emailAddr)
                       throws IOException
Throws:
IOException

isUseScript

public boolean isUseScript()
Returns:
Returns the useScript value.

setUseScript

public void setUseScript(boolean useScript)
Parameters:
useScript - Set this to use the script specified.

getLogoUrl

public String getLogoUrl()
Returns:
Returns the logo.

setLogoUrl

public void setLogoUrl(String logo)
Parameters:
logo - The logo to set.

getCategoryName

public String getCategoryName()
Returns:
Returns the categoryName.

setCategoryName

public void setCategoryName(String categoryName)
Parameters:
categoryName - The categoryName to set.

getMonthFormat

public String getMonthFormat()
Returns:
Returns the monthFormat.

setMonthFormat

public void setMonthFormat(String monthFormat)
Parameters:
format - The format to set.

getFormat

public String getFormat()
Returns:
Returns the format.

setFormat

public void setFormat(String format)
Parameters:
format - The format to set.

getStartMonth

public String getStartMonth()
Returns:
Returns the startMonth.

setStartMonth

public void setStartMonth(String startMonth)
Parameters:
format - The startMonth to set.

getStartDate

public String getStartDate()
Returns:
Returns the startDate.

setStartDate

public void setStartDate(String startDate)
Parameters:
format - The startDate to set.

getStartYear

public String getStartYear()
Returns:
Returns the startYear.

setStartYear

public void setStartYear(String startYear)
Parameters:
format - The startYear to set.


Copyright © 2009. All Rights Reserved.