com.cometway.email
Interface IMessage

All Known Implementing Classes:
Message

public interface IMessage

IMessage represents an abstract message containing a message body and an arbitrary number of headers.


Method Summary
 java.lang.String getHeaderInfo(java.lang.String key)
          getHeaderInfo returns the value of the header associated with key, if any
 java.util.Enumeration getHeaders()
          getHeaders yields an Enumeration of header keys associated with an IMessage
 java.lang.String getMessage()
          getMessage returns the message body of an IMessage
 void removeAllHeaders()
          removeAllHeaders removes all headers from an IMessage
 void setHeaderInfo(java.lang.String key, java.lang.String info)
          setHeaderInfo sets the value of a specified header for an IMessage, adding the header if necessary
 void setMessage(java.lang.String s)
          setMessage sets the value of the message body for an IMessage
 java.lang.String toString()
          toString yields the String representation of an IMessage.
 

Method Detail

getHeaderInfo

java.lang.String getHeaderInfo(java.lang.String key)
getHeaderInfo returns the value of the header associated with key, if any

Parameters:
key - the header name to be extracted

getHeaders

java.util.Enumeration getHeaders()
getHeaders yields an Enumeration of header keys associated with an IMessage


getMessage

java.lang.String getMessage()
getMessage returns the message body of an IMessage


removeAllHeaders

void removeAllHeaders()
removeAllHeaders removes all headers from an IMessage


setHeaderInfo

void setHeaderInfo(java.lang.String key,
                   java.lang.String info)
setHeaderInfo sets the value of a specified header for an IMessage, adding the header if necessary

Parameters:
key - the header name to be set
info - the header value

setMessage

void setMessage(java.lang.String s)
setMessage sets the value of the message body for an IMessage

Parameters:
s - the new message body

toString

java.lang.String toString()
toString yields the String representation of an IMessage. Classes implementing IMessage are required to supply a toString() method

Overrides:
toString in class java.lang.Object