T
- The specific data objectpublic abstract class AbstractMappingHTTPResponseHandler<T> extends AbstractHTTPResponseHandler
Modifier and Type | Field and Description |
---|---|
static String |
VALUES_SEPERATOR
The values seperator ';'
|
RESPONSE_DATA_ENCODING_PROPERTY_KEY
Constructor and Description |
---|
AbstractMappingHTTPResponseHandler()
This is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
convertToObject(HTTPResponse httpResponse)
This function converts the HTTP response content to the specific object.
|
protected String |
findError(T object)
This function will look for errors in the object and if found will return the error message.
If no errors were found, this method will return null. |
protected String |
findValue(HTTPResponse httpResponse,
String path)
This function returns the requested value from the HTTP response content.
The path is a set of key names seperated by ';'. |
protected String |
findValue(T object,
String path)
This function returns the requested value from the object data.
The path is a set of key names seperated by ';'. |
protected abstract String |
findValueImpl(T object,
String path)
This function returns the requested value from the object data.
The path is a set of key names seperated by ';'. |
protected abstract Enum<?> |
getErrorDetectionPathPropertyKey()
Returns the error detection path configuration key.
|
protected abstract Enum<?> |
getErrorDetectionValuePropertyKey()
Returns the error detection value configuration key.
|
protected abstract Enum<?> |
getErrorMessagePathPropertyKey()
Returns the error message path configuration key.
|
FaxJobStatus |
getFaxJobStatus(HTTPResponse httpResponse)
This function extracts the fax job status from the HTTP response data.
|
protected FaxJobStatus |
getFaxJobStatusFromStatusString(String faxJobStatusStr)
This function returns the fax job status value based on the fax job status string value.
|
protected String |
getPathToResponseData(FaxActionType faxActionType)
This function returns the path to the relevant response data.
|
protected void |
initializeImpl()
This function initializes the component.
|
protected abstract void |
populateFaxActionType2ReponseDataPathMappings()
This function populates the fax action type to response data path mappings based on the configuration of the
handler.
|
protected void |
populateFaxActionType2ReponseDataPathMappings(FaxActionType[] faxActionTypes,
Enum<?>[] configurationKeys)
This function populates the fax action type to response data path mappings based on the configuration of the
handler.
|
protected abstract void |
populateStatusString2FaxStatusMappings()
This function populates the status strings to fax status enum values based on the configuration of the handler.
|
protected void |
populateStatusString2FaxStatusMappings(FaxJobStatus[] faxJobStatuses,
Enum<?>[] configurationKeys)
This function populates the status strings to fax status enum values based on the configuration of the handler.
|
void |
updateFaxJob(FaxJob faxJob,
HTTPResponse httpResponse,
FaxActionType faxActionType)
Updates the fax job based on the data from the HTTP response data.
|
getResponseDataEncoding
getConfiguration, getConfigurationValue, getConfigurationValue, getLogger, getPropertyPart, getProvider, initialize, setPropertyPart
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setPropertyPart
getProvider
initialize
getConfiguration, getConfigurationValue, getConfigurationValue, getPropertyPart
public static final String VALUES_SEPERATOR
public AbstractMappingHTTPResponseHandler()
protected void initializeImpl()
initializeImpl
in class AbstractHTTPResponseHandler
protected void populateFaxActionType2ReponseDataPathMappings(FaxActionType[] faxActionTypes, Enum<?>[] configurationKeys)
faxActionTypes
- The fax action types used for the mappingconfigurationKeys
- The configuration keys used for the mappingprotected void populateStatusString2FaxStatusMappings(FaxJobStatus[] faxJobStatuses, Enum<?>[] configurationKeys)
faxJobStatuses
- The fax job statues used for the mappingconfigurationKeys
- The configuration keys used for the mappingprotected String getPathToResponseData(FaxActionType faxActionType)
faxActionType
- The fax action type used to select the pathprotected FaxJobStatus getFaxJobStatusFromStatusString(String faxJobStatusStr)
faxJobStatusStr
- The fax job status string valuepublic void updateFaxJob(FaxJob faxJob, HTTPResponse httpResponse, FaxActionType faxActionType)
faxJob
- The fax job objecthttpResponse
- The HTTP responsefaxActionType
- The fax action typepublic FaxJobStatus getFaxJobStatus(HTTPResponse httpResponse)
httpResponse
- The HTTP responseprotected String findValue(HTTPResponse httpResponse, String path)
httpResponse
- The HTTP responsepath
- The path to the value (elements seperated by ;)protected String findValue(T object, String path)
object
- The object holding all the datapath
- The path to the value (elements seperated by ;)protected String findError(T object)
object
- The object holding all the dataprotected abstract void populateFaxActionType2ReponseDataPathMappings()
protected abstract void populateStatusString2FaxStatusMappings()
protected abstract Enum<?> getErrorDetectionPathPropertyKey()
protected abstract Enum<?> getErrorDetectionValuePropertyKey()
protected abstract Enum<?> getErrorMessagePathPropertyKey()
protected abstract String findValueImpl(T object, String path)
object
- The object holding all the datapath
- The path to the value (elements seperated by ;)protected abstract T convertToObject(HTTPResponse httpResponse)
httpResponse
- The HTTP responseCopyright © 2009–2020 fax4j. All rights reserved.