com.hs.mail.imap.server.codec
Class DefaultImapMessage

java.lang.Object
  extended by com.hs.mail.imap.server.codec.DefaultImapMessage
All Implemented Interfaces:
ImapMessage

public class DefaultImapMessage
extends Object
implements ImapMessage

Since:
Jan 22, 2010
Author:
Won Chul Doh

Field Summary
protected  LinkedList<Token> tokens
           
 
Constructor Summary
DefaultImapMessage(String request)
           
 
Method Summary
 String getCommand()
           
 org.jboss.netty.buffer.ChannelBuffer getLiteral()
          Returns the content of this message.
 long getLiteralLength()
          Returns the length of the content.
 LinkedList<Token> getTokens()
           
 boolean isNeedContinuationRequest()
          Returns true if and only if we need to send command continuation request before reading literal data.
 void setLiteral(org.jboss.netty.buffer.ChannelBuffer literal)
          Sets the content of this message.
 void setLiteralLength(long literalLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokens

protected LinkedList<Token> tokens
Constructor Detail

DefaultImapMessage

public DefaultImapMessage(String request)
Method Detail

getCommand

public String getCommand()
Specified by:
getCommand in interface ImapMessage

getTokens

public LinkedList<Token> getTokens()
Specified by:
getTokens in interface ImapMessage

getLiteral

public org.jboss.netty.buffer.ChannelBuffer getLiteral()
Description copied from interface: ImapMessage
Returns the content of this message. If there is no content, an ChannelBuffers.EMPTY_BUFFER is returned.

Specified by:
getLiteral in interface ImapMessage

setLiteral

public void setLiteral(org.jboss.netty.buffer.ChannelBuffer literal)
Description copied from interface: ImapMessage
Sets the content of this message. If null is specified, the content of this message will be set to ChannelBuffers.EMPTY_BUFFER.

Specified by:
setLiteral in interface ImapMessage

getLiteralLength

public long getLiteralLength()
Description copied from interface: ImapMessage
Returns the length of the content. Please note that this value is not retrieved from #getContent() but from the "Content-Length" header, and thus they are independent from each other.

Specified by:
getLiteralLength in interface ImapMessage
Returns:
the content length or 0 if this message does not have the "Content-Length" header

setLiteralLength

public void setLiteralLength(long literalLength)
Specified by:
setLiteralLength in interface ImapMessage

isNeedContinuationRequest

public boolean isNeedContinuationRequest()
Description copied from interface: ImapMessage
Returns true if and only if we need to send command continuation request before reading literal data.

Specified by:
isNeedContinuationRequest in interface ImapMessage


Copyright © 2011. All Rights Reserved.