com.ibm.di.connector
Class DominoConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.DominoConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface, java.lang.Runnable
Direct Known Subclasses:
DominoAdminPConnector

public class DominoConnector
extends Connector
implements ConnectorInterface, java.lang.Runnable

This is the class for the TDI Lotus Notes Connector.


Field Summary
protected  java.lang.String selection
          Used by subclasses.
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
DominoConnector()
          Constructor for the DominoConnector object
 
Method Summary
 void addValue(Entry e, java.lang.String attr, java.util.Vector value, int type)
          Adds a feature to the Value attribute of the DominoConnector object
 Entry buildEntry(lotus.domino.Document doc)
          This method is invoked by the getNextEntry method.
 void deleteEntry(Entry entry, SearchCriteria search)
          This method is used in Delete mode.
 Entry findEntry(SearchCriteria search)
          This method is used in Lookup, Update and Delete modes.
 lotus.domino.Database getDominoDatabase(java.lang.String database)
          Gets the dominoDatabase attribute of the DominoConnector object
 lotus.domino.Session getDominoSession()
          Gets the dominoSession attribute of the DominoConnector object
 lotus.domino.View getDominoView(java.lang.String view)
          Gets the dominoView attribute of the DominoConnector object
 Entry getNextEntry()
          Gets the nextEntry attribute of the DominoConnector object
 java.lang.String getVersion()
          Return version information
 void initialize(java.lang.Object o)
          This method initializes the Connector.
 void initLocalThread()
          This call is needed when the connector makes local calls through a client or server.
 Entry inner_findEntry(SearchCriteria search)
          Internal implementation of the findEntry method executed by the worker thread.
protected  void inner_initialize(java.lang.Object o)
          Initializes the internal worker thread and the connector configuration.
 boolean isConvertable(int type)
          This method is used internally.
 void modDocument(lotus.domino.Document doc, Entry entry)
          This method modifies a Domino database document.
 void modEntry(Entry entry, SearchCriteria search)
          This method is used in Update mode.
 void modEntry(Entry entry, SearchCriteria search, Entry old)
          This method is used in Update mode.
 void putEntry(Entry entry)
          This method is used in AddOnly mode.
 java.util.Vector<java.lang.String> queryDatabases()
          This methods builds and returns a collection of the available Domino databases.
 java.util.Vector<java.lang.String> queryViews()
          Gets the list of views' names for the current Domino database.
 void run()
          Kick off the internal worker thread.
 void selectEntries()
          This method is used in Iterator mode.
 void setCurrent(Entry entry, SearchCriteria search)
          Used when multiple entries found, and you want to modify or delete one of them.
 void terminate()
          Terminate the connector.
 void termLocalThread()
          This method terminates the Notes API thread to make sure resources are cleaned up properly.
 
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, pushback, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, 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, pushback, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Field Detail

selection

protected java.lang.String selection
Used by subclasses.

Constructor Detail

DominoConnector

public DominoConnector()
Constructor for the DominoConnector object

Method Detail

getNextEntry

public Entry getNextEntry()
                   throws java.lang.Exception
Gets the nextEntry attribute of the DominoConnector object

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
The nextEntry value
Throws:
java.lang.Exception - An exception is thrown if this method fails.
See Also:
ConnectorInterface.selectEntries()

getDominoSession

public lotus.domino.Session getDominoSession()
Gets the dominoSession attribute of the DominoConnector object

Returns:
The dominoSession value

getDominoDatabase

public lotus.domino.Database getDominoDatabase(java.lang.String database)
                                        throws java.lang.Exception
Gets the dominoDatabase attribute of the DominoConnector object

Parameters:
database - the name of the Domino database file (usually a file with a .nsf filename extension)
Returns:
The dominoDatabase value
Throws:
java.lang.Exception - An exception is thrown if this method fails.

getDominoView

public lotus.domino.View getDominoView(java.lang.String view)
                                throws java.lang.Exception
Gets the dominoView attribute of the DominoConnector object

Parameters:
view - the name of the Domino view
Returns:
The dominoView value
Throws:
java.lang.Exception - An exception is thrown if this method fails.

getVersion

public java.lang.String getVersion()
Return version information

Specified by:
getVersion in interface VersionInfoInterface
Returns:
The version value

terminate

public void terminate()
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

initialize

public void initialize(java.lang.Object o)
                throws java.lang.Exception
This method initializes the Connector.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
o - this parameter is ignored
Throws:
java.lang.Exception - An exception is thrown if this method fails.

inner_initialize

protected void inner_initialize(java.lang.Object o)
                         throws java.lang.Exception
Initializes the internal worker thread and the connector configuration.

Parameters:
o - ignored.
Throws:
java.lang.Exception - if an error occurs.

selectEntries

public void selectEntries()
                   throws java.lang.Exception
This method is used in Iterator mode. This method retrieves the entries which will be iterated upon by the getNextEntry method.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
java.lang.Exception - An exception is thrown if this method fails.

buildEntry

public Entry buildEntry(lotus.domino.Document doc)
                 throws java.lang.Exception
This method is invoked by the getNextEntry method. This method is used to create and populate the entry object to be returned to the AssemblyLine.

Parameters:
doc - the Domino Document object which provides the data for the entry being populated
Returns:
the populated TDI entry object
Throws:
java.lang.Exception - An exception is thrown if this method fails.

isConvertable

public boolean isConvertable(int type)
This method is used internally.

Parameters:
type - the type id.
Returns:
true if the Domino type specified by the provided id can be converted, false otherwise.

putEntry

public void putEntry(Entry entry)
              throws java.lang.Exception
This method is used in AddOnly mode. This method writes data to the Domino database.

Specified by:
putEntry in interface ConnectorInterface
Overrides:
putEntry in class Connector
Parameters:
entry - the entry to be written to the Domino database
Throws:
java.lang.Exception - An exception is thrown if this method fails.

modEntry

public void modEntry(Entry entry,
                     SearchCriteria search)
              throws java.lang.Exception
This method is used in Update mode. This method makes changes to an existing document in the Domino database.

Specified by:
modEntry in interface ConnectorInterface
Overrides:
modEntry in class Connector
Parameters:
entry - the entry which stores the new data with which existing data will be replaced
search - the search criteria with which the existing database document to be changed will be located
Throws:
java.lang.Exception - An exception is thrown if this method fails.

modEntry

public void modEntry(Entry entry,
                     SearchCriteria search,
                     Entry old)
              throws java.lang.Exception
This method is used in Update mode. This method makes changes to an existing document in the Domino database.

Specified by:
modEntry in interface ConnectorInterface
Overrides:
modEntry in class Connector
Parameters:
entry - the entry which stores the new data with which existing data will be replaced
search - the search criteria with which the existing database document to be changed will be located
old - used for the implementation of updating documents - it has no meaning for the user of the Connector
Throws:
java.lang.Exception - An exception is thrown if this method fails.

deleteEntry

public void deleteEntry(Entry entry,
                        SearchCriteria search)
                 throws java.lang.Exception
This method is used in Delete mode. This methods deletes entries from the Domino database.

Specified by:
deleteEntry in interface ConnectorInterface
Overrides:
deleteEntry in class Connector
Parameters:
entry - used for implementation internals only
search - the search criteria with which the existing database document to be deleted will be located
Throws:
java.lang.Exception - An exception is thrown if this method fails.

findEntry

public Entry findEntry(SearchCriteria search)
                throws java.lang.Exception
This method is used in Lookup, Update and Delete modes. This methods locates an entry by the given search criteria.

Specified by:
findEntry in interface ConnectorInterface
Overrides:
findEntry in class Connector
Parameters:
search - the search criteria with which the database document will be located
Returns:
the located entry object
Throws:
java.lang.Exception - if this method fails.

inner_findEntry

public Entry inner_findEntry(SearchCriteria search)
                      throws java.lang.Exception
Internal implementation of the findEntry method executed by the worker thread.

Parameters:
search - the search criteria with which the database document will be located
Returns:
the located entry object
Throws:
java.lang.Exception - if this method fails.

setCurrent

public void setCurrent(Entry entry,
                       SearchCriteria search)
Used when multiple entries found, and you want to modify or delete one of them. change foundDoc to be this entry.

Specified by:
setCurrent in interface ConnectorInterface
Overrides:
setCurrent in class Connector
Parameters:
entry - The entry we want to find for modification/delete
search - The search

modDocument

public void modDocument(lotus.domino.Document doc,
                        Entry entry)
                 throws java.lang.Exception
This method modifies a Domino database document.

Parameters:
doc - the database document to modify
entry - the entry which supplies the new values for the document to be modified
Throws:
java.lang.Exception - An exception is thrown if this method fails.

addValue

public void addValue(Entry e,
                     java.lang.String attr,
                     java.util.Vector value,
                     int type)
Adds a feature to the Value attribute of the DominoConnector object

Parameters:
e - Entry
attr - attribute name
value - attribute value
type - attribute type

queryDatabases

public java.util.Vector<java.lang.String> queryDatabases()
                                                  throws java.lang.Exception
This methods builds and returns a collection of the available Domino databases. In order to successfully retreive a list of the databases through IIOP session the option "Allow HTTP clients to browse databases" should be set to "yes". This option can be configured with the Domino Admin application. It is situated: "Configuratin" page -> "Internet Protocols" tab -> "HTTP" sub-tab -> "R5 Basics" sectin

Returns:
a collection of the available Domino databases
Throws:
java.lang.Exception - if this method fails.

queryViews

public java.util.Vector<java.lang.String> queryViews()
                                              throws java.lang.Exception
Gets the list of views' names for the current Domino database.

Returns:
the list of views' names for the current Domino database
Throws:
java.lang.Exception - An exception is thrown if this method fails.

initLocalThread

public void initLocalThread()
                     throws java.lang.Exception
This call is needed when the connector makes local calls through a client or server. The local calls (lotus.domino.local.*) are available only in the Notes.jar which may not be in the installation. Thus, use reflection to load and call sinitThread/stermThread. This method is called from the initialize method when local session is made.

Throws:
java.lang.Exception - An exception is thrown if this method fails.

termLocalThread

public void termLocalThread()
This method terminates the Notes API thread to make sure resources are cleaned up properly. This method is usually called from the terminate method. It is not recomended to use it directly.


run

public void run()
Kick off the internal worker thread.

Specified by:
run in interface java.lang.Runnable