org.abstracthorizon.mercury.imap.cmd
Class IMAPCommand

java.lang.Object
  extended by org.abstracthorizon.mercury.imap.cmd.IMAPCommand
All Implemented Interfaces:
org.abstracthorizon.danube.connection.ConnectionHandler
Direct Known Subclasses:
Append, Authenticate, Bad, Capability, Close, Create, Delete, Expunge, List, Login, Logout, LSub, NOOP, Partial, Rename, Select, StartTLS, Status, Subscribe, UID, UIDCommand, Unsubscribe

public class IMAPCommand
extends Object
implements org.abstracthorizon.danube.connection.ConnectionHandler

A class that represents IMAP command

Author:
Daniel Sendula

Field Summary
static short ALWAYS_SEND_UNILATERAL_DATA
           
static short ALWAYS_SUPRESS_UNILATERAL_DATA
           
protected  String mnemonic
          Mnemonic
static short SEND_WHEN_HAVE_NEW
           
protected  short unilateral
           
 
Constructor Summary
IMAPCommand(String mnemonic)
          Constructor
 
Method Summary
protected  void checkEOL(IMAPSession session)
          Checks if command is read fully
protected  void execute(IMAPSession session)
          Executes the command.
 String getMnemonic()
          Returns mnemonic
 void handleConnection(org.abstracthorizon.danube.connection.Connection connection)
          Handles connection
protected  void sendOK(IMAPSession session)
          Sets OKResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEND_WHEN_HAVE_NEW

public static final short SEND_WHEN_HAVE_NEW
See Also:
Constant Field Values

ALWAYS_SEND_UNILATERAL_DATA

public static final short ALWAYS_SEND_UNILATERAL_DATA
See Also:
Constant Field Values

ALWAYS_SUPRESS_UNILATERAL_DATA

public static final short ALWAYS_SUPRESS_UNILATERAL_DATA
See Also:
Constant Field Values

unilateral

protected short unilateral

mnemonic

protected String mnemonic
Mnemonic

Constructor Detail

IMAPCommand

public IMAPCommand(String mnemonic)
Constructor

Parameters:
mnemonic - mnemonic
Method Detail

getMnemonic

public String getMnemonic()
Returns mnemonic

Returns:
mnemonic

handleConnection

public void handleConnection(org.abstracthorizon.danube.connection.Connection connection)
Handles connection

Specified by:
handleConnection in interface org.abstracthorizon.danube.connection.ConnectionHandler
Parameters:
connection - connection

execute

protected void execute(IMAPSession session)
                throws ParserException,
                       javax.mail.MessagingException,
                       CommandException,
                       IOException
Executes the command. This implemnetation returns NOResponse.

Parameters:
session - session
Throws:
ParserException
javax.mail.MessagingException
CommandException
IOException

sendOK

protected void sendOK(IMAPSession session)
               throws IOException
Sets OKResponse

Parameters:
session - session
Throws:
IOException

checkEOL

protected void checkEOL(IMAPSession session)
                 throws IOException,
                        ParserException
Checks if command is read fully

Parameters:
session - session
Throws:
IOException
ParserException


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.