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 void
deleteEntry(Entry aEntry, SearchCriteria aSearch)
Deletes an existing entry.Entry
findEntry(SearchCriteria aSearch)
Finds an existing entry.Entry
getNextEntry()
Gets the next message from an open MailboxConnector objectjavax.mail.Store
getStore()
Returns theStore
object used by the Connector.java.lang.String
getVersion()
Version information.void
initialize(java.lang.Object aObj)
Reads connector parameter's values and initialize the Connector.void
messagesAdded(javax.mail.event.MessageCountEvent aMce)
Gets notification for added messagevoid
messagesRemoved(javax.mail.event.MessageCountEvent aMce)
Gets notification for removed messagevoid
modEntry(Entry entry, SearchCriteria search, Entry old)
Modifies an existing entry.void
putEntry(Entry entry)
Adds a new entry to the data sourcevoid
selectEntries()
Prepare the Connector for sequential readvoid
terminate()
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.Exception
Reads connector parameter's values and initialize the Connector.- Specified by:
initialize
in interfaceConnectorInterface
- Overrides:
initialize
in 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:
getNextEntry
in interfaceConnectorInterface
- Overrides:
getNextEntry
in 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 theStore
object 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:
messagesAdded
in interfacejavax.mail.event.MessageCountListener
- Parameters:
aMce
- MessageCountEvent
-
messagesRemoved
public void messagesRemoved(javax.mail.event.MessageCountEvent aMce)
Gets notification for removed message- Specified by:
messagesRemoved
in interfacejavax.mail.event.MessageCountListener
- Parameters:
aMce
- MessageCountEvent
-
selectEntries
public void selectEntries()
Prepare the Connector for sequential read- Specified by:
selectEntries
in interfaceConnectorInterface
- Overrides:
selectEntries
in 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:
findEntry
in interfaceConnectorInterface
- Overrides:
findEntry
in 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:
deleteEntry
in interfaceConnectorInterface
- Overrides:
deleteEntry
in 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.Exception
Terminate 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:
terminate
in interfaceConnectorInterface
- Overrides:
terminate
in 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:
putEntry
in interfaceConnectorInterface
- Overrides:
putEntry
in 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:
modEntry
in interfaceConnectorInterface
- Overrides:
modEntry
in 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:
getVersion
in interfaceVersionInfoInterface
- Returns:
- the version information
-
-