org.subethamail.smtp.server
Class SMTPCodecFactory

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

public class SMTPCodecFactory
extends java.lang.Object
implements org.apache.mina.filter.codec.ProtocolCodecFactory

A ProtocolCodecFactory that performs encoding and decoding between a text line data and a Java string object. This codec is useful especially when you work with a text-based protocols such as SMTP and IMAP.

Version:
$Rev: 471457 $, $Date: 2006-11-06 01:44:10 +0900 (???, 06 11??? 2006) $
Author:
The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
SMTPCodecFactory()
          Creates a new instance with the current default Charset.
SMTPCodecFactory(java.nio.charset.Charset charset, int thresholdBytes)
          Creates a new instance with the specified Charset.
 
Method Summary
 org.apache.mina.filter.codec.ProtocolDecoder getDecoder()
           
 int getDecoderMaxLineLength()
          Returns the allowed maximum size of the line to be decoded.
 org.apache.mina.filter.codec.ProtocolEncoder getEncoder()
           
 int getEncoderMaxLineLength()
          Returns the allowed maximum size of the encoded line.
 void setDecoderMaxLineLength(int maxLineLength)
          Sets the allowed maximum size of the line to be decoded.
 void setEncoderMaxLineLength(int maxLineLength)
          Sets the allowed maximum size of the encoded line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMTPCodecFactory

public SMTPCodecFactory()
Creates a new instance with the current default Charset.


SMTPCodecFactory

public SMTPCodecFactory(java.nio.charset.Charset charset,
                        int thresholdBytes)
Creates a new instance with the specified Charset.

Method Detail

getEncoder

public org.apache.mina.filter.codec.ProtocolEncoder getEncoder()
Specified by:
getEncoder in interface org.apache.mina.filter.codec.ProtocolCodecFactory

getDecoder

public org.apache.mina.filter.codec.ProtocolDecoder getDecoder()
Specified by:
getDecoder in interface org.apache.mina.filter.codec.ProtocolCodecFactory

getEncoderMaxLineLength

public int getEncoderMaxLineLength()
Returns the allowed maximum size of the encoded line. If the size of the encoded line exceeds this value, the encoder will throw a IllegalArgumentException. The default value is Integer.MAX_VALUE.

This method does the same job with TextLineEncoder.getMaxLineLength().


setEncoderMaxLineLength

public void setEncoderMaxLineLength(int maxLineLength)
Sets the allowed maximum size of the encoded line. If the size of the encoded line exceeds this value, the encoder will throw a IllegalArgumentException. The default value is Integer.MAX_VALUE.

This method does the same job with TextLineEncoder.setMaxLineLength(int).


getDecoderMaxLineLength

public int getDecoderMaxLineLength()
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).

This method does the same job with TextLineDecoder.getMaxLineLength().


setDecoderMaxLineLength

public void setDecoderMaxLineLength(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).

This method does the same job with TextLineDecoder.setMaxLineLength(int).



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