org.subethamail.smtp.server
Class SMTPCodecDecoder

java.lang.Object
  extended by org.subethamail.smtp.server.SMTPCodecDecoder
All Implemented Interfaces:
org.apache.mina.filter.codec.ProtocolDecoder

public class SMTPCodecDecoder
extends java.lang.Object
implements org.apache.mina.filter.codec.ProtocolDecoder

A ProtocolDecoder which decodes incoming SMTP data based on session context.

Author:
De Oliveira Edouard <doe_wanted@yahoo.fr>

Constructor Summary
SMTPCodecDecoder(java.nio.charset.Charset charset, int thresholdBytes)
          Creates a new instance with the specified charset and the specified thresholdBytes deferring size.
 
Method Summary
static byte[] asArray(org.apache.mina.common.ByteBuffer b)
           
 void decode(org.apache.mina.common.IoSession session, org.apache.mina.common.ByteBuffer in, org.apache.mina.filter.codec.ProtocolDecoderOutput out)
           
 void dispose(org.apache.mina.common.IoSession session)
           
 void finishDecode(org.apache.mina.common.IoSession session, org.apache.mina.filter.codec.ProtocolDecoderOutput out)
           
 int getMaxLineLength()
          Returns the allowed maximum size of the line to be decoded.
 void setDataDeferredSize(int dataDeferredSize)
           
 void setMaxLineLength(int maxLineLength)
          Sets the allowed maximum size of the line to be decoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMTPCodecDecoder

public SMTPCodecDecoder(java.nio.charset.Charset charset,
                        int thresholdBytes)
Creates a new instance with the specified charset and the specified thresholdBytes deferring size.

Method Detail

setDataDeferredSize

public void setDataDeferredSize(int dataDeferredSize)

asArray

public static byte[] asArray(org.apache.mina.common.ByteBuffer b)

getMaxLineLength

public int getMaxLineLength()
Returns the allowed maximum size of the line to be decoded. If the size of the line to be decoded exceeds this value, the decoder will throw a BufferDataException. The default value is 1024 (1KB).


setMaxLineLength

public void setMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the line to be decoded. If the size of the line to be decoded exceeds this value, the decoder will throw a BufferDataException. The default value is 1024 (1KB).


finishDecode

public void finishDecode(org.apache.mina.common.IoSession session,
                         org.apache.mina.filter.codec.ProtocolDecoderOutput out)
                  throws java.lang.Exception
Specified by:
finishDecode in interface org.apache.mina.filter.codec.ProtocolDecoder
Throws:
java.lang.Exception

dispose

public void dispose(org.apache.mina.common.IoSession session)
             throws java.lang.Exception
Specified by:
dispose in interface org.apache.mina.filter.codec.ProtocolDecoder
Throws:
java.lang.Exception

decode

public void decode(org.apache.mina.common.IoSession session,
                   org.apache.mina.common.ByteBuffer in,
                   org.apache.mina.filter.codec.ProtocolDecoderOutput out)
            throws java.lang.Exception
Specified by:
decode in interface org.apache.mina.filter.codec.ProtocolDecoder
Throws:
java.lang.Exception


Copyright © 2011 SubEthaSMTP. All Rights Reserved. Build version: UNVERSIONED