com.ibm.di.connector
Class MailboxConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by 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
MailboxConnector()
          Constructor for the MailboxConnector object
 
Method Summary
 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 object
 javax.mail.Store getStore()
          Returns the Store 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 message
 void messagesRemoved(javax.mail.event.MessageCountEvent aMce)
          Gets notification for removed message
 void modEntry(Entry entry, SearchCriteria search, Entry old)
          Modifies an existing entry.
 void putEntry(Entry entry)
          Adds a new entry to the data source
 void selectEntries()
          Prepare the Connector for sequential read
 void 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
 

Constructor Detail

MailboxConnector

public MailboxConnector()
Constructor for the MailboxConnector object

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 interface ConnectorInterface
Overrides:
initialize in class Connector
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 interface ConnectorInterface
Overrides:
getNextEntry in class Connector
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 the Store 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 interface javax.mail.event.MessageCountListener
Parameters:
aMce - MessageCountEvent

messagesRemoved

public void messagesRemoved(javax.mail.event.MessageCountEvent aMce)
Gets notification for removed message

Specified by:
messagesRemoved in interface javax.mail.event.MessageCountListener
Parameters:
aMce - MessageCountEvent

selectEntries

public void selectEntries()
Prepare the Connector for sequential read

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector

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 interface ConnectorInterface
Overrides:
findEntry in class Connector
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 interface ConnectorInterface
Overrides:
deleteEntry in class Connector
Parameters:
aEntry - The entry data
aSearch - 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 interface ConnectorInterface
Overrides:
terminate in class Connector
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 interface ConnectorInterface
Overrides:
putEntry in class Connector
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 interface ConnectorInterface
Overrides:
modEntry in class Connector
Parameters:
entry - The entry data
search - The search criteria used to locate the entry to be modified
old - 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 interface VersionInfoInterface
Returns:
the version information