public class HTTPFaxClientSpi extends AbstractFax4JClientSpi
Name | Description | Preconfigured Value | Default Value | Mandatory |
org.fax4j.spi.http.client.class.name | The HTTP client class name used to submit the HTTP requests | org.fax4j.spi.http.ApacheHTTPClient | org.fax4j.spi.http.ApacheHTTPClient | false |
org.fax4j.spi.http.faxjob2request.converter.class.name | The fax job to HTTP request converter class name used to convert the fax job data into the relevant HTTP request. | org.fax4j.spi.http.MultiPartFaxJob2HTTPRequestConverter | org.fax4j.spi.http.MultiPartFaxJob2HTTPRequestConverter | false |
org.fax4j.spi.http.response.handler.class.name | The HTTP response handler class name used to update the fax job data based on the HTTP response. | org.fax4j.spi.http.JSONHTTPResponseHandler | org.fax4j.spi.http.JSONHTTPResponseHandler | false |
org.fax4j.spi.http.host.name | The target (service provider) host name. | none | none | true |
org.fax4j.spi.http.port | The target port number. | none | none | false |
org.fax4j.spi.http.ssl | True to use SSL (HTTPS), false for simple HTTP | false | false | false |
org.fax4j.spi.http.submit.resource | The default HTTP resource of the submit fax job request | none | none | false |
org.fax4j.spi.http.suspend.resource | The default HTTP resource of the suspend fax job request | none | none | false |
org.fax4j.spi.http.resume.resource | The default HTTP resource of the resume fax job request | none | none | false |
org.fax4j.spi.http.cancel.resource | The default HTTP resource of the cancel fax job request | none | none | false |
org.fax4j.spi.http.get.status.resource | The default HTTP resource of the get fax job status request | none | none | false |
org.fax4j.spi.http.url.parameters | The default HTTP URL parameters of the request | none | none | false |
org.fax4j.spi.http.submit.method | The HTTP method for the submit action | POST | POST | false |
org.fax4j.spi.http.suspend.method | The HTTP method for the suspend action | POST | POST | false |
org.fax4j.spi.http.resume.method | The HTTP method for the resume action | POST | POST | false |
org.fax4j.spi.http.cancel.method | The HTTP method for the cancel action | POST | POST | false |
org.fax4j.spi.http.get.status.method | The HTTP method for the get fax job status action | POST | POST | false |
Modifier and Type | Class and Description |
---|---|
static class |
HTTPFaxClientSpi.FaxClientSpiConfigurationConstants
This class holds the SPI configuration constants.
|
AbstractFaxClientSpi.FaxJobExtendedPropertyConstants
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_PROPERTY_PART
The HTTP property part
|
Constructor and Description |
---|
HTTPFaxClientSpi()
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 HTTPRequest |
createCancelFaxJobHTTPRequest(FaxJob faxJob)
Creates the HTTP request from the fax job data.
|
protected FaxJob2HTTPRequestConverter |
createFaxJob2HTTPRequestConverter()
This function creates and returns a new faxjob to HTTP request converter instance.
|
protected HTTPRequest |
createGetFaxJobStatusHTTPRequest(FaxJob faxJob)
Creates the HTTP request from the fax job data.
|
protected HTTPClientConfiguration |
createHTTPClientConfiguration()
This function creates and returns the HTTP configuration object.
|
protected HTTPResponseHandler |
createHTTPResponseHandler()
This function creates and returns a new HTTP response handler.
|
protected HTTPRequest |
createResumeFaxJobHTTPRequest(FaxJob faxJob)
Creates the HTTP request from the fax job data.
|
protected HTTPRequest |
createSubmitFaxJobHTTPRequest(FaxJob faxJob)
Creates the HTTP request from the fax job data.
|
protected HTTPRequest |
createSuspendFaxJobHTTPRequest(FaxJob faxJob)
Creates the HTTP request from the fax job data.
|
protected FaxJob2HTTPRequestConverter |
getFaxJob2HTTPRequestConverter()
Returns the fax job to HTTP request converter.
|
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 HTTPClient |
getHTTPClient()
Returns the HTTP client.
|
protected HTTPClientConfiguration |
getHTTPClientConfiguration()
Returns the HTTP client configuration.
|
protected String |
getHTTPResource(FaxActionType faxActionType)
This function returns the HTTP resource.
|
protected HTTPResponseHandler |
getHTTPResponseHandler()
Returns the HTTP response handler.
|
protected String |
getHTTPURLParameters()
This function returns the HTTP URL parameters.
|
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 Map<FaxActionType,String> |
initializeFaxActionType2ResourceMap()
This function initializes the fax action type to resource mappings.
|
protected void |
initializeImpl()
This function initializes the fax client SPI.
|
protected String |
initializeURLParameters()
This function returns the HTTP URL parameters from the configuration.
|
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 HTTPResponse |
submitHTTPRequest(FaxJob faxJob,
HTTPRequest httpRequest,
FaxActionType faxActionType)
Submits the HTTP request and returns the HTTP response.
|
protected HTTPResponse |
submitHTTPRequestImpl(HTTPRequest httpRequest,
HTTPClient.HTTPMethod httpMethod)
Submits the HTTP request and returns the HTTP response.
|
protected void |
suspendFaxJobImpl(FaxJob faxJob)
This function will suspend an existing fax job.
|
protected void |
updateFaxJob(FaxJob faxJob,
HTTPResponse httpResponse,
FaxActionType faxActionType)
Updates the fax job based on the data from the HTTP response.
|
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
public static final String HTTP_PROPERTY_PART
protected void initializeImpl()
initializeImpl
in class AbstractFaxClientSpi
public String getPropertyPart()
getPropertyPart
in interface ConfigurationHolder
getPropertyPart
in class AbstractFaxClientSpi
protected HTTPClientConfiguration createHTTPClientConfiguration()
protected FaxJob2HTTPRequestConverter createFaxJob2HTTPRequestConverter()
protected HTTPResponseHandler createHTTPResponseHandler()
protected Map<FaxActionType,String> initializeFaxActionType2ResourceMap()
protected String initializeURLParameters()
protected final HTTPClient getHTTPClient()
protected final HTTPClientConfiguration getHTTPClientConfiguration()
protected final FaxJob2HTTPRequestConverter getFaxJob2HTTPRequestConverter()
protected final HTTPResponseHandler getHTTPResponseHandler()
protected final String getHTTPResource(FaxActionType faxActionType)
faxActionType
- The fax action typeprotected final String getHTTPURLParameters()
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 HTTPResponse submitHTTPRequest(FaxJob faxJob, HTTPRequest httpRequest, FaxActionType faxActionType)
faxJob
- The fax job objecthttpRequest
- The HTTP request to sendfaxActionType
- The fax action typeprotected HTTPResponse submitHTTPRequestImpl(HTTPRequest httpRequest, HTTPClient.HTTPMethod httpMethod)
httpRequest
- The HTTP request to sendhttpMethod
- The HTTP method to useprotected void updateFaxJob(FaxJob faxJob, HTTPResponse httpResponse, FaxActionType faxActionType)
faxJob
- The fax job objecthttpResponse
- The HTTP responsefaxActionType
- The fax action typeprotected HTTPRequest createSubmitFaxJobHTTPRequest(FaxJob faxJob)
faxJob
- The fax job objectprotected HTTPRequest createSuspendFaxJobHTTPRequest(FaxJob faxJob)
faxJob
- The fax job objectprotected HTTPRequest createResumeFaxJobHTTPRequest(FaxJob faxJob)
faxJob
- The fax job objectprotected HTTPRequest createCancelFaxJobHTTPRequest(FaxJob faxJob)
faxJob
- The fax job objectprotected HTTPRequest createGetFaxJobStatusHTTPRequest(FaxJob faxJob)
faxJob
- The fax job objectCopyright © 2009–2020 fax4j. All rights reserved.