org.abstracthorizon.mercury.imap.cmd
Class Fetch

java.lang.Object
  extended by org.abstracthorizon.mercury.imap.cmd.IMAPCommand
      extended by org.abstracthorizon.mercury.imap.cmd.UIDCommand
          extended by org.abstracthorizon.mercury.imap.cmd.Fetch
All Implemented Interfaces:
org.abstracthorizon.danube.connection.ConnectionHandler, MessageProcessor

public class Fetch
extends UIDCommand

Fetch IMAP command

Author:
Daniel Sendula

Field Summary
protected  List<Object> attrs
          Attributes
protected static SimpleDateFormat internalDate
          Internal date
protected static org.slf4j.Logger logger
          Logger
protected  boolean tagSent
          Tag
 
Fields inherited from class org.abstracthorizon.mercury.imap.cmd.UIDCommand
asuid
 
Fields inherited from class org.abstracthorizon.mercury.imap.cmd.IMAPCommand
ALWAYS_SEND_UNILATERAL_DATA, ALWAYS_SUPRESS_UNILATERAL_DATA, mnemonic, SEND_WHEN_HAVE_NEW, unilateral
 
Constructor Summary
Fetch(String mnemonic)
          Constructor
 
Method Summary
protected  void execute(IMAPSession session)
          Executes the command
static boolean fetch_att(IMAPScanner scanner, List<Object> atts)
          Parses fetch attributes
 void fetch(IMAPSession session)
          Executes the command
 void process(IMAPSession session, javax.mail.internet.MimeMessage m)
          Processes message
 void setAsUID()
          Defines as UID function
protected  boolean spaceSeparator(boolean flag, FetchResponse response)
          Adds space if not first
 
Methods inherited from class org.abstracthorizon.mercury.imap.cmd.IMAPCommand
checkEOL, getMnemonic, handleConnection, sendOK
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger
Logger


internalDate

protected static SimpleDateFormat internalDate
Internal date


tagSent

protected boolean tagSent
Tag


attrs

protected List<Object> attrs
Attributes

Constructor Detail

Fetch

public Fetch(String mnemonic)
Constructor

Parameters:
mnemonic - mnemonic
Method Detail

setAsUID

public void setAsUID()
Defines as UID function

Overrides:
setAsUID in class UIDCommand

execute

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

Overrides:
execute in class IMAPCommand
Parameters:
session -
Throws:
ParserException
javax.mail.MessagingException
CommandException
IOException

fetch

public void fetch(IMAPSession session)
           throws IOException,
                  ParserException,
                  javax.mail.MessagingException
Executes the command

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

fetch_att

public static boolean fetch_att(IMAPScanner scanner,
                                List<Object> atts)
                         throws IOException,
                                ParserException
Parses fetch attributes

Parameters:
scanner - scanner
atts - attributes
Returns:
true if parsing was correct
Throws:
IOException
ParserException

process

public void process(IMAPSession session,
                    javax.mail.internet.MimeMessage m)
             throws IOException,
                    javax.mail.MessagingException
Processes message

Specified by:
process in interface MessageProcessor
Specified by:
process in class UIDCommand
Parameters:
session - session
m - mime message
Throws:
javax.mail.MessagingException
IOException

spaceSeparator

protected boolean spaceSeparator(boolean flag,
                                 FetchResponse response)
Adds space if not first

Parameters:
flag - flag
response - fetch response
Returns:
negated flag


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