com.efaxdeveloper.util.inbound
Class InboundRequest

java.lang.Object
  extended by com.efaxdeveloper.util.inbound.InboundRequest

public class InboundRequest
extends java.lang.Object

InboundRequest application interface

Overview

InboundRequest is the application interface between eFax Developer™ and a client-side inbound POST request program or process.

The following snippet provides an example of how the InboundRequest application interface might be used within a client-side process:

   // Establish a PrintWriter for the response  
   PrintWriter out = response.getWriter();

   // Begin building the HTML response
   out.println("<html>");
   out.println("<head><title>InboundRequestServlet</title></head>");
   out.println("<body bgcolor=\"#ffffff\">");
   out.println("<p>The servlet has received a GET. This is the reply.</p>");

   // Establish the path to your XSD schema when XML validation is desired
   String xsdPath = "C:\\samples\\inbound\\Sample.xsd";

   try {

     // Establish a new InboundRequest object with XSD validation
     InboundRequest req = new InboundRequest(request.getParameter("xml"), xsdPath);

     // Decode the Base64 encoded document to a specified location. The file
     // will be stored to your specified path using the fax name retrieved from
     // the XML POST FaxName parameter. Note that you are providing a directory
     // path to a location where you would like the physical file to be written.
     // The following method call is not required. If the following method is not
     // called, a hard copy of the physical fax will not be generated on your server.
     req.getDocumentAsFile("C:\\samples\\inbound\\");

     // Retrieve the wrapper data for the inbound fax
     out.println("<br>UserName:      " + req.getUserName());
     out.println("<br>Password:      " + req.getPassword());
     out.println("<br>RequestDate:   " + req.getRequestDateAsString());
     out.println("<br>RequestType:   " + req.getRequestType());
     out.println("<br>AccountID:     " + req.getAccountID());
     out.println("<br>NumberDialed:  " + req.getNumberDialed());
     out.println("<br>DateReceived:  " + req.getDateReceivedAsString());
     out.println("<br>FaxName:       " + req.getFaxName());
     out.println("<br>FileType:      " + req.getFileType());
     out.println("<br>PageCount:     " + req.getPageCount());
     out.println("<br>CSID:          " + req.getCSID());
     out.println("<br>ANI:           " + req.getANI());
     out.println("<br>Status:        " + req.getStatus());
     out.println("<br>MCFID:         " + req.getMCFID());

     // When user field name/value pairs have been passed (optional setting)
     if (req.hasUserFields()) {
       // Begin processing user name/value pairs
       out.println("<p><b>UserField name/value pair(s) follow:<br></b>");
       // Establish a TreeMap object to hold the user name/value pairs
       Map<String, String> userFields = new TreeMap<String, String>(req.getUserFields());
       // Store the TreeMap contents to an ArrayList object for sorting
       ArrayList<String> keys = new ArrayList<String>(userFields.keySet());
       // Establish an Iterator object for the List object
       Iterator<String> iterator = keys.iterator();
       // Establish a String object to hold the user field name
       String fieldName  = "";
       // Establish a String object to hold the user field value
       String fieldValue = "";
       // Spin through the list of user name/value pairs
       while(iterator.hasNext()) {
         // Store the field name value
         fieldName  = (String)iterator.next();
         // Store the field value
         fieldValue = (String)userFields.get(fieldName);
         // Print the user name/value pairs received in the XML
         out.println("<br>" + fieldName + ": " + fieldValue);
       }
       out.println("</p>");
     }

     // When barcode fields have been passed (optional setting)
     if (req.hasBarcodes()) {
       // Begin processing barcode fields
       out.println("<p><b>Barcode value(s) follow:</b><br>");
       // Establish a new ArrayList object to hold all Barcode objects. Use
       // the getBarcodesByPage(int) method to return all Barcode objects
       // from a specified page.
       ArrayList<Barcode> barcodes = new ArrayList<Barcode>(req.getBarcodes());
       // Establish a null Barcode reference
       Barcode b = null;
       // Establish an iterator Object
       Iterator<Barcode> iterator = barcodes.iterator();
       // Process each Barcode object
       while (iterator.hasNext()) {
         // Retrieve a Barcode object
         b = new Barcode(iterator.next());
         // Retrieve the Barcode state
         out.println("<br>Key:           " + b.getKey());
         out.println("<br>ReadSequence:  " + b.getReadSequence());
         out.println("<br>ReadDirection: " + b.getReadDirection());
         out.println("<br>Symbology:     " + b.getSymbology());
         out.println("<br>PageNumber:    " + b.getPageNumber());
         out.println("<br>XStartPointA:  " + b.getXStartPointA());
         out.println("<br>XStartPointB:  " + b.getXStartPointB());
         out.println("<br>YStartPointA:  " + b.getYStartPointA());
         out.println("<br>YStartPointB:  " + b.getYStartPointB());
         out.println("<br>XEndPointA:    " + b.getXEndPointA());
         out.println("<br>XEndPointB:    " + b.getXEndPointB());
         out.println("<br>YEndPointA:    " + b.getYEndPointA());
         out.println("<br>YEndPointB:    " + b.getYEndPointB());
         out.println("<br>--------------------------------------------");
       }
       out.println("</p>");
     }

     // The existence of the following string anywhere in your output display
     // will cause eFax Developer to move the inbound fax into your desired "Good"
     // folder. Otherwise, eFax Developer will consider the XML POST attempt a
     // failure and the inbound fax will be moved into your desired "Bad" folder.
     out.println("<p>Post Successful</p>");

   }
   catch (Exception e) {
     e.printStackTrace();
     out.println("<p>Post Failed!</p>");
   }
   catch (Error err) {
     err.printStackTrace();
     out.println("<p>Post Failed!</p>");
   }  
   finally {
     out.println("</body></html>");
     out.flush();
     out.close(); 
   }
   
 

Since:
1.0
Version:
2.0
See Also:
Barcode

Field Summary
static java.lang.String DF_01
          Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 13:30:00" (Default)
static java.lang.String DF_02
          Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 13:30"
static java.lang.String DF_03
          Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 12:30:00 PM"
static java.lang.String DF_04
          Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 12:30 PM"
static java.lang.String DF_05
          Date format "01/01/2005 12:30:00 PM" returns "01/01/2005"
static java.lang.String DF_06
          Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 13:30:00"
static java.lang.String DF_07
          Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 13:30"
static java.lang.String DF_08
          Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 12:30:00 PM"
static java.lang.String DF_09
          Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 12:30 PM"
static java.lang.String DF_10
          Date format "01/01/2005 12:30:00 PM" returns "2005/01/01"
static java.lang.String DF_11
          Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 13:30:00"
static java.lang.String DF_12
          Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 13:30"
static java.lang.String DF_13
          Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 12:30:00 PM"
static java.lang.String DF_14
          Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 12:30 PM"
static java.lang.String DF_15
          Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005"
static java.lang.String DF_16
          Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 13:30:00"
static java.lang.String DF_17
          Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 13:30"
static java.lang.String DF_18
          Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 12:30:00 PM"
static java.lang.String DF_19
          Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 12:30 PM"
static java.lang.String DF_20
          Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005"
 
Constructor Summary
InboundRequest(java.io.File xml)
          Constructor used to instantiate using a File object without validation.
InboundRequest(java.io.File xml, java.lang.String xsdPath)
          Constructor used to instantiate using a File object with validation.
InboundRequest(java.lang.String xml)
          Constructor used to instantiate using an XML string without validation.
InboundRequest(java.lang.String xml, java.lang.String xsdPath)
          Constructor used to instantiate using an XML string with validation.
 
Method Summary
 java.lang.String getAccountID()
          Method to retrieve the AccountID from the XML POST.
 java.lang.String getANI()
          Method to retrieve the ANI from the XML POST.
 java.util.ArrayList<Barcode> getBarcodes()
          Method to retrieve an ArrayList of Barcode objects.
 java.util.ArrayList<Barcode> getBarcodesByPage(int page)
          Method to retrieve an ArrayList of Barcode objects for a selected page.
 int getBarcodesRead()
          Method to retrieve the total count of barcodes read.
 java.lang.String getCSID()
          Method to retrieve the CSID from the XML POST.
 java.util.Date getDateReceivedAsDate()
          Method to retrieve the DateReceived from the XML POST as a Date object.
 java.lang.String getDateReceivedAsString()
          Method to retrieve the DateReceived from the XML POST in the default format.
 java.lang.String getDateReceivedAsString(java.lang.String format)
          Method to retrieve the DateReceived from the XML POST in a desired format.
 java.lang.String getDocumentAsBase64()
          Method to retrieve the FileContents from the XML POST.
 byte[] getDocumentAsBytes()
          Method to retrieve the FileContents from the XML POST.
 void getDocumentAsFile(java.lang.String documentPath)
          Method to retrieve the FileContents from the XML POST.
 java.lang.String getFaxName()
          Method to retrieve the FaxName from the XML POST.
 java.lang.String getFileType()
          Method to retrieve the FileType from the XML POST.
 java.lang.String getMCFID()
          Method to retrieve the MCFID from the XML POST.
 java.lang.String getNumberDialed()
          Method to retrieve the NumberDialed from the XML POST.
 java.lang.String getPageAsBase64(int page)
          Method to retrieve the PageContents from the XML POST.
 byte[] getPageAsBytes(int page)
          Method to retrieve the PageContents from the XML POST.
 void getPageAsFile(java.lang.String pagePath, int page)
          Method to retrieve the PageContents from the XML POST.
 int getPageCount()
          Method to retrieve the PageCount from the XML POST.
 void getPagesAsFiles(java.lang.String pagePath)
          Method to retrieve the PageContents from the XML POST.
 java.lang.String getPassword()
          Method to retrieve the optional Password from the XML POST.
 java.util.Date getRequestDateAsDate()
          Method to retrieve the RequestDate from the XML POST as a Date object.
 java.lang.String getRequestDateAsString()
          Method to retrieve the RequestDate from the XML POST in the default format.
 java.lang.String getRequestDateAsString(java.lang.String format)
          Method to retrieve the RequestDate from the XML POST in a desired format.
 java.lang.String getRequestType()
          Method to retrieve the RequestType from the XML POST.
 java.lang.String getStatus()
          Method to retrieve the Status from the XML POST.
 java.util.Map<java.lang.String,java.lang.String> getUserFields()
          Method to retrieve a Map object of user defined field name/value pairs.
 int getUserFieldsRead()
          Method to retrieve the total count of user defined fields read.
 java.lang.String getUserName()
          Method to retrieve the optional UserName from the XML POST.
 boolean hasBarcodes()
          Method to determine whether or not the XML POST contains barcodes.
 boolean hasUserFields()
          Method to determine whether or not the XML POST contains user defined fields.
 boolean isPageSplitting()
          Method to determine whether or not the XML POST contains page splits.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DF_01

public static final java.lang.String DF_01
Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 13:30:00" (Default)

See Also:
Constant Field Values

DF_02

public static final java.lang.String DF_02
Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 13:30"

See Also:
Constant Field Values

DF_03

public static final java.lang.String DF_03
Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 12:30:00 PM"

See Also:
Constant Field Values

DF_04

public static final java.lang.String DF_04
Date format "01/01/2005 12:30:00 PM" returns "01/01/2005 12:30 PM"

See Also:
Constant Field Values

DF_05

public static final java.lang.String DF_05
Date format "01/01/2005 12:30:00 PM" returns "01/01/2005"

See Also:
Constant Field Values

DF_06

public static final java.lang.String DF_06
Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 13:30:00"

See Also:
Constant Field Values

DF_07

public static final java.lang.String DF_07
Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 13:30"

See Also:
Constant Field Values

DF_08

public static final java.lang.String DF_08
Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 12:30:00 PM"

See Also:
Constant Field Values

DF_09

public static final java.lang.String DF_09
Date format "01/01/2005 12:30:00 PM" returns "2005/01/01 12:30 PM"

See Also:
Constant Field Values

DF_10

public static final java.lang.String DF_10
Date format "01/01/2005 12:30:00 PM" returns "2005/01/01"

See Also:
Constant Field Values

DF_11

public static final java.lang.String DF_11
Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 13:30:00"

See Also:
Constant Field Values

DF_12

public static final java.lang.String DF_12
Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 13:30"

See Also:
Constant Field Values

DF_13

public static final java.lang.String DF_13
Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 12:30:00 PM"

See Also:
Constant Field Values

DF_14

public static final java.lang.String DF_14
Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005 12:30 PM"

See Also:
Constant Field Values

DF_15

public static final java.lang.String DF_15
Date format "01/01/2005 12:30:00 PM" returns "January 1, 2005"

See Also:
Constant Field Values

DF_16

public static final java.lang.String DF_16
Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 13:30:00"

See Also:
Constant Field Values

DF_17

public static final java.lang.String DF_17
Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 13:30"

See Also:
Constant Field Values

DF_18

public static final java.lang.String DF_18
Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 12:30:00 PM"

See Also:
Constant Field Values

DF_19

public static final java.lang.String DF_19
Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005 12:30 PM"

See Also:
Constant Field Values

DF_20

public static final java.lang.String DF_20
Date format "01/01/2005 12:30:00 PM" returns "Jan 1, 2005"

See Also:
Constant Field Values
Constructor Detail

InboundRequest

public InboundRequest(java.io.File xml)
               throws java.lang.Exception
Constructor used to instantiate using a File object without validation.

Parameters:
xml - local File object containing an XML string
Throws:
java.lang.Exception
See Also:
InboundRequest(String), InboundRequest(File, String), InboundRequest(String, String)

InboundRequest

public InboundRequest(java.io.File xml,
                      java.lang.String xsdPath)
               throws java.lang.Exception
Constructor used to instantiate using a File object with validation.

Parameters:
xml - local File object containing an XML string
xsdPath - the XSD schema full path and file name
Throws:
java.lang.Exception
See Also:
InboundRequest(File), InboundRequest(String), InboundRequest(String, String)

InboundRequest

public InboundRequest(java.lang.String xml)
               throws java.lang.Exception
Constructor used to instantiate using an XML string without validation.

Parameters:
xml - the XML string returned by eFax Developer™
Throws:
java.lang.Exception

InboundRequest

public InboundRequest(java.lang.String xml,
                      java.lang.String xsdPath)
               throws java.lang.Exception
Constructor used to instantiate using an XML string with validation.

Parameters:
xml - the XML string returned by eFax Developer™
xsdPath - the XSD schema full path and file name
Throws:
java.lang.Exception
See Also:
InboundRequest(File), InboundRequest(String), InboundRequest(File, String)
Method Detail

getAccountID

public java.lang.String getAccountID()
Method to retrieve the AccountID from the XML POST.

The account id contains the eFax Developer™ account client identifier.

Returns:
the eFax Developer™ account client identifier

getANI

public java.lang.String getANI()
Method to retrieve the ANI from the XML POST.

The automatic number identification (caller id) contains the calling party's fax number.

Returns:
the ANI value

getBarcodes

public java.util.ArrayList<Barcode> getBarcodes()
Method to retrieve an ArrayList of Barcode objects.

Returns:
an ArrayList of one-to-many Barcode objects
See Also:
hasBarcodes(), getBarcodesRead(), getBarcodesByPage(int)

getBarcodesByPage

public java.util.ArrayList<Barcode> getBarcodesByPage(int page)
Method to retrieve an ArrayList of Barcode objects for a selected page.

Parameters:
page - contains the desired page number for barcodes to be returned
Returns:
an ArrayList of one-to-many Barcode objects
See Also:
hasBarcodes(), getBarcodesRead(), getBarcodes()

getBarcodesRead

public int getBarcodesRead()
Method to retrieve the total count of barcodes read.

Returns:
the total count of barcodes read in the document
See Also:
getBarcodes(), getBarcodesByPage(int)

getCSID

public java.lang.String getCSID()
Method to retrieve the CSID from the XML POST.

The station identifier, when supplied by the receiving fax machine upon successful transmission.

Returns:
the CSID value

getDateReceivedAsDate

public java.util.Date getDateReceivedAsDate()
                                     throws java.text.ParseException
Method to retrieve the DateReceived from the XML POST as a Date object.

The date received contains the date/time at which the fax was initially received in your eFax Developer™ inbox.

Returns:
the date received as a Date object or null in case of error
Throws:
java.text.ParseException
See Also:
getDateReceivedAsString(), getDateReceivedAsString(String)

getDateReceivedAsString

public java.lang.String getDateReceivedAsString()
Method to retrieve the DateReceived from the XML POST in the default format.

The date received contains the date/time at which the fax was initially received in your eFax Developer™ inbox.

Returns:
the received date as a string in "MM/dd/yyyy hh:mm:ss" format
See Also:
getDateReceivedAsDate(), getDateReceivedAsString(String)

getDateReceivedAsString

public java.lang.String getDateReceivedAsString(java.lang.String format)
Method to retrieve the DateReceived from the XML POST in a desired format.

The date received contains the date/time at which the fax was initially received in your eFax Developer™ inbox.

The provided format must meet java.text.SimpleDateFormat specifications. Invalid, null, or empty formats will result in a default "MM/dd/yyyy hh:mm:ss" format being used.

Parameters:
format - contains the desired string format to be returned
Returns:
the received date as a string in a desired format
See Also:
getDateReceivedAsDate(), getDateReceivedAsString()

getDocumentAsBase64

public java.lang.String getDocumentAsBase64()
                                     throws java.lang.Exception
Method to retrieve the FileContents from the XML POST.

The FileContents contains a Base64 encoded representation of the physical document.

This method will return the Base64 string representation as-is.

Returns:
the Base64 encoded string
Throws:
java.lang.Exception
See Also:
getDocumentAsBytes(), getDocumentAsFile(String)

getDocumentAsBytes

public byte[] getDocumentAsBytes()
                          throws java.lang.Exception
Method to retrieve the FileContents from the XML POST.

The FileContents contains a Base64 encoded representation of the physical document.

This method will decode the contents and return a byte array to the calling application.

Returns:
the decoded file contents as a byte array
Throws:
java.lang.Exception
See Also:
getDocumentAsBase64(), getDocumentAsFile(String)

getDocumentAsFile

public void getDocumentAsFile(java.lang.String documentPath)
                       throws java.lang.Exception
Method to retrieve the FileContents from the XML POST.

The FileContents contains a Base64 encoded representation of the physical document.

This method will decode the file contents to a specified path. The file created will be given the same name passed in the FaxName container.

Parameters:
documentPath - contains the desired path to where the physical file should be written
Throws:
java.lang.Exception
See Also:
getDocumentAsBytes(), getDocumentAsBase64()

getFaxName

public java.lang.String getFaxName()
Method to retrieve the FaxName from the XML POST.

The fax name contains the fax name given by eFax Developer™ or as changed by the client via the online interface.

Returns:
the fax name

getFileType

public java.lang.String getFileType()
Method to retrieve the FileType from the XML POST.

The physical file type of the document as stored in eFax Developer™.

The value returned will either be "tif" or "pdf" depending on the account's file type setting when the inbound fax was received.

Returns:
the physical file type

getMCFID

public java.lang.String getMCFID()
Method to retrieve the MCFID from the XML POST.

The MCFID contains eFax Developer's inbound fax identifier.

Returns:
the MCFID value

getNumberDialed

public java.lang.String getNumberDialed()
Method to retrieve the NumberDialed from the XML POST.

The actual fax number that was dialed.

The number dialed contains the actual fax number on which the inbound fax was received.

Returns:
the fax number that was dialed

getPageAsBase64

public java.lang.String getPageAsBase64(int page)
                                 throws java.lang.Exception
Method to retrieve the PageContents from the XML POST.

This method is called by clients who have their page splitting option set in eFax Developer™. All other clients should use the getDocumentAsBase64() method instead.

The PageContents contains a Base64 encoded representation of a physical page within a document.

This method will return the Base64 string representation as-is or null if no pages are found.

Parameters:
page - contains the desired page number to be returned
Returns:
the Base64 encoded string or a null value
Throws:
java.lang.Exception
See Also:
isPageSplitting(), getPageAsBytes(int), getPageAsFile(String, int), getPagesAsFiles(String)

getPageAsBytes

public byte[] getPageAsBytes(int page)
                      throws java.lang.Exception
Method to retrieve the PageContents from the XML POST.

This method is called by clients who have their page splitting option set in eFax Developer™. All other clients should use the getDocumentAsBytes() method instead.

The PageContents contains a Base64 encoded representation of a physical page within a document.

This method will decode the contents and return a byte array to the calling application.

Parameters:
page - contains the desired page number to be returned
Returns:
the decoded page contents as a byte array
Throws:
java.lang.Exception
See Also:
isPageSplitting(), getPageAsBase64(int), getPageAsFile(String, int), getPagesAsFiles(String)

getPageAsFile

public void getPageAsFile(java.lang.String pagePath,
                          int page)
                   throws java.lang.Exception
Method to retrieve the PageContents from the XML POST.

This method is called by clients who have their page splitting option set in eFax Developer™. All other clients should use the getDocumentAsFile() method instead.

The PageContents contains a Base64 encoded representation of a physical page within a document.

This method will decode the contents of a designated page to a specified path. The file created will be given the same name passed in the FaxName container suffixed with the actual page number.

Parameters:
pagePath - contains the desired path to where the physical page files should be written
page - contains the desired page number
Throws:
java.lang.Exception
See Also:
isPageSplitting(), getPageAsBase64(int), getPageAsBytes(int), getPagesAsFiles(String)

getPageCount

public int getPageCount()
Method to retrieve the PageCount from the XML POST.

The number of physical pages contained within the fax document.

Returns:
the number of physical pages

getPagesAsFiles

public void getPagesAsFiles(java.lang.String pagePath)
                     throws java.lang.Exception
Method to retrieve the PageContents from the XML POST.

This method is called by clients who have their page splitting option set in eFax Developer™. All other clients should use the getDocumentAsFile() method instead.

The PageContents contains a Base64 encoded representation of a physical page within a document.

This method will decode the contents of each page to a specified path. The file(s) created will be given the same name passed in the FaxName container suffixed with the actual page number.

Parameters:
pagePath - contains the desired path to where the physical page files should be written
Throws:
java.lang.Exception
See Also:
isPageSplitting(), getPageAsBase64(int), getPageAsBytes(int), getPageAsFile(String, int)

getPassword

public java.lang.String getPassword()
Method to retrieve the optional Password from the XML POST.

The password is provided as an additional security measure in the event that client-side processing wishes to validate the XML by account credentials.

Returns:
the client's password (Optional)

getRequestDateAsDate

public java.util.Date getRequestDateAsDate()
                                    throws java.text.ParseException
Method to retrieve the RequestDate from the XML POST as a Date object.

The request date is the actual date/time at which the XML was generated.

The request date should not be confused with the received date which contains the date/time at which the fax was initially received in your eFax Developer™ inbox.

Returns:
the request date as a Date object or null in case of an error
Throws:
java.text.ParseException
See Also:
getRequestDateAsString(), getRequestDateAsString(String)

getRequestDateAsString

public java.lang.String getRequestDateAsString()
Method to retrieve the RequestDate from the XML POST in the default format.

The request date is the actual date/time at which the XML was generated.

The request date should not be confused with the received date which contains the date/time at which the fax was initially received in your eFax Developer™ inbox.

Returns:
the request date as a string in "MM/dd/yyyy hh:mm:ss" format
See Also:
getRequestDateAsDate(), getRequestDateAsString(String)

getRequestDateAsString

public java.lang.String getRequestDateAsString(java.lang.String format)
Method to retrieve the RequestDate from the XML POST in a desired format.

The request date is the actual date/time at which the XML was generated.

The request date should not be confused with the received date which contains the date/time at which the fax was initially received in your eFax Developer™ inbox.

The provided format must meet java.text.SimpleDateFormat specifications. Invalid, null, or empty formats will result in a default "MM/dd/yyyy hh:mm:ss" format being used.

Parameters:
format - contains the desired string format to be returned
Returns:
the request date as a string in a desired format
See Also:
getRequestDateAsDate(), getRequestDateAsString()

getRequestType

public java.lang.String getRequestType()
Method to retrieve the RequestType from the XML POST.

The request type indicates how the request was generated.

An initial inbound fax will generate XML with a request type of "New Inbound," while a manual re-post will generate XML with a request type of "Manual Repost."

Returns:
the generating request type

getStatus

public java.lang.String getStatus()
Method to retrieve the Status from the XML POST.

The status contains a numeric value indicating the fax status. A "0" value indicates a successful transmission while all other values indicate an error code which can be cross-referenced with a eFax Developer supplied table.

Returns:
the fax status

getUserFields

public java.util.Map<java.lang.String,java.lang.String> getUserFields()
Method to retrieve a Map object of user defined field name/value pairs.

Returns:
a Map object of one-to-many user defined field name/value pairs
See Also:
hasUserFields(), getUserFieldsRead()

getUserFieldsRead

public int getUserFieldsRead()
Method to retrieve the total count of user defined fields read.

Returns:
the total count of user defined field name/value pairs
See Also:
hasUserFields(), getUserFields()

getUserName

public java.lang.String getUserName()
Method to retrieve the optional UserName from the XML POST.

The user name is provided as an additional security measure in the event that client-side processing wishes to validate the XML by account credentials.

Returns:
the client's user name (Optional)

hasBarcodes

public boolean hasBarcodes()
Method to determine whether or not the XML POST contains barcodes.

This method will return true if the account is set to analyze the fax image for barcodes.

Returns:
true if barcode analysis is turned on, otherwise false
See Also:
getBarcodes(), getBarcodesByPage(int)

hasUserFields

public boolean hasUserFields()
Method to determine whether or not the XML POST contains user defined fields.

This method will return true if the account is set to return user defined fields.

Returns:
true if user defined fields are part of the request, otherwise false
See Also:
getUserFieldsRead(), getUserFields()

isPageSplitting

public boolean isPageSplitting()
Method to determine whether or not the XML POST contains page splits.

This method will return true if the client's account is set to return the fax image as individual pages.

Returns:
true if page splitting is turned on, otherwise false
See Also:
getPageAsBase64(int), getPageAsBytes(int), getPageAsFile(String, int), getPagesAsFiles(String)