JML

net.sf.jml.message
Class MsnMimeMessage

java.lang.Object
  extended by net.sf.jml.message.MsnMimeMessage
Direct Known Subclasses:
MsnEmailActivityMessage, MsnEmailInitEmailData, MsnEmailInitMessage, MsnEmailNotifyMessage, MsnEmoticonMessage, MsnInstantMessage, MsnP2PMessage, MsnPropMessage, MsnSystemMessage, MsnUnknownMessage

public abstract class MsnMimeMessage
extends Object

MIME Message. based on protocol message: OutgoingMSG and IncomingMSG.

Author:
Roger Chen

Field Summary
protected  StringHolder headers
           
 
Constructor Summary
MsnMimeMessage()
           
 
Method Summary
protected  String getCharset()
           
 String getContentType()
           
 StringHolder getHeaders()
           
 String getMimeVersion()
           
protected  void messageReceived(MsnSession session, MsnContact contact)
          The message have received, invoked by dispatch thread
protected  void parseBuffer(ByteBuffer buffer)
           
protected  void parseMessage(byte[] content)
          Parse content from IncomingMSG's chunk data.
protected  void setContentType(String contentType)
           
protected  void setMimeVersion(String mimeVersion)
           
 OutgoingMSG[] toOutgoingMsg(MsnProtocol protocol)
          Generate OutgoingMSGs.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

headers

protected final StringHolder headers
Constructor Detail

MsnMimeMessage

public MsnMimeMessage()
Method Detail

getHeaders

public final StringHolder getHeaders()

getContentType

public final String getContentType()

setContentType

protected void setContentType(String contentType)

getMimeVersion

public final String getMimeVersion()

setMimeVersion

protected void setMimeVersion(String mimeVersion)

getCharset

protected final String getCharset()

toString

public String toString()
Overrides:
toString in class Object

toOutgoingMsg

public OutgoingMSG[] toOutgoingMsg(MsnProtocol protocol)
Generate OutgoingMSGs.

Parameters:
protocol - used MsnProtocol
Returns:
generated OutgoingMSGs. A MsnMimeMessage may generate multi OutgoingMSGs.

parseMessage

protected void parseMessage(byte[] content)
Parse content from IncomingMSG's chunk data.

Parameters:
content - IncomingMSG's chunk data

parseBuffer

protected void parseBuffer(ByteBuffer buffer)

messageReceived

protected void messageReceived(MsnSession session,
                               MsnContact contact)
The message have received, invoked by dispatch thread

Parameters:
session - the MsnSession which received the message
contact - the user who sent this message

JML