Package adams.flow.source.imapsource
Class ReceiveEmail
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.source.imapsource.AbstractIMAPOperation<O>
-
- adams.flow.source.imapsource.AbstractIMAPFolderOperation<jodd.mail.ReceivedEmail[]>
-
- adams.flow.source.imapsource.ReceiveEmail
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,Serializable
public class ReceiveEmail extends AbstractIMAPFolderOperation<jodd.mail.ReceivedEmail[]>
Receives emails according to the filters.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Flag[]m_Flagsthe flags to look for.protected Stringm_Fromthe FROM filter.protected booleanm_OnlyEnvelopeswhether to received only envelopes.protected PostReceptionActionm_PostReceptionActionthe action to perform after receiving.protected Stringm_Subjectthe SUBJECT filter.protected Stringm_Tothe TO filter.-
Fields inherited from class adams.flow.source.imapsource.AbstractIMAPFolderOperation
m_Folder
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ReceiveEmail()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected jodd.mail.ReceivedEmail[]doExecute(IMAPConnection conn, MessageCollection errors)Executes the operation and returns the generated output.StringflagsTipText()Returns the tip text for this property.StringfromTipText()Returns the tip text for this property.Classgenerates()Returns the type of output the operation generates.Flag[]getFlags()Returns the flags to look for.StringgetFrom()Returns the FROM filter, ignored if empty.booleangetOnlyEnvelopes()Returns whether to only receive the envelopes or fully download them.PostReceptionActiongetPostReceptionAction()Returns the action to perform after receiving the full messages (does not apply to envelopes).StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringgetSubject()Returns the SUBJECT filter, ignored if empty.StringgetTo()Returns the TO filter, ignored if empty.StringglobalInfo()Returns a string describing the object.StringonlyEnvelopesTipText()Returns the tip text for this property.StringpostReceptionActionTipText()Returns the tip text for this property.voidsetFlags(Flag[] value)Sets the flags to look for.voidsetFrom(String value)Sets the FROM filter, ignored if empty.voidsetOnlyEnvelopes(boolean value)Sets whether to only receive the envelopes or fully download them.voidsetPostReceptionAction(PostReceptionAction value)Sets the action to perform after receiving the full messages (does not apply to envelopes).voidsetSubject(String value)Sets the SUBJECT filter, ignored if empty.voidsetTo(String value)Sets the TO filter, ignored if empty.StringsubjectTipText()Returns the tip text for this property.StringtoTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.source.imapsource.AbstractIMAPFolderOperation
check, folderTipText, getDefaultFolder, getFolder, setFolder
-
Methods inherited from class adams.flow.source.imapsource.AbstractIMAPOperation
execute
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_OnlyEnvelopes
protected boolean m_OnlyEnvelopes
whether to received only envelopes.
-
m_From
protected String m_From
the FROM filter.
-
m_To
protected String m_To
the TO filter.
-
m_Subject
protected String m_Subject
the SUBJECT filter.
-
m_Flags
protected Flag[] m_Flags
the flags to look for.
-
m_PostReceptionAction
protected PostReceptionAction m_PostReceptionAction
the action to perform after receiving.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractIMAPFolderOperation<jodd.mail.ReceivedEmail[]>
-
setOnlyEnvelopes
public void setOnlyEnvelopes(boolean value)
Sets whether to only receive the envelopes or fully download them.- Parameters:
value- true if to receive only the envelopes
-
getOnlyEnvelopes
public boolean getOnlyEnvelopes()
Returns whether to only receive the envelopes or fully download them.- Returns:
- true if to mark read
-
onlyEnvelopesTipText
public String onlyEnvelopesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFrom
public void setFrom(String value)
Sets the FROM filter, ignored if empty.- Parameters:
value- the filter value
-
getFrom
public String getFrom()
Returns the FROM filter, ignored if empty.- Returns:
- the filter value
-
fromTipText
public String fromTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTo
public void setTo(String value)
Sets the TO filter, ignored if empty.- Parameters:
value- the filter value
-
getTo
public String getTo()
Returns the TO filter, ignored if empty.- Returns:
- the filter value
-
toTipText
public String toTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSubject
public void setSubject(String value)
Sets the SUBJECT filter, ignored if empty.- Parameters:
value- the filter value
-
getSubject
public String getSubject()
Returns the SUBJECT filter, ignored if empty.- Returns:
- the filter value
-
subjectTipText
public String subjectTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFlags
public void setFlags(Flag[] value)
Sets the flags to look for.- Parameters:
value- the flags
-
getFlags
public Flag[] getFlags()
Returns the flags to look for.- Returns:
- the flags
-
flagsTipText
public String flagsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPostReceptionAction
public void setPostReceptionAction(PostReceptionAction value)
Sets the action to perform after receiving the full messages (does not apply to envelopes).- Parameters:
value- the action
-
getPostReceptionAction
public PostReceptionAction getPostReceptionAction()
Returns the action to perform after receiving the full messages (does not apply to envelopes).- Returns:
- the action
-
postReceptionActionTipText
public String postReceptionActionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractIMAPFolderOperation<jodd.mail.ReceivedEmail[]>- Returns:
- null if no info available, otherwise short string
-
generates
public Class generates()
Returns the type of output the operation generates.- Specified by:
generatesin classAbstractIMAPOperation<jodd.mail.ReceivedEmail[]>- Returns:
- the class
-
doExecute
protected jodd.mail.ReceivedEmail[] doExecute(IMAPConnection conn, MessageCollection errors)
Executes the operation and returns the generated output.- Specified by:
doExecutein classAbstractIMAPOperation<jodd.mail.ReceivedEmail[]>- Parameters:
conn- the connection to useerrors- for collecting errors- Returns:
- the generated output, null in case of error or failed check
-
-