com.efaxdeveloper.util.outbound
Class StatusRequest

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

public class StatusRequest
extends java.lang.Object

StatusRequest application interface

Overview

The StatusRequest application interface is used to send outbound status requests to eFax Developer™.

The following snippet provides a basic example of how the StatusRequest application interface might be used to send an outbound status request to eFax Developer™:

   // Instantiate a new StatusRequest object
   StatusRequest req = new StatusRequest();

   // Set your eFax Developer outbound account identifier (required)
   req.setAccountID("1234567890");
   // Set your eFax Developer outbound user name (required)
   req.setUserName("joe");
   // Set your eFax Developer outbound password (required)
   req.setPassword("dog");

   // Set the transmission identifier
   req.setTransmissionID("1234567890");

   try {

     // Retrieve the transmission status from eFax Developer
     StatusResponse resp = req.getStatus();

     Process the StatusResponse...

   }
   catch (Exception e) {
     e.printStackTrace();
   }
   catch (Error err) {
     err.printStackTrace();
   }
   
 

Since:
2.0
Version:
2.0
See Also:
StatusResponse

Constructor Summary
StatusRequest()
          Constructor method for the StatusRequest
 
Method Summary
 int getConnectionTimeout()
          Method used to retrieve the current connection timeout for the request.
 int getReadTimeout()
          Method used to retrieve the current read timeout for the response.
 StatusResponse getStatus()
          Method used to request a transmission status from eFax Developer™.
 boolean isHTMLResponse()
          Method to determine if an HTML response was requested.
 void setAccountID(java.lang.String accountID)
          Method used to set the client's account identifier.
 void setConnectionTimeout(int mills)
          Method used to control the connection timeout for the request.
 void setDOCID(java.lang.String docID)
          Method used to set eFax Developer's transmission identifier.
 void setHTMLResponse(boolean useHTML)
          Method used to request an HTML-formatted response.
 void setPassword(java.lang.String password)
          Method used to set the client's password.
 void setReadTimeout(int mills)
          Method used to control the read timeout for the response.
 void setTransmissionID(java.lang.String transmissionID)
          Method used to set the client generated transmission identifier.
 void setUserName(java.lang.String userName)
          Method used to set the client's user name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusRequest

public StatusRequest()
Constructor method for the StatusRequest

Method Detail

getStatus

public StatusResponse getStatus()
                         throws java.lang.Exception
Method used to request a transmission status from eFax Developer™.

Returns:
an StatusResponse instance containing the response returned from eFax Developer™
Throws:
java.lang.Exception
See Also:
StatusResponse, setReadTimeout(int), setConnectionTimeout(int)

isHTMLResponse

public boolean isHTMLResponse()
Method to determine if an HTML response was requested.

Selecting an HTML response limits the client-side application to formatted HTML returned via the getRawResponse() method.

Returns:
a boolean value indicating an HTML-formatted response
See Also:
setHTMLResponse(boolean), StatusResponse.getRawResponse()

setDOCID

public void setDOCID(java.lang.String docID)
Method used to set eFax Developer's transmission identifier.

The docID is a unique transmission identifier returned by eFax Developer™ Outbound Services to identify an approved fax request.

Parameters:
docID - the eFax Developer™ transmission identifier

setHTMLResponse

public void setHTMLResponse(boolean useHTML)
Method used to request an HTML-formatted response.

Passing true to this method will cause eFax Developer™ to respond with standard HMTL instead of formatted XML.

Selecting an HTML response limits the client-side application to formatted HTML only. Clients who wish to store metadata returned by eFax Developer™ should not request an HTML response.

Parameters:
useHTML - a boolean value indicating that a standard HTML response is desired
See Also:
StatusResponse.isHTMLResponse(), isHTMLResponse()

setTransmissionID

public void setTransmissionID(java.lang.String transmissionID)
Method used to set the client generated transmission identifier.

The transmissionID is a unique client specified number used to identify a transmission. This optional value may or may not be used by your client-side implementation.

Parameters:
transmissionID - the client generated transmission identifier

getConnectionTimeout

public int getConnectionTimeout()
Method used to retrieve the current connection timeout for the request.

Returns:
the current connection timeout value. 0 return implies that the option is disabled (i.e., timeout of infinity).
See Also:
setConnectionTimeout(int)

getReadTimeout

public int getReadTimeout()
Method used to retrieve the current read timeout for the response.

Returns:
the current read timeout value. 0 return implies that the option is disabled (i.e., timeout of infinity).
See Also:
setReadTimeout(int)

setAccountID

public void setAccountID(java.lang.String accountID)
Method used to set the client's account identifier.

The accountID value is required by eFax Developer™ for user authentication. The account identifier is provided by eFax Developer at setup time.

Parameters:
accountID - the client's account identifier used for authentication

setConnectionTimeout

public void setConnectionTimeout(int mills)
Method used to control the connection timeout for the request.

Sets the connection timeout to a specified value, in milliseconds, to be used when opening the connection to eFax Developer™. If the timeout expires before the connection can be established, a java.net.SocketTimeoutException will be thrown.

A timeout of zero is interpreted as an infinite timeout.

Parameters:
mills - an int value that specifies the connect timeout in milliseconds
See Also:
getConnectionTimeout(), sendFax(), getStatus()

setPassword

public void setPassword(java.lang.String password)
Method used to set the client's password.

The password is required by eFax Developer™ for user authentication.

The password value passed here must match the password specified in the Outbound Settings tab of the online user interface.

Parameters:
password - the client's outbound password used for authentication

setReadTimeout

public void setReadTimeout(int mills)
Method used to control the read timeout for the response.

Sets the read timeout to a specified value, in milliseconds, to be used when reading the response returned by eFax Developer™. If the timeout expires before there is data available for read, a java.net.SocketTimeoutException will be thrown.

A timeout of zero is interpreted as an infinite timeout.

Parameters:
mills - an int value that specifies the read timeout in milliseconds
See Also:
getReadTimeout(), sendFax(), getStatus()

setUserName

public void setUserName(java.lang.String userName)
Method used to set the client's user name.

The userName value is required by eFax Developer™ for user authentication.

The user name value passed here must match the user name specified in the Outbound Settings tab of the online user interface.

Parameters:
userName - the client's outbound user name used for authentication