com.interstarinc.xmedius.sendfax.model
Class DefaultFaxModel

java.lang.Object
  extended by com.interstarinc.xmedius.sendfax.model.DefaultFaxModel
All Implemented Interfaces:
IFaxModel

public class DefaultFaxModel
extends Object
implements IFaxModel

A default fax model implementation.

Author:
André Morin
See Also:
IFaxModel

Nested Class Summary
 class DefaultFaxModel.DefaultAddress
          A default address mplementation.
 class DefaultFaxModel.DefaultCompanyInfo
          A default company information implementation.
 class DefaultFaxModel.DefaultFaxOptions
          A default fax settings implementation.
private  class DefaultFaxModel.DefaultRecipientInfo
          A default fax recipient implementation.
 class DefaultFaxModel.DefaultSenderInfo
          A default sender information implementation.
 
Field Summary
private  List<File> attachmentList
          The attachments to be sent with the fax.
private  String comment
          The fax comment.
private  File coverSheet
          The fax cover sheet.
private  CoverSheetType coverSheetType
          The fax cover sheet type.
private  DefaultFaxModel.DefaultFaxOptions faxOptions
          The fax transmission settings.
private  BooleanValue inputFileDeleted
          A flag to instruct the Xml Gateway to keep or delete temporary files.
private  String password
          The password to authenticate the user submitting the fax.
private  List<IRecipientInfo> recipientList
          The fax target recipient.
private  DefaultFaxModel.DefaultSenderInfo senderInfo
          The fax sender informations.
private  String subject
          The fax subject.
private  String userId
          The user submitting the fax.
 
Constructor Summary
DefaultFaxModel()
           
 
Method Summary
 void addRecipientInfo(IRecipientInfo ri)
          Add a recipient to the fax.
 void addRecipientInfo(String name, String company, String faxNumber)
          Add a recipient to the fax.
 void clearFaxOptions()
          Clears the fax settings.
 void clearSenderInfo()
          Clear the sender information instance.
 List<File> getAttachmentList()
          May be required
 String getComment()
          May be required.
 File getCoverSheet()
          Required if cover sheet type is CoverSheetType.LOCAL or CoverSheetType.SERVER.
 CoverSheetType getCoverSheetType()
          Required.
 DefaultFaxModel.DefaultFaxOptions getFaxOptions()
          Retrieve the fax settings instance created with newFaxOptions() methods.
 BooleanValue getInputFileDeleted()
          Defaults to BooleanValue.YES
 String getPassword()
          Optional
 List<IRecipientInfo> getRecipientList()
          Retrieve the fax recipients.
 DefaultFaxModel.DefaultSenderInfo getSenderInfo()
          Retrieve the fax sender information instance created with newSenderInfo() methods.
 String getSubject()
          Optional
 String getUserId()
          Required
 void newFaxOptions()
          Create the fax settings instance.
 void newFaxOptions(IFaxOptions fo)
          Create the fax settings instance using the supplied the parameter.
 void newSenderInfo()
          Create the fax' sender information instance.
 void newSenderInfo(ISenderInfo si)
          Create the fax' sender information instance using the supplied the parameter.
 void removeRecipientInfo(IRecipientInfo ri)
          Remove a fax recipient.
 void removeRecipientInfo(String name, String faxNumber)
          Remove a fax recipient.
 void setComment(String comment)
           
 void setCoverSheet(File coverSheet)
           
 void setCoverSheetType(CoverSheetType coverSheetType)
           
 void setInputFileDeleted(BooleanValue inputFileDeleted)
           
 void setPassword(String password)
           
 void setSubject(String subject)
           
 void setUserId(String userId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attachmentList

private List<File> attachmentList
The attachments to be sent with the fax.


comment

private String comment
The fax comment.


coverSheet

private File coverSheet
The fax cover sheet.


coverSheetType

private CoverSheetType coverSheetType
The fax cover sheet type.


userId

private String userId
The user submitting the fax.


password

private String password
The password to authenticate the user submitting the fax.


recipientList

private List<IRecipientInfo> recipientList
The fax target recipient.


subject

private String subject
The fax subject.


inputFileDeleted

private BooleanValue inputFileDeleted
A flag to instruct the Xml Gateway to keep or delete temporary files.


senderInfo

private DefaultFaxModel.DefaultSenderInfo senderInfo
The fax sender informations.


faxOptions

private DefaultFaxModel.DefaultFaxOptions faxOptions
The fax transmission settings.

Constructor Detail

DefaultFaxModel

public DefaultFaxModel()
Method Detail

getAttachmentList

public List<File> getAttachmentList()
Description copied from interface: IFaxModel
May be required

Specified by:
getAttachmentList in interface IFaxModel
Returns:
The attachments to be transmitted with this fax.
See Also:
IFaxModel.getComment()

getComment

public String getComment()
Description copied from interface: IFaxModel
May be required. The comment, the attachment list and the cover sheet type are used to determine if the fax is empty.
This fax is considered empty iff : the comment and the attachment list are null or empty and the cover sheet type is CoverSheetType.NONE

Specified by:
getComment in interface IFaxModel
Returns:
The fax comment

getCoverSheet

public File getCoverSheet()
Description copied from interface: IFaxModel
Required if cover sheet type is CoverSheetType.LOCAL or CoverSheetType.SERVER. Must be null otherwise.

Specified by:
getCoverSheet in interface IFaxModel
Returns:
The cover sheet file.

getCoverSheetType

public CoverSheetType getCoverSheetType()
Description copied from interface: IFaxModel
Required.

Specified by:
getCoverSheetType in interface IFaxModel
Returns:
This fax cover sheet type.
See Also:
IFaxModel.getComment(), CoverSheetType

newFaxOptions

public void newFaxOptions()
Create the fax settings instance.
This method should be called when the client software doesn't implement interface IFaxOptions.

See Also:
newFaxOptions(IFaxOptions), DefaultFaxModel.DefaultFaxOptions

newFaxOptions

public void newFaxOptions(IFaxOptions fo)
Create the fax settings instance using the supplied the parameter.
This method should be called when the client software implements interface IFaxOptions.
The supplied parameter is used to create DefaultFaxOptions instance.

See Also:
newFaxOptions(), DefaultFaxModel.DefaultFaxOptions

clearFaxOptions

public void clearFaxOptions()
Clears the fax settings.


getFaxOptions

public DefaultFaxModel.DefaultFaxOptions getFaxOptions()
Retrieve the fax settings instance created with newFaxOptions() methods.

Specified by:
getFaxOptions in interface IFaxModel
Returns:
The fax transmission settings.
See Also:
newFaxOptions(), newFaxOptions(IFaxOptions)

getInputFileDeleted

public BooleanValue getInputFileDeleted()
Defaults to BooleanValue.YES

Specified by:
getInputFileDeleted in interface IFaxModel
Returns:
BooleanValue.YES if the XML Gateway deletes its temporary files (e.g attachment or local cover sheet).
BooleanValue.NO otherwise

getPassword

public String getPassword()
Description copied from interface: IFaxModel
Optional

Specified by:
getPassword in interface IFaxModel
Returns:
The fax sender password

getRecipientList

public List<IRecipientInfo> getRecipientList()
Retrieve the fax recipients.
This method must not be called to add or remove recipient.
The client software must used the methods to manage the recipient list.

Specified by:
getRecipientList in interface IFaxModel
Returns:
The fax recipients.
See Also:
addRecipientInfo(IRecipientInfo), addRecipientInfo(String, String, String), removeRecipientInfo(IRecipientInfo), removeRecipientInfo(String, String)

addRecipientInfo

public void addRecipientInfo(String name,
                             String company,
                             String faxNumber)
Add a recipient to the fax.
This method should be called when the client software doesn't implement interface IRecipientInfo.

Parameters:
name - the recipient's name.
company - the recipient's company
faxNumber - the recipient's fax number
See Also:
addRecipientInfo(IRecipientInfo), DefaultFaxModel.DefaultRecipientInfo

addRecipientInfo

public void addRecipientInfo(IRecipientInfo ri)
Add a recipient to the fax.
This method should be called when the client software implements interface IRecipientInfo.
The supplied parameter is used to create DefaultRecipientInfo instance.

Parameters:
ri - the recipient to be added to the fax.
See Also:
addRecipientInfo(String, String, String)

removeRecipientInfo

public void removeRecipientInfo(String name,
                                String faxNumber)
Remove a fax recipient.
This method should be called when the client software doesn't implement interface IRecipientInfo.

Parameters:
name - the recipient's name.
faxNumber - the recipient's fax number

removeRecipientInfo

public void removeRecipientInfo(IRecipientInfo ri)
Remove a fax recipient.
This method should be called when the client software implements interface IRecipientInfo.

Parameters:
ri - the fax recipient to be removed.
See Also:
removeRecipientInfo(String, String)

newSenderInfo

public void newSenderInfo()
Create the fax' sender information instance.
This method should be called when the client software doesn't implement interface ISenderInfo.

See Also:
newSenderInfo(ISenderInfo), DefaultFaxModel.DefaultSenderInfo

newSenderInfo

public void newSenderInfo(ISenderInfo si)
Create the fax' sender information instance using the supplied the parameter.
This method should be called when the client software implements interface ISenderInfo.
The supplied parameter is used to create DefaultSenderInfo instance.

See Also:
newSenderInfo(), DefaultFaxModel.DefaultSenderInfo

clearSenderInfo

public void clearSenderInfo()
Clear the sender information instance.


getSenderInfo

public DefaultFaxModel.DefaultSenderInfo getSenderInfo()
Retrieve the fax sender information instance created with newSenderInfo() methods.

Specified by:
getSenderInfo in interface IFaxModel
Returns:
The fax sender info.
See Also:
newSenderInfo(), newSenderInfo(ISenderInfo)

getSubject

public String getSubject()
Description copied from interface: IFaxModel
Optional

Specified by:
getSubject in interface IFaxModel
Returns:
The fax subject

getUserId

public String getUserId()
Description copied from interface: IFaxModel
Required

Specified by:
getUserId in interface IFaxModel
Returns:
The fax sender user id

setComment

public void setComment(String comment)

setCoverSheet

public void setCoverSheet(File coverSheet)

setCoverSheetType

public void setCoverSheetType(CoverSheetType coverSheetType)

setInputFileDeleted

public void setInputFileDeleted(BooleanValue inputFileDeleted)

setPassword

public void setPassword(String password)

setSubject

public void setSubject(String subject)

setUserId

public void setUserId(String userId)