com.interstarinc.xmedius.sendfax
Class Fax

java.lang.Object
  extended by com.interstarinc.xmedius.sendfax.Fax

public class Fax
extends Object

This class is used by a client of the SendFax library to convert a fax model to an XML document.

Version:
$Revision: 1.42.14.1 $
Author:
André Morin
See Also:
XMLBuilder, How a client interacts with the SendFax library

Constructor Summary
Fax()
           
 
Method Summary
 SendResult send(IFaxModel fax, File xmlFax)
          Sends a fax using the supplied parameters.
 SendResult send(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel fax, InputStream xmlFax)
           
 void toXML(IFaxModel model, OutputStream target)
          This method converts a fax model to an XML document (DOM tree).
 void toXML(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel model, OutputStream target)
           
private  void validate(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel model)
          This method validates a fax model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fax

public Fax()
Method Detail

toXML

public void toXML(IFaxModel model,
                  OutputStream target)
           throws FaxException
This method converts a fax model to an XML document (DOM tree).
Before converting the fax model, this method calls the validate method. If the fax model is valid, this method proceeds to convert it, otherwise it throws a FaxException.

Parameters:
model - The fax model (java beans graph) to be converted.
target - The output strean used to save the converted the fax model.
Throws:
FaxException - If the fax model is not valid or if the XMLBuilder is unable to convert the fax model.
See Also:
IFaxModel, validate(IFaxModel), XMLBuilder

toXML

public void toXML(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel model,
                  OutputStream target)
           throws FaxException
Parameters:
model -
target -
Throws:
FaxException
See Also:
toXML(IFaxModel, OutputStream)

validate

private void validate(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel model)
               throws FaxException
This method validates a fax model.

Parameters:
model - The fax model to be validated.
Throws:
FaxException - If the fax model is not valid.
See Also:
IFaxModel

send

public SendResult send(IFaxModel fax,
                       File xmlFax)
                throws FaxException
Sends a fax using the supplied parameters.
The method toXML must be called first to create parameter xmlFax.
It delegates to SendFax.send().

Parameters:
fax - the fax to be sent.
xmlFax - this fax's xml representation used by the Xml Gateway.
Returns:
a SendResult instance carrying the fax transmission outcome.
Throws:
FaxException - if any error occurs
See Also:
toXML(IFaxModel, OutputStream), SendFax.send(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel, InputStream, String[])

send

public SendResult send(com.interstarinc.xmedius.sendfax.model.v1.IFaxModel fax,
                       InputStream xmlFax)
                throws FaxException
Parameters:
fax -
xmlFax -
Returns:
The result that indicate the status of sending.
Throws:
FaxException
See Also:
send(IFaxModel, File)