Package com.ibm.di.connector
Class MailboxConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.MailboxConnector
-
- All Implemented Interfaces:
ConnectorInterface,VersionInfoInterface,java.util.EventListener,javax.mail.event.MessageCountListener
public class MailboxConnector extends Connector implements ConnectorInterface, javax.mail.event.MessageCountListener
Simple access to POP/IMAP based mailboxes.
-
-
Field Summary
-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description MailboxConnector()Constructor for the MailboxConnector object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteEntry(Entry aEntry, SearchCriteria aSearch)Deletes an existing entry.EntryfindEntry(SearchCriteria aSearch)Finds an existing entry.EntrygetNextEntry()Gets the next message from an open MailboxConnector objectjavax.mail.StoregetStore()Returns theStoreobject used by the Connector.java.lang.StringgetVersion()Version information.voidinitialize(java.lang.Object aObj)Reads connector parameter's values and initialize the Connector.voidmessagesAdded(javax.mail.event.MessageCountEvent aMce)Gets notification for added messagevoidmessagesRemoved(javax.mail.event.MessageCountEvent aMce)Gets notification for removed messagevoidmodEntry(Entry entry, SearchCriteria search, Entry old)Modifies an existing entry.voidputEntry(Entry entry)Adds a new entry to the data sourcevoidselectEntries()Prepare the Connector for sequential readvoidterminate()Terminate the connector.-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, extractExceptionInformation, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logError, logmsg, modEntry, pushback, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.di.connector.ConnectorInterface
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
-
-
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object aObj) throws java.lang.ExceptionReads connector parameter's values and initialize the Connector.- Specified by:
initializein interfaceConnectorInterface- Overrides:
initializein classConnector- Parameters:
aObj- Null, Socket or ConnectorMode class- Throws:
java.lang.Exception- If invalid Connector parameter values are supplied.
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
Gets the next message from an open MailboxConnector object- Specified by:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin classConnector- Returns:
- The next Entry
- Throws:
java.lang.Exception- If retrieving the next Entry fails.- See Also:
ConnectorInterface.selectEntries()
-
getStore
public javax.mail.Store getStore()
Returns theStoreobject used by the Connector.- Returns:
- the Store object this Connector is working with.
-
messagesAdded
public void messagesAdded(javax.mail.event.MessageCountEvent aMce)
Gets notification for added message- Specified by:
messagesAddedin interfacejavax.mail.event.MessageCountListener- Parameters:
aMce- MessageCountEvent
-
messagesRemoved
public void messagesRemoved(javax.mail.event.MessageCountEvent aMce)
Gets notification for removed message- Specified by:
messagesRemovedin interfacejavax.mail.event.MessageCountListener- Parameters:
aMce- MessageCountEvent
-
selectEntries
public void selectEntries()
Prepare the Connector for sequential read- Specified by:
selectEntriesin interfaceConnectorInterface- Overrides:
selectEntriesin classConnector
-
findEntry
public Entry findEntry(SearchCriteria aSearch) throws java.lang.Exception
Finds an existing entry. The search criteria specifies which entry to locate- Specified by:
findEntryin interfaceConnectorInterface- Overrides:
findEntryin classConnector- Parameters:
aSearch- The search criteria used to locate the entry to be modified, search criteria can be /mail.messagenumber, mail.from, mail.to, mail.cc, mail.subject, mail.messageid- Returns:
- The entry found, or null if no or multiple entries found
- Throws:
java.lang.Exception- Any exceptions thrown by the connector's underlying classes
-
deleteEntry
public void deleteEntry(Entry aEntry, SearchCriteria aSearch) throws java.lang.Exception
Deletes an existing entry. The search criteria specifies which entry to modify.- Specified by:
deleteEntryin interfaceConnectorInterface- Overrides:
deleteEntryin classConnector- Parameters:
aEntry- The entry dataaSearch- The search criteria used to locate the entry to be deleted- Throws:
java.lang.Exception- Any exceptions thrown by the connector's underlying classes
-
terminate
public void terminate() throws java.lang.ExceptionTerminate the connector. This function closes all connection and releases all resources used by the connector. This function also calls the parser's closeParser() method if a parser is active.- Specified by:
terminatein interfaceConnectorInterface- Overrides:
terminatein classConnector- Throws:
java.lang.Exception- if an error occurs.
-
putEntry
public void putEntry(Entry entry) throws java.lang.Exception
Adds a new entry to the data source- Specified by:
putEntryin interfaceConnectorInterface- Overrides:
putEntryin classConnector- Parameters:
entry- The entry data to add- Throws:
java.lang.Exception- Any exceptions thrown when trying to add entry in update mode or when the appending of the message fails.
-
modEntry
public void modEntry(Entry entry, SearchCriteria search, Entry old) throws java.lang.Exception
Modifies an existing entry. The new entry data is given by the entry parameter and the search criteria specifies which entry to modify.- Specified by:
modEntryin interfaceConnectorInterface- Overrides:
modEntryin classConnector- Parameters:
entry- The entry datasearch- The search criteria used to locate the entry to be modifiedold- The old entry found by the search criteria- Throws:
java.lang.Exception- Any exceptions thrown when updating the flags of a message
-
getVersion
public java.lang.String getVersion()
Version information.- Specified by:
getVersionin interfaceVersionInfoInterface- Returns:
- the version information
-
-