|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.efaxdeveloper.util.outbound.OutboundRequest
public class OutboundRequest
OutboundRequest application interface
Overview
The OutboundRequest application interface is used to send outbound fax transmissions to
eFax Developer™
.The following snippet provides a basic example of how the OutboundRequest application interface might be used to send an outbound transmission request in fine mode with disposition notifications sent to two separate recipients via email regardless of success or failure:
// Instantiate a new OutboundRequest object OutboundRequest req = new OutboundRequest(); // 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 a unique transmission identifier (recommended) req.setTransmissionID("123456789"); // Set the resolution to fine mode req.setFineResolution(true); // Set to receive disposition emails upon success or failure req.setDispositionLevel(OutboundRequest.DL_BOTH); // Instantiate an EmailBundler object EmailBundler dispositionEmails = new EmailBundler(); // Add new recipient(s) to the EmailBundler object dispositionEmails.add("email1@a_domain.com"); dispositionEmails.add("email2@a_domain.com"); // Set your disposition emails to the OutboundRequest instance req.setDispositionsTo(dispositionEmails); // Set the recipient fax number for this transmission (required) req.setRecipientFax("1234567890"); try { // Instantiate a DocumentBundler object DocumentBundler docs = new DocumentBundler(); // Add document(s) to the DocumentBundler object by path (most common method) docs.add("C:\\your\\document\\path\\your.doc"); // Set the documents to be faxed to the OutboundRequest instance req.setDocuments(docs); // POST the outbound transmission request to eFax Developer OutboundResponse resp = req.sendFax(); Process the OutboundResponse... } catch (Exception e) { e.printStackTrace(); } catch (Error err) { err.printStackTrace(); }
OutboundResponse
,
EmailBundler
,
DocumentBundler
Field Summary | |
---|---|
static java.lang.String |
DL_BOTH
Used to indicate a Disposition Level of "BOTH" |
static java.lang.String |
DL_ERROR
Used to indicate a Disposition Level of "ERROR" |
static java.lang.String |
DL_NONE
Used to indicate a Disposition Level of "NONE" |
static java.lang.String |
DL_SUCCESS
Used to indicate a Disposition Level of "SUCCESS" |
static java.lang.String |
ISO_DUTCH
Used to indicate a Disposition ISO 639-1 language code of "nl" |
static java.lang.String |
ISO_ENGLISH
Used to indicate a Disposition ISO 639-1 language code of "en" |
static java.lang.String |
ISO_FRENCH
Used to indicate a Disposition ISO 639-1 language code of "fr" |
static java.lang.String |
ISO_GERMAN
Used to indicate a Disposition ISO 639-1 language code of "de" |
static java.lang.String |
ISO_ITALIAN
Used to indicate a Disposition ISO 639-1 language code of "it" |
static java.lang.String |
ISO_POLISH
Used to indicate a Disposition ISO 639-1 language code of "pl" |
static java.lang.String |
ISO_PORTUGUESE
Used to indicate a Disposition ISO 639-1 language code of "pt" |
static java.lang.String |
ISO_SPANISH
Used to indicate a Disposition ISO 639-1 language code of "es" |
Constructor Summary | |
---|---|
OutboundRequest()
Constructor method for the OutboundRequest |
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. |
boolean |
isHTMLResponse()
Method to determine if an HTML response was requested. |
OutboundResponse |
sendFax()
Method used to POST an outbound fax transmission to eFax Developer™. |
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 |
setCustomerID(java.lang.String customerID)
Method used to set the client generated customer identifier. |
void |
setDispositionLanguage(java.lang.String languageISOCode)
Method used to set the disposition language. |
void |
setDispositionLevel(java.lang.String dispositionLevel)
Method used to set the final disposition level. |
void |
setDispositionsTo(EmailBundler dispositionEmails)
Method used to distribute final disposition notifications via email. |
void |
setDispositionsTo(java.lang.String dispositionURL)
Method used to distribute final disposition notifications via HTTP POST. |
void |
setDocuments(DocumentBundler documents)
Method used to set the documents to be faxed. |
void |
setFaxHeader(java.lang.String faxHeader)
Method used to override the default fax header. |
void |
setFineResolution(boolean useFine)
Method used to control the transmission resolution. |
void |
setHighPriority(boolean useHigh)
Method used to control the transmission priority. |
void |
setHTMLResponse(boolean useHTML)
Method used to request an HTML-formatted response. |
void |
setNoDuplicates(boolean noDuplicates)
Method used to prevent duplicate transmission identifiers from being submitted. |
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 |
setRecipientCompany(java.lang.String recipientCompany)
Method used to set the recipient company. |
void |
setRecipientFax(java.lang.String recipientFax)
Method used to set the recipient fax number. |
void |
setRecipientName(java.lang.String recipientName)
Method used to set the recipient name. |
void |
setSelfBusy(boolean useSelfBusy)
Method used to control the "self-busy" option. |
void |
setTransmissionID(java.lang.String transmissionID)
Method used to set the client generated transmission identifier. |
void |
setTSID(java.lang.String tsid)
Method used to override the default TSID value. |
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 |
Field Detail |
---|
public static final java.lang.String DL_ERROR
public static final java.lang.String DL_SUCCESS
public static final java.lang.String DL_BOTH
public static final java.lang.String DL_NONE
public static final java.lang.String ISO_DUTCH
public static final java.lang.String ISO_ENGLISH
public static final java.lang.String ISO_FRENCH
public static final java.lang.String ISO_GERMAN
public static final java.lang.String ISO_ITALIAN
public static final java.lang.String ISO_POLISH
public static final java.lang.String ISO_PORTUGUESE
public static final java.lang.String ISO_SPANISH
Constructor Detail |
---|
public OutboundRequest()
Method Detail |
---|
public boolean isHTMLResponse()
Selecting an HTML response limits the client-side application to formatted HTML returned
via the getRawResponse()
method.
setHTMLResponse(boolean)
,
OutboundResponse.getRawResponse()
public OutboundResponse sendFax() throws java.lang.Exception
OutboundResponse
instance containing the response returned from eFax Developer™
java.lang.Exception
OutboundResponse
,
setReadTimeout(int)
,
setConnectionTimeout(int)
public void setCustomerID(java.lang.String customerID)
customerID
- the client's customer identifierpublic void setDispositionLanguage(java.lang.String languageISOCode)
"nl" - Dutch "en" - English (default) "fr" - French "de" - German "it" - Italian "pl" - Polish "pt" - Portuguese "es" - Spanish
languageISOCode
- the chosen ISO 639-1 language codepublic void setDispositionLevel(java.lang.String dispositionLevel)
"SUCCESS"
"ERROR"
"BOTH"
"NONE" (default)
dispositionLevel
- the desired disposition levelsetDispositionsTo(String)
,
setDispositionsTo(EmailBundler)
public void setDispositionsTo(EmailBundler dispositionEmails)
EmailBundler
instance indicating that final disposition notifications should be sent via email.
setDispositionLevel(String)
setting.
dispositionEmails
- an EmailBundler
object containing all email addresses to receive final disposition notificationssetDispositionLevel(String)
,
setDispositionsTo(String)
public void setDispositionsTo(java.lang.String dispositionURL)
setDispositionLevel(String)
setting.
DispositionCatcher
instance to process disposition notification received at the designated endpoint.
dispositionURL
- a client-defined URL that will accept the final disposition HTTP POSTsetDispositionLevel(String)
,
setDispositionsTo(EmailBundler)
public void setDocuments(DocumentBundler documents)
DocumentBundler
object contains all documents chosen for this transmission.
documents
- DocumentBundler
object that contains the chosen documents to be faxesDocumentBundler
public void setFaxHeader(java.lang.String faxHeader)
faxHeader
- the client specified "Dynamic Fax Header"public void setFineResolution(boolean useFine)
useFine
- a boolean value indicating that the desired resolution should be set to "fine"public void setHighPriority(boolean useHigh)
useHigh
- a boolean value indicating that the desired priority should be set to "high"public void setHTMLResponse(boolean useHTML)
useHTML
- a boolean value indicating that a standard HTML response is desiredOutboundResponse.isHTMLResponse()
,
isHTMLResponse()
public void setNoDuplicates(boolean noDuplicates)
noDuplicates
- a boolean value indicating the desired "no duplicates" option settingsetTransmissionID(String)
public void setRecipientCompany(java.lang.String recipientCompany)
recipientCompany
- the name of the company that will receive the faxpublic void setRecipientFax(java.lang.String recipientFax)
recipientFax
- the destination fax number to receive the faxpublic void setRecipientName(java.lang.String recipientName)
recipientName
- the name of the person who will receive the faxpublic void setSelfBusy(boolean useSelfBusy)
useSelfBusy
- a boolean value indicating the desired "self-busy" option settingpublic void setTransmissionID(java.lang.String transmissionID)
transmissionID
- the client generated transmission identifiersetNoDuplicates(boolean)
public void setTSID(java.lang.String tsid)
tsid
- the TSID or Transmitting Subscriber Identificationpublic int getConnectionTimeout()
setConnectionTimeout(int)
public int getReadTimeout()
setReadTimeout(int)
public void setAccountID(java.lang.String accountID)
accountID
- the client's account identifier used for authenticationpublic void setConnectionTimeout(int mills)
mills
- an int value that specifies the connect timeout in millisecondsgetConnectionTimeout()
,
sendFax()
,
getStatus()
public void setPassword(java.lang.String password)
The password value passed here must match the password specified in the Outbound Settings tab of the online user interface.
password
- the client's outbound password used for authenticationpublic void setReadTimeout(int mills)
mills
- an int value that specifies the read timeout in millisecondsgetReadTimeout()
,
sendFax()
,
getStatus()
public void setUserName(java.lang.String userName)
The user name value passed here must match the user name specified in the Outbound Settings tab of the online user interface.
userName
- the client's outbound user name used for authentication
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |