public abstract class AbstractMailFaxClientSpi extends AbstractFax4JClientSpi
Name | Description | Preconfigured Value | Default Value | Mandatory |
org.fax4j.spi.mail.persistent.connection | True to reuse the same mail connection for all fax activites, false to create a new mail connection for each fax activity. | false | false | false |
org.fax4j.spi.mail.connection.factory.class.name | The connection factory class name | org.fax4j.spi.email.MailConnectionFactoryImpl | org.fax4j.spi.email.MailConnectionFactoryImpl | false |
org.fax4j.spi.mail.user.name | The mail account user name. | none | none | false |
org.fax4j.spi.mail.password | The mail account password. | none | none | false |
javax mail properties | Any of the javax mail properties can be defined in the fax4j properties. These properties will be passed to the java mail framework. |
mail.transport.protocol=smtp mail.smtp.port=25 |
none | false |
Modifier and Type | Class and Description |
---|---|
static class |
AbstractMailFaxClientSpi.FaxClientSpiConfigurationConstants
This class holds the SPI configuration constants.
|
AbstractFaxClientSpi.FaxJobExtendedPropertyConstants
Constructor and Description |
---|
AbstractMailFaxClientSpi()
This is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
cancelFaxJobImpl(FaxJob faxJob)
This function will cancel an existing fax job.
|
protected void |
closeMailConnection(Connection<MailResourcesHolder> mailConnection)
This function closes the provided mail connection.
|
protected abstract javax.mail.Message |
createCancelFaxJobMessage(FaxJob faxJob,
MailResourcesHolder mailResourcesHolder)
This function will create the message used to invoke the fax job action.
If this method returns null, the SPI will throw an UnsupportedOperationException. |
protected Connection<MailResourcesHolder> |
createMailConnection()
Creates and returns the mail connection to be used to send the fax via mail.
|
protected MailConnectionFactory |
createMailConnectionFactoryImpl(String className)
Creates and returns the mail connection factory.
|
protected abstract javax.mail.Message |
createResumeFaxJobMessage(FaxJob faxJob,
MailResourcesHolder mailResourcesHolder)
This function will create the message used to invoke the fax job action.
If this method returns null, the SPI will throw an UnsupportedOperationException. |
protected abstract javax.mail.Message |
createSubmitFaxJobMessage(FaxJob faxJob,
MailResourcesHolder mailResourcesHolder)
This function will create the message used to invoke the fax job action.
If this method returns null, the SPI will throw an UnsupportedOperationException. |
protected abstract javax.mail.Message |
createSuspendFaxJobMessage(FaxJob faxJob,
MailResourcesHolder mailResourcesHolder)
This function will create the message used to invoke the fax job action.
If this method returns null, the SPI will throw an UnsupportedOperationException. |
protected void |
finalize()
Releases the connection if open.
|
protected Connection<MailResourcesHolder> |
getMailConnection()
Returns the mail connection to be used to send the fax via mail.
|
protected void |
initializeImpl()
This function initializes the fax client SPI.
|
protected void |
resumeFaxJobImpl(FaxJob faxJob)
This function will resume an existing fax job.
|
protected void |
sendMail(FaxJob faxJob,
Connection<MailResourcesHolder> mailConnection,
javax.mail.Message message)
This function will send the mail message.
|
protected void |
submitFaxJobImpl(FaxJob faxJob)
This function will submit a new fax job.
The fax job ID may be populated by this method in the provided fax job object. |
protected void |
suspendFaxJobImpl(FaxJob faxJob)
This function will suspend an existing fax job.
|
getFaxJobStatusImpl, getProvider, isFaxMonitorEventsSupported, pollForFaxJobStatues, pollForFaxJobStatuesImpl
addFaxClientActionEventListener, addFaxMonitorEventListener, cancelFaxJob, createFaxJob, createFaxJobImpl, fireFaxEvent, fireFaxEvent, fireFaxMonitorEvent, getConfiguration, getConfigurationValue, getConfigurationValue, getFaxJobMonitor, getFaxJobStatus, getLogger, getPropertyPart, initialize, invokeFaxJobIDValidation, invokeFaxJobNullValidation, removeAllFaxClientActionEventListeners, removeAllFaxMonitorEventListeners, removeFaxClientActionEventListener, removeFaxMonitorEventListener, resumeFaxJob, submitFaxJob, suspendFaxJob, throwUnsupportedException
public AbstractMailFaxClientSpi()
protected void initializeImpl()
initializeImpl
in class AbstractFaxClientSpi
protected final MailConnectionFactory createMailConnectionFactoryImpl(String className)
className
- The connection factory class nameprotected void finalize() throws Throwable
protected Connection<MailResourcesHolder> createMailConnection()
protected void closeMailConnection(Connection<MailResourcesHolder> mailConnection) throws IOException
mailConnection
- The mail connection to closeIOException
- Never thrownprotected Connection<MailResourcesHolder> getMailConnection()
protected void sendMail(FaxJob faxJob, Connection<MailResourcesHolder> mailConnection, javax.mail.Message message)
faxJob
- The fax job object containing the needed informationmailConnection
- The mail connection (will be released if not persistent)message
- The message to sendprotected void submitFaxJobImpl(FaxJob faxJob)
submitFaxJobImpl
in class AbstractFax4JClientSpi
faxJob
- The fax job object containing the needed informationprotected void suspendFaxJobImpl(FaxJob faxJob)
suspendFaxJobImpl
in class AbstractFax4JClientSpi
faxJob
- The fax job object containing the needed informationprotected void resumeFaxJobImpl(FaxJob faxJob)
resumeFaxJobImpl
in class AbstractFax4JClientSpi
faxJob
- The fax job object containing the needed informationprotected void cancelFaxJobImpl(FaxJob faxJob)
cancelFaxJobImpl
in class AbstractFax4JClientSpi
faxJob
- The fax job object containing the needed informationprotected abstract javax.mail.Message createSubmitFaxJobMessage(FaxJob faxJob, MailResourcesHolder mailResourcesHolder)
faxJob
- The fax job object containing the needed informationmailResourcesHolder
- The mail resources holderprotected abstract javax.mail.Message createSuspendFaxJobMessage(FaxJob faxJob, MailResourcesHolder mailResourcesHolder)
faxJob
- The fax job object containing the needed informationmailResourcesHolder
- The mail resources holderprotected abstract javax.mail.Message createResumeFaxJobMessage(FaxJob faxJob, MailResourcesHolder mailResourcesHolder)
faxJob
- The fax job object containing the needed informationmailResourcesHolder
- The mail resources holderprotected abstract javax.mail.Message createCancelFaxJobMessage(FaxJob faxJob, MailResourcesHolder mailResourcesHolder)
faxJob
- The fax job object containing the needed informationmailResourcesHolder
- The mail resources holderCopyright © 2009–2020 fax4j. All rights reserved.