public class ProcessFaxClientSpi extends AbstractFax4JClientSpi
Template Parameter | Description |
file | The fax job file path |
target.address | The fax job target address |
target.name | The fax job target name |
sender.name | The fax job sender name |
sender.fax.number | The fax job sender fax number |
sender.email | The fax job sender email |
Name | Description | Preconfigured Value | Default Value | Mandatory |
org.fax4j.spi.process.submit.template.command | The submit fax job template command. | none | none | false |
org.fax4j.spi.process.suspend.template.command | The suspend fax job template command. | none | none | false |
org.fax4j.spi.process.resume.template.command | The resume fax job template command. | none | none | false |
org.fax4j.spi.process.cancel.template.command | The cancel fax job template command. | none | none | false |
org.fax4j.spi.process.get.status.template.command | The get status fax job template command. | none | none | false |
org.fax4j.spi.process.output.validator | The process output validator class name. | org.fax4j.spi.process.ExitCodeProcessOutputValidator | org.fax4j.spi.process.ExitCodeProcessOutputValidator | false |
org.fax4j.spi.process.output.handler | The process output handler class name. | none | none | false |
org.fax4j.spi.process.use.windows.command.prefix | True to add a windows command prefix to the command template. | false | false | false |
org.fax4j.spi.process.windows.command.prefix | True to add a windows command prefix to the command template. | rundll32 SHELL32.DLL,ShellExec_RunDLL | rundll32 SHELL32.DLL,ShellExec_RunDLL | false |
Modifier and Type | Class and Description |
---|---|
static class |
ProcessFaxClientSpi.FaxClientSpiConfigurationConstants
This class holds the SPI configuration constants.
|
AbstractFaxClientSpi.FaxJobExtendedPropertyConstants
Modifier and Type | Field and Description |
---|---|
protected boolean |
useWindowsCommandPrefix
The use windows command prefix flag
|
protected static String |
WINDOWS_EXECUTE_PREFIX_DEFAULT_VALUE
The windows execute prefix
|
Constructor and Description |
---|
ProcessFaxClientSpi()
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 String |
createCancelFaxJobProcessCommand(FaxJob faxJob)
Creates the process command from the fax job data.
|
protected String |
createGetStatusFaxJobProcessCommand(FaxJob faxJob)
Creates the process command from the fax job data.
|
protected String |
createProcessCommand(Enum<?> templateNameEnum,
FaxJob faxJob)
Creates the process command from the fax job data.
|
protected ProcessOutputHandler |
createProcessOutputHandler()
This function creates and returns the process output handler.
|
protected ProcessOutputValidator |
createProcessOutputValidator()
This function creates and returns the process output validator.
|
protected String |
createResumeFaxJobProcessCommand(FaxJob faxJob)
Creates the process command from the fax job data.
|
protected String |
createSubmitFaxJobProcessCommand(FaxJob faxJob)
Creates the process command from the fax job data.
|
protected String |
createSuspendFaxJobProcessCommand(FaxJob faxJob)
Creates the process command from the fax job data.
|
protected ProcessExecutorHelper.ProcessOutput |
executeProcess(FaxJob faxJob,
String command,
FaxActionType faxActionType)
Executes the process and returns the output.
|
protected String |
formatTemplate(String template,
FaxJob faxJob)
This function formats the provided template.
|
protected FaxJobStatus |
getFaxJobStatus(ProcessExecutorHelper.ProcessOutput processOutput)
This function extracts the fax job status from the process output.
|
protected FaxJobStatus |
getFaxJobStatusImpl(FaxJob faxJob)
This function returns the fax job status.
Not all SPIs support extraction of the fax job status. In case the SPI is unable to extract or does not support extracting of the fax job status, it will return the UNKNOWN status. |
protected ProcessOutputHandler |
getProcessOutputHandler()
This function returns the process output handler.
|
ProcessOutputValidator |
getProcessOutputValidator()
This function returns the process output validator.
|
String |
getPropertyPart()
Returns the property part.
Property parts enables to replace the input request key with the part defined to enable to reuse services with different configuration blocks. Property parts will be replaced with the {0} values in the key, for example org.fax4j.{0}.somekey with part abc will be replaced to org.fax4j.abc.somekey |
protected String |
getTemplate(String templateName)
This function returns the template for the given template name.
|
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 |
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.
|
protected void |
updateFaxJob(FaxJob faxJob,
ProcessExecutorHelper.ProcessOutput processOutput,
FaxActionType faxActionType)
Updates the fax job based on the data from the process output.
|
protected void |
validateProcessOutput(ProcessExecutorHelper.ProcessOutput processOutput,
FaxActionType faxActionType)
This function validates the process output for errors.
If not valid, an exception should be thrown. |
getProvider, isFaxMonitorEventsSupported, pollForFaxJobStatues, pollForFaxJobStatuesImpl
addFaxClientActionEventListener, addFaxMonitorEventListener, cancelFaxJob, createFaxJob, createFaxJobImpl, fireFaxEvent, fireFaxEvent, fireFaxMonitorEvent, getConfiguration, getConfigurationValue, getConfigurationValue, getFaxJobMonitor, getFaxJobStatus, getLogger, initialize, invokeFaxJobIDValidation, invokeFaxJobNullValidation, removeAllFaxClientActionEventListeners, removeAllFaxMonitorEventListeners, removeFaxClientActionEventListener, removeFaxMonitorEventListener, resumeFaxJob, submitFaxJob, suspendFaxJob, throwUnsupportedException
protected boolean useWindowsCommandPrefix
protected static final String WINDOWS_EXECUTE_PREFIX_DEFAULT_VALUE
public ProcessFaxClientSpi()
protected void initializeImpl()
initializeImpl
in class AbstractFaxClientSpi
public String getPropertyPart()
getPropertyPart
in interface ConfigurationHolder
getPropertyPart
in class AbstractFaxClientSpi
protected ProcessOutputValidator createProcessOutputValidator()
protected ProcessOutputHandler createProcessOutputHandler()
public final ProcessOutputValidator getProcessOutputValidator()
protected final ProcessOutputHandler getProcessOutputHandler()
protected 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 FaxJobStatus getFaxJobStatusImpl(FaxJob faxJob)
getFaxJobStatusImpl
in class AbstractFax4JClientSpi
faxJob
- The fax job object containing the needed informationprotected FaxJobStatus getFaxJobStatus(ProcessExecutorHelper.ProcessOutput processOutput)
processOutput
- The process outputprotected ProcessExecutorHelper.ProcessOutput executeProcess(FaxJob faxJob, String command, FaxActionType faxActionType)
faxJob
- The fax job objectcommand
- The command to executefaxActionType
- The fax action typeprotected String formatTemplate(String template, FaxJob faxJob)
template
- The templatefaxJob
- The fax job objectprotected String getTemplate(String templateName)
templateName
- The template nameprotected String createProcessCommand(Enum<?> templateNameEnum, FaxJob faxJob)
templateNameEnum
- The template namefaxJob
- The fax job objectprotected void validateProcessOutput(ProcessExecutorHelper.ProcessOutput processOutput, FaxActionType faxActionType)
processOutput
- The process output to validatefaxActionType
- The fax action typeprotected void updateFaxJob(FaxJob faxJob, ProcessExecutorHelper.ProcessOutput processOutput, FaxActionType faxActionType)
faxJob
- The fax job objectprocessOutput
- The process outputfaxActionType
- The fax action typeprotected String createSubmitFaxJobProcessCommand(FaxJob faxJob)
faxJob
- The fax job objectprotected String createSuspendFaxJobProcessCommand(FaxJob faxJob)
faxJob
- The fax job objectprotected String createResumeFaxJobProcessCommand(FaxJob faxJob)
faxJob
- The fax job objectprotected String createCancelFaxJobProcessCommand(FaxJob faxJob)
faxJob
- The fax job objectCopyright © 2009–2020 fax4j. All rights reserved.