Package com.ibm.di.connector
Class DominoConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- 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
Fields Modifier and Type Field Description protected java.lang.StringselectionUsed by subclasses.-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description DominoConnector()Constructor for the DominoConnector object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(Entry e, java.lang.String attr, java.util.Vector value, int type)Adds a feature to the Value attribute of the DominoConnector objectEntrybuildEntry(lotus.domino.Document doc)This method is invoked by the getNextEntry method.voiddeleteEntry(Entry entry, SearchCriteria search)This method is used in Delete mode.EntryfindEntry(SearchCriteria search)This method is used in Lookup, Update and Delete modes.lotus.domino.DatabasegetDominoDatabase(java.lang.String database)Gets the dominoDatabase attribute of the DominoConnector objectlotus.domino.SessiongetDominoSession()Gets the dominoSession attribute of the DominoConnector objectlotus.domino.ViewgetDominoView(java.lang.String view)Gets the dominoView attribute of the DominoConnector objectEntrygetNextEntry()Gets the nextEntry attribute of the DominoConnector objectlotus.domino.DocumentgetNotesDoc()java.lang.StringgetVersion()Return version informationvoidinitialize(java.lang.Object o)This method initializes the Connector.voidinitLocalThread()This call is needed when the connector makes local calls through a client or server.Entryinner_findEntry(SearchCriteria search)Internal implementation of the findEntry method executed by the worker thread.protected voidinner_initialize(java.lang.Object o)Initializes the internal worker thread and the connector configuration.booleanisConvertable(int type)This method is used internally.voidmodDocument(lotus.domino.Document doc, Entry entry)This method modifies a Domino database document.voidmodEntry(Entry entry, SearchCriteria search)This method is used in Update mode.voidmodEntry(Entry entry, SearchCriteria search, Entry old)This method is used in Update mode.voidputEntry(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.voidrun()Kick off the internal worker thread.voidselectEntries()This method is used in Iterator mode.voidsetCurrent(Entry entry, SearchCriteria search)Used when multiple entries found, and you want to modify or delete one of them.voidterminate()Terminate the connector.voidtermLocalThread()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
-
-
-
-
Method Detail
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
Gets the nextEntry attribute of the DominoConnector object- Specified by:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin classConnector- 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.ExceptionGets 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.ExceptionGets 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:
getVersionin interfaceVersionInfoInterface- 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:
terminatein interfaceConnectorInterface- Overrides:
terminatein classConnector
-
initialize
public void initialize(java.lang.Object o) throws java.lang.ExceptionThis method initializes the Connector.- Specified by:
initializein interfaceConnectorInterface- Overrides:
initializein classConnector- 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.ExceptionInitializes the internal worker thread and the connector configuration.- Parameters:
o- ignored.- Throws:
java.lang.Exception- if an error occurs.
-
getNotesDoc
public lotus.domino.Document getNotesDoc()
-
selectEntries
public void selectEntries() throws java.lang.ExceptionThis method is used in Iterator mode. This method retrieves the entries which will be iterated upon by the getNextEntry method.- Specified by:
selectEntriesin interfaceConnectorInterface- Overrides:
selectEntriesin classConnector- 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:
putEntryin interfaceConnectorInterface- Overrides:
putEntryin classConnector- 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:
modEntryin interfaceConnectorInterface- Overrides:
modEntryin classConnector- Parameters:
entry- the entry which stores the new data with which existing data will be replacedsearch- 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:
modEntryin interfaceConnectorInterface- Overrides:
modEntryin classConnector- Parameters:
entry- the entry which stores the new data with which existing data will be replacedsearch- the search criteria with which the existing database document to be changed will be locatedold- 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:
deleteEntryin interfaceConnectorInterface- Overrides:
deleteEntryin classConnector- Parameters:
entry- used for implementation internals onlysearch- 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:
findEntryin interfaceConnectorInterface- Overrides:
findEntryin classConnector- 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:
setCurrentin interfaceConnectorInterface- Overrides:
setCurrentin classConnector- Parameters:
entry- The entry we want to find for modification/deletesearch- The search
-
modDocument
public void modDocument(lotus.domino.Document doc, Entry entry) throws java.lang.ExceptionThis method modifies a Domino database document.- Parameters:
doc- the database document to modifyentry- 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-Entryattr- attribute namevalue- attribute valuetype- attribute type
-
queryDatabases
public java.util.Vector<java.lang.String> queryDatabases() throws java.lang.ExceptionThis 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.ExceptionGets 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.ExceptionThis 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:
runin interfacejava.lang.Runnable
-
-