public abstract class AbstractFaxClientSpi extends Object implements FaxClientSpi
Modifier and Type | Class and Description |
---|---|
static class |
AbstractFaxClientSpi.FaxJobExtendedPropertyConstants
This class holds the fax job extended properties.
|
Constructor and Description |
---|
AbstractFaxClientSpi()
This is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFaxClientActionEventListener(FaxClientActionEventListener listener)
This function adds the fax client action event listener to the internal fax event listeners data structure.
|
void |
addFaxMonitorEventListener(FaxMonitorEventListener listener)
This function adds the fax monitor event listener to the internal fax event listeners data structure.
Fax jobs will be monitored only if there are active listeners registered. If the listeners are added after a fob job was submitted, that fax job would not be monitored. Not all SPIs support monitoring events, in which case this method will throw an exception. |
void |
cancelFaxJob(FaxJob faxJob)
This function will cancel an existing fax job.
|
protected abstract void |
cancelFaxJobImpl(FaxJob faxJob)
This function will cancel an existing fax job.
|
FaxJob |
createFaxJob()
This function creates a new fax job instance to be used by the caller to submit a new fax job and so on.
|
protected FaxJob |
createFaxJobImpl()
This function creates a new fax job instance to be used by the caller to submit a new fax job and so on.
|
protected void |
fireFaxEvent(FaxClientActionEvent.FaxClientActionEventID id,
FaxJob faxJob)
This function fires a new fax event.
|
protected void |
fireFaxEvent(FaxMonitorEvent.FaxMonitorEventID id,
FaxJob faxJob,
FaxJobStatus faxJobStatus)
This function fires a new fax event.
|
void |
fireFaxMonitorEvent(FaxMonitorEvent.FaxMonitorEventID id,
FaxJob faxJob,
FaxJobStatus faxJobStatus)
This function fires a new fax monitor event.
|
Map<String,String> |
getConfiguration()
Returns the configuration.
|
String |
getConfigurationValue(Enum<?> key)
Returns the value from the component configuration based on the provided configuration key.
|
String |
getConfigurationValue(String key)
Returns the value from the component configuration based on the provided configuration key.
|
FaxJobMonitor |
getFaxJobMonitor()
Returns the fax job monitor.
|
FaxJobStatus |
getFaxJobStatus(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 abstract 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. |
Logger |
getLogger()
Returns the internal logger.
|
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 |
void |
initialize(Map<String,String> configuration,
Logger logger,
FaxJobMonitor faxJobMonitor)
This function initializes the fax client SPI.
This method is called by the FaxClientSpiFactory. |
protected abstract void |
initializeImpl()
This function initializes the fax client SPI.
|
protected void |
invokeFaxJobIDValidation(FaxJob faxJob)
This function invokes the fax job null validation.
|
protected void |
invokeFaxJobNullValidation(FaxJob faxJob)
This function invokes the fax job null validation.
|
void |
removeAllFaxClientActionEventListeners()
This function removes all fax client action event listeners from the internal fax event listeners data structure.
|
void |
removeAllFaxMonitorEventListeners()
This function removes all fax monitor event listeners from the internal fax event listeners data structure.
Not all SPIs support monitoring events. |
void |
removeFaxClientActionEventListener(FaxClientActionEventListener listener)
This function removes the fax client action event listener from the internal fax event listeners data structure.
|
void |
removeFaxMonitorEventListener(FaxMonitorEventListener listener)
This function removes the fax monitor event listener from the internal fax event listeners data structure.
Not all SPIs support monitoring events. |
void |
resumeFaxJob(FaxJob faxJob)
This function will resume an existing fax job.
|
protected abstract void |
resumeFaxJobImpl(FaxJob faxJob)
This function will resume an existing fax job.
|
void |
submitFaxJob(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 abstract 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. |
void |
suspendFaxJob(FaxJob faxJob)
This function will suspend an existing fax job.
|
protected abstract void |
suspendFaxJobImpl(FaxJob faxJob)
This function will suspend an existing fax job.
|
protected void |
throwUnsupportedException()
This function throws unsupported operation exception.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isFaxMonitorEventsSupported, pollForFaxJobStatues
getProvider
public AbstractFaxClientSpi()
public final void initialize(Map<String,String> configuration, Logger logger, FaxJobMonitor faxJobMonitor)
initialize
in interface FaxClientSpi
configuration
- The fax client configurationlogger
- The internal loggerfaxJobMonitor
- The fax job monitorpublic final Logger getLogger()
getLogger
in interface FaxClientSpi
public final FaxJobMonitor getFaxJobMonitor()
getFaxJobMonitor
in interface FaxClientSpi
public String getPropertyPart()
getPropertyPart
in interface ConfigurationHolder
public Map<String,String> getConfiguration()
getConfiguration
in interface ConfigurationHolder
public final String getConfigurationValue(String key)
getConfigurationValue
in interface ConfigurationHolder
key
- The configuration keypublic final String getConfigurationValue(Enum<?> key)
getConfigurationValue
in interface ConfigurationHolder
key
- The configuration key (toString value will be used)public final void fireFaxMonitorEvent(FaxMonitorEvent.FaxMonitorEventID id, FaxJob faxJob, FaxJobStatus faxJobStatus)
fireFaxMonitorEvent
in interface FaxClientSpi
id
- The fax monitor event IDfaxJob
- The fax jobfaxJobStatus
- The fax job statuspublic FaxJob createFaxJob()
createFaxJob
in interface FaxClientActions
public void submitFaxJob(FaxJob faxJob)
submitFaxJob
in interface FaxClientActions
faxJob
- The fax job object containing the needed informationpublic void suspendFaxJob(FaxJob faxJob)
suspendFaxJob
in interface FaxClientActions
faxJob
- The fax job object containing the needed informationpublic void resumeFaxJob(FaxJob faxJob)
resumeFaxJob
in interface FaxClientActions
faxJob
- The fax job object containing the needed informationpublic void cancelFaxJob(FaxJob faxJob)
cancelFaxJob
in interface FaxClientActions
faxJob
- The fax job object containing the needed informationpublic FaxJobStatus getFaxJobStatus(FaxJob faxJob)
getFaxJobStatus
in interface FaxClientActions
faxJob
- The fax job object containing the needed informationpublic void addFaxClientActionEventListener(FaxClientActionEventListener listener)
addFaxClientActionEventListener
in interface FaxClientActions
listener
- The fax client action event listenerpublic void removeFaxClientActionEventListener(FaxClientActionEventListener listener)
removeFaxClientActionEventListener
in interface FaxClientActions
listener
- The fax client action event listenerpublic void removeAllFaxClientActionEventListeners()
removeAllFaxClientActionEventListeners
in interface FaxClientActions
public void addFaxMonitorEventListener(FaxMonitorEventListener listener)
addFaxMonitorEventListener
in interface FaxClientActions
listener
- The fax monitor event listenerpublic void removeFaxMonitorEventListener(FaxMonitorEventListener listener)
removeFaxMonitorEventListener
in interface FaxClientActions
listener
- The fax monitor event listenerpublic void removeAllFaxMonitorEventListeners()
removeAllFaxMonitorEventListeners
in interface FaxClientActions
protected void fireFaxEvent(FaxClientActionEvent.FaxClientActionEventID id, FaxJob faxJob)
id
- The fax event IDfaxJob
- The fax jobprotected void fireFaxEvent(FaxMonitorEvent.FaxMonitorEventID id, FaxJob faxJob, FaxJobStatus faxJobStatus)
id
- The fax event IDfaxJob
- The fax jobfaxJobStatus
- The fax job statusprotected void invokeFaxJobNullValidation(FaxJob faxJob)
faxJob
- The fax jobprotected void invokeFaxJobIDValidation(FaxJob faxJob)
faxJob
- The fax jobprotected void throwUnsupportedException()
protected FaxJob createFaxJobImpl()
protected abstract void initializeImpl()
protected abstract void submitFaxJobImpl(FaxJob faxJob)
faxJob
- The fax job object containing the needed informationprotected abstract void suspendFaxJobImpl(FaxJob faxJob)
faxJob
- The fax job object containing the needed informationprotected abstract void resumeFaxJobImpl(FaxJob faxJob)
faxJob
- The fax job object containing the needed informationprotected abstract void cancelFaxJobImpl(FaxJob faxJob)
faxJob
- The fax job object containing the needed informationprotected abstract FaxJobStatus getFaxJobStatusImpl(FaxJob faxJob)
faxJob
- The fax job object containing the needed informationCopyright © 2009–2020 fax4j. All rights reserved.