com.pushtotest.tool.response
Class MailResponse

java.lang.Object
  extended by com.pushtotest.tool.response.ResponseWrapper
      extended by com.pushtotest.tool.response.MailResponse
All Implemented Interfaces:
Response

public class MailResponse
extends ResponseWrapper


Field Summary
 
Fields inherited from class com.pushtotest.tool.response.ResponseWrapper
content, datatime, parameters, parent, responsecode, responseMessage, setuptime, totaltime
 
Constructor Summary
MailResponse()
           
 
Method Summary
 void close(boolean expungeFlag)
          Close the connection to the mail host.
 java.lang.String getFolder()
          Get the Folder name.
 javax.mail.Message[] getMessages()
          getMessages returns an array of Message objects.
 java.lang.String getProtocol()
          Get the protocol to receive messages
 java.lang.String id()
          Returns an id for this protocol.
 void setFolder(java.lang.String thename)
          Sets the Folder name.
 void setHost(java.lang.String thehost)
          Set the host name, does not include any path information
 void setPassword(java.lang.String thepass)
          Set the host name, does not include any path information
 int setPermission()
          Get the Folder permission value.
 void setPermission(int perm)
          Sets the Folder permission.
 void setProtocol(java.lang.String theprot)
          Set the protocol to receive messages, pop3 by default
 void setUserName(java.lang.String theuser)
          Set the host name, does not include any path information
 java.lang.String toString()
          Returns a string representation of all of the content that was returned from the server that made up this Response.
 
Methods inherited from class com.pushtotest.tool.response.ResponseWrapper
appendParameter, appendParameters, getContent, getContentSize, getDataTime, getParameterKeys, getParameterValue, getParameterValues, getParentProtocol, getResponseCode, getResponseMessage, getSetupTime, getTotalTime, setContent, setDataTime, setParameter, setParameters, setParentProtocol, setResponseCode, setResponseMessage, setSetupTime, setTotalTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailResponse

public MailResponse()
Method Detail

setHost

public void setHost(java.lang.String thehost)
Set the host name, does not include any path information


setUserName

public void setUserName(java.lang.String theuser)
Set the host name, does not include any path information


setPassword

public void setPassword(java.lang.String thepass)
Set the host name, does not include any path information


id

public java.lang.String id()
Returns an id for this protocol. The id is a string that will be used to uniquily identify the protocol.

Specified by:
id in interface Response
Specified by:
id in class ResponseWrapper
Returns:
The id for this Protocol.

setPermission

public void setPermission(int perm)
Sets the Folder permission. This is usually Folder.READ_ONLY or Folder.


setPermission

public int setPermission()
Get the Folder permission value. This is usually Folder.READ_ONLY or Folder.


setProtocol

public void setProtocol(java.lang.String theprot)
Set the protocol to receive messages, pop3 by default


getProtocol

public java.lang.String getProtocol()
Get the protocol to receive messages


setFolder

public void setFolder(java.lang.String thename)
Sets the Folder name. By default this is "INBOX" for POP3 hosts, for IMAP hosts this may be any existing folder.


getFolder

public java.lang.String getFolder()
Get the Folder name. By default this is "INBOX" for POP3 hosts, for IMAP hosts this may be any existing folder.


getMessages

public javax.mail.Message[] getMessages()
                                 throws ToolException
getMessages returns an array of Message objects. Each object is a message on the host.

Throws:
ToolException

close

public void close(boolean expungeFlag)
           throws ToolException
Close the connection to the mail host.

Parameters:
Set - to true if you opened the connection using Folder.READ_WRITE and deleted messages. This will expunge the deleted messages.
Throws:
ToolException

toString

public java.lang.String toString()
Description copied from class: ResponseWrapper
Returns a string representation of all of the content that was returned from the server that made up this Response.

Specified by:
toString in interface Response
Overrides:
toString in class ResponseWrapper
Returns:
The content that was returned from the server.