com.efaxdeveloper.util.outbound
Class DispositionCatcher

java.lang.Object
  extended by com.efaxdeveloper.util.outbound.DispositionCatcher

public class DispositionCatcher
extends java.lang.Object

DispositionCatcher application interface

Overview

Client's have the option of sending final disposition notifications to designated email recipients or as an HTTP POST request to a designated client-side endpoint as desired.

The DispositionCatcher is the interface between eFax Developer™ Outbound Disposition processing and a client-side disposition endpoint.

When submitting an outbound request with a disposition URL passed to the setDispositionTo(String) method, eFax Developer™ will attempt to POST a final disposition for the outbound transmission to the designated URL.

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

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

   out.println("<html>");
   out.println("<head><title>OutboundDispositionServlet</title></head>");
   out.println("<body>");

   try {

     // Instantiate a new DispositionCatcher instance
     DispositionCatcher dc = new DispositionCatcher(request.getParameter("xml"));

     // Retrieve the disposition response data from the DispositionCatcher
     System.out.println("");
     System.out.println("------------------------------------");
     System.out.println("UserName: "        + dc.getUserName());
     System.out.println("Password: "        + dc.getPassword());
     System.out.println("TransmissionID: "  + dc.getTransmissionID());
     System.out.println("DOCID: "           + dc.getDOCID());
     System.out.println("FaxNumber: "       + dc.getFaxNumber());
     System.out.println("CompletionDate: "  + dc.getCompletionDate());
     System.out.println("FaxStatus: "       + dc.getFaxStatus());
     System.out.println("RecipientCSID: "   + dc.getRecipientCSID());
     System.out.println("Duration: "        + dc.getDuration());
     System.out.println("PagesSent: "       + dc.getPagesSent());
     System.out.println("NumberOfRetries: " + dc.getNumberOfRetries());
     System.out.println("------------------------------------");

     // Reply back to eFax Developer indicating that the disposition response
     // has been successfully received.
     out.println("Post Successful");

   }
   catch (Exception e) {
     e.printStackTrace(out);
   }
   catch (Error err) {
     err.printStackTrace(out);
   }
   finally {
     // Close out the HTML response
     out.println("</body></html>");
     out.flush();
     out.close();
   }
   
 

Since:
1.0
Version:
2.0
See Also:
OutboundRequest, OutboundRequest.setDispositionTo(String)

Constructor Summary
DispositionCatcher(java.lang.String dispositionXML)
          Constructor method for the DispositionCatcher
 
Method Summary
 java.lang.String getCompletionDate()
          Method to retrieve a transmission's CompletionDate from the disposition response XML.
 java.lang.String getDOCID()
          Method to retrieve a transmission's DOCID from the disposition response XML.
 java.lang.String getDuration()
          Method to retrieve the transmission's Duration from the disposition response XML.
 java.lang.String getFaxNumber()
          Method to retrieve a transmission's FaxNumber from the disposition response XML.
 java.lang.String getFaxStatus()
          Method to retrieve a transmission's FaxStatus from the disposition response XML.
 java.lang.String getNumberOfRetries()
          Method to retrieve the transmission's NumberOfRetries from the disposition response XML.
 java.lang.String getPagesSent()
          Method to retrieve the transmission's PagesSent from the disposition response XML.
 java.lang.String getPassword()
          Method to retrieve the client's outbound Password from the disposition response XML.
 java.lang.String getRecipientCSID()
          Method to retrieve the transmission's RecipientCSID from the disposition response XML.
 java.lang.String getTransmissionID()
          Method to retrieve the TransmissionID from the disposition response XML.
 java.lang.String getUserName()
          Method to retrieve the client's outbound UserName from the disposition response XML.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispositionCatcher

public DispositionCatcher(java.lang.String dispositionXML)
                   throws java.lang.Exception
Constructor method for the DispositionCatcher

eFax Developer™ disposition processing will POST a parameter named "xml" to the client-specified endpoint. The client-side process will retrieve the "xml" parameter value from the request and pass it to this constructor. The DispositionCatcher will parse the XML-formatted value so that it can be easily retrieved by client-side logic via the DispositionCatcher's various accessor methods.

Parameters:
dispositionXML - the XML-formatted value received from eFax Developer™
Throws:
java.lang.Exception
Method Detail

getCompletionDate

public java.lang.String getCompletionDate()
Method to retrieve a transmission's CompletionDate from the disposition response XML.

Time zone is PST. Format is yyyy-mm-dd hh:mm:ss (24 hour).

Returns:
a String value containing the transmission's completion date and time

getDOCID

public java.lang.String getDOCID()
Method to retrieve a transmission's DOCID from the disposition response XML.

Returns:
a String value containing the eFax Developer transmission identifier

getDuration

public java.lang.String getDuration()
Method to retrieve the transmission's Duration from the disposition response XML.

Returns:
a String value containing the transmission's actual duration in minutes

getFaxNumber

public java.lang.String getFaxNumber()
Method to retrieve a transmission's FaxNumber from the disposition response XML.

Returns:
a String value containing the recipient fax number

getFaxStatus

public java.lang.String getFaxStatus()
Method to retrieve a transmission's FaxStatus from the disposition response XML.

Numeric field indicating the fax status. "0" indicates a successful transmission while all other values indicate an error code which can be cross-referenced with eFax Developer's Fax Status Cross-reference table supplied in this SDK.

Returns:
a String value containing the fax status indicator

getNumberOfRetries

public java.lang.String getNumberOfRetries()
Method to retrieve the transmission's NumberOfRetries from the disposition response XML.

Returns:
a String value containing the number of times the fax was attempted before success or failure

getPagesSent

public java.lang.String getPagesSent()
Method to retrieve the transmission's PagesSent from the disposition response XML.

Returns:
a String value containing the physical count of pages sent during the transmission

getPassword

public java.lang.String getPassword()
Method to retrieve the client's outbound Password from the disposition response XML.

The password returned by this method will be the password value as specified in the account's Outbound Settings tab in the online user interface.

Returns:
a String value containing the password from the Outbound Settings tab

getRecipientCSID

public java.lang.String getRecipientCSID()
Method to retrieve the transmission's RecipientCSID from the disposition response XML.

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

Returns:
a String value containing the recipient CSID number

getTransmissionID

public java.lang.String getTransmissionID()
Method to retrieve the TransmissionID from the disposition response XML.

Returns:
a String value containing the transmission identifier

getUserName

public java.lang.String getUserName()
Method to retrieve the client's outbound UserName from the disposition response XML.

The user name returned by this method will be the user name value as specified in the account's Outbound Settings tab in the online user interface.

Returns:
a String value containing the user name from the Outbound Settings tab