com.scalagent.joram.mom.dest.mail
Class MailAcquisition

java.lang.Object
  extended by com.scalagent.joram.mom.dest.mail.MailAcquisition
All Implemented Interfaces:
AcquisitionHandler

public class MailAcquisition
extends java.lang.Object
implements AcquisitionHandler


Field Summary
private  boolean expunge
           
private  javax.mail.Folder folder
           
private static org.objectweb.util.monolog.api.Logger logger
           
private  java.lang.String popPassword
           
private  java.lang.String popServer
           
private  java.lang.String popUser
           
private  javax.mail.Store store
           
 
Constructor Summary
MailAcquisition()
           
 
Method Summary
 void close()
          Closes this handler and releases any system resources associated to it.
 void closeFolder(java.util.List msgs, boolean expunge)
           
private  java.lang.String getBody(javax.mail.Message message)
           
 javax.mail.Message[] popMail(java.lang.String popServer, java.lang.String popUser, java.lang.String popPassword, boolean expunge)
           
 void retrieve(ReliableTransmitter transmitter)
          Retrieves one or more message from an external source (e-mail, ftp, ...).
 void setProperties(java.util.Properties properties)
          Configures the handler with the given properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.objectweb.util.monolog.api.Logger logger

popServer

private java.lang.String popServer

popUser

private java.lang.String popUser

popPassword

private java.lang.String popPassword

expunge

private boolean expunge

store

private javax.mail.Store store

folder

private javax.mail.Folder folder
Constructor Detail

MailAcquisition

public MailAcquisition()
Method Detail

retrieve

public void retrieve(ReliableTransmitter transmitter)
              throws java.lang.Exception
Description copied from interface: AcquisitionHandler
Retrieves one or more message from an external source (e-mail, ftp, ...). Message properties such as priority, expiration or persistence will be set afterwards by the AcquisitionModule.

If the external source is reliable, acknowledgment can be done safely after transmitting the message using the transmitter.

Specified by:
retrieve in interface AcquisitionHandler
Parameters:
transmitter - a transmitter used to transmit retrieved messages to the MOM reliably.
Throws:
java.lang.Exception

popMail

public javax.mail.Message[] popMail(java.lang.String popServer,
                                    java.lang.String popUser,
                                    java.lang.String popPassword,
                                    boolean expunge)

closeFolder

public void closeFolder(java.util.List msgs,
                        boolean expunge)

setProperties

public void setProperties(java.util.Properties properties)
Description copied from interface: AcquisitionHandler
Configures the handler with the given properties. This method is called one time before the first call to retrieve and then when the acquisition destination receives a configuration message.

Specified by:
setProperties in interface AcquisitionHandler
Parameters:
properties - The new set of properties.

getBody

private java.lang.String getBody(javax.mail.Message message)
                          throws java.lang.Exception,
                                 javax.mail.MessagingException
Throws:
java.lang.Exception
javax.mail.MessagingException

close

public void close()
Description copied from interface: AcquisitionHandler
Closes this handler and releases any system resources associated to it. There will be no subsequent call to this handler after it has been closed.

Specified by:
close in interface AcquisitionHandler


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.