com.ibm.di.connector
Class JNDIConnector

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

public class JNDIConnector
extends Connector
implements ConnectorInterface


Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
JNDIConnector()
           
 
Method Summary
 void addAttributeValue(String moddn, String modattr, String modval)
          Adds a given value to an attribute
 void deleteEntry(Entry entry, SearchCriteria search)
          Deletes an existing entry.
 Entry findEntry(SearchCriteria search)
          Finds an existing entry.
 String getAttributeSyntax(DirContext schema, String attributeName)
           
 Entry getCurrentEntry()
           
 Entry getNextEntry()
          Returns the next Entry from the connector.
protected  String getSearchFilterAll()
           
 String getVersion()
           
 void initialize(Object o)
          Initialize the connector.
 boolean isDeltaSupported()
          Returns true if this connector is able to perform delta updates
 boolean isExceptionFatal(Exception e)
          Returns true if the exception is considered to be fatal.
 String mapAttributeSyntax(String oid)
           
 void modEntry(Entry entry, SearchCriteria search)
          Modifies an existing entry.
 void modEntry(Entry entry, SearchCriteria search, Entry old)
          Modifies an existing entry.
 void putEntry(Entry entry)
          Adds a new entry to the data source
 Vector queryObjectClassAttributes(String objectClass)
           
 Object querySchema(Object source)
          This function translates to whatever means a connector has to discover schema for a connection.
 void removeAttribute(String moddn, String modattr)
          removeAttribute : removes the attribute
 void removeAttributeValue(String moddn, String modattr, String modval)
          removeAttributeValue: removes a given attribute value from an entry
 void replaceAttributeValue(String moddn, String modattr, String modval)
          replaceAttributeValue: replaces a given attribute with a certain value
 void selectEntries()
          Prepare the Connector for sequential read.
protected  void setSearchFilterAll(String aSearchFilterAll)
           
 void terminate()
          Terminate the connector.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, hasConfigValue, hasParser, initParser, isIOException, logmsg, pushback, queryOperations, queryReply, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, 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, isIOException, pushback, queryOperations, queryReply, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Constructor Detail

JNDIConnector

public JNDIConnector()
Method Detail

terminate

public void terminate()
Description copied from class: Connector
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(Object o)
                throws Exception
Description copied from class: Connector
Initialize the connector. The connector may be passed a parameter of any kind by the user. It is up to the connector to determine whether this object can be used or not. The parameter is typically provided by a user script. When an AssemblyLine initializes it's Connectors, they are passed a ConnectorMode object.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
o - User provided parameter
Throws:
Exception

selectEntries

public void selectEntries()
                   throws Exception
Description copied from class: Connector
Prepare the Connector for sequential read. If necessary, create a result set to be used for getNextEntry(). When the Connector is used as an Iterator in an AssemblyLine, this method will be called. Default is an empty method.

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

getNextEntry

public Entry getNextEntry()
                   throws Exception
Description copied from class: Connector
Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
- the next Entry, or null if no more data
Throws:
Exception
See Also:
Connector.selectEntries()

getCurrentEntry

public Entry getCurrentEntry()

putEntry

public void putEntry(Entry entry)
              throws Exception
Description copied from class: Connector
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:
Exception - Any exceptions thrown by the connector's underlying classes

modEntry

public void modEntry(Entry entry,
                     SearchCriteria search)
              throws Exception
Description copied from class: Connector
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
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

modEntry

public void modEntry(Entry entry,
                     SearchCriteria search,
                     Entry old)
              throws Exception
Description copied from class: Connector
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:
Exception - Any exceptions thrown by the connector's underlying classes

deleteEntry

public void deleteEntry(Entry entry,
                        SearchCriteria search)
                 throws Exception
Description copied from class: Connector
Deletes an existing entry. The search criteria specifies which entry to modify. Some connectors may silently ignore the search criteria. For example, the LDAP connector will use the distinguished name ($dn) from the entry parameter (if it exists) rather than expanding the search criteria and search for the entry. Each connector's inner semantics governs wheter the search parameter is used or not.

Specified by:
deleteEntry in interface ConnectorInterface
Overrides:
deleteEntry in class Connector
Parameters:
entry - The entry data
search - The search criteria used to locate the entry to be deleted
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

findEntry

public Entry findEntry(SearchCriteria search)
                throws Exception
Description copied from class: Connector
Finds an existing entry. The search criteria specifies which entry to locate

Specified by:
findEntry in interface ConnectorInterface
Overrides:
findEntry in class Connector
Parameters:
search - The search criteria used to locate the entry to be modified
Returns:
The entry found, or null if no or multiple entries found
Throws:
Exception - Any exceptions thrown by the connector's underlying classes

isExceptionFatal

public boolean isExceptionFatal(Exception e)
Description copied from class: Connector
Returns true if the exception is considered to be fatal. This governs whether the AssemblyLine logs the error as a warning or terminates. By default all exceptions are fatal.

Specified by:
isExceptionFatal in interface ConnectorInterface
Overrides:
isExceptionFatal in class Connector
Parameters:
e - The exception object
Returns:
Whether the exception is fatal or not

addAttributeValue

public void addAttributeValue(String moddn,
                              String modattr,
                              String modval)
                       throws Exception
Adds a given value to an attribute

Parameters:
moddn - String representing the DN to which to add the attribute value
modattr - String representing the name of the attribute to add a value to
modval - String representing the value of the attribute add
Throws:
java.langException - when underlying modify operation fails
Exception

replaceAttributeValue

public void replaceAttributeValue(String moddn,
                                  String modattr,
                                  String modval)
                           throws Exception
replaceAttributeValue: replaces a given attribute with a certain value

Parameters:
moddn - String representing the DN to which to replace the attribute value
modattr - String representing the name of the attribute to replace the value for
modval - String representing the desired value for the attribute
Throws:
java.langException - when underlying modify operation fails
Exception

removeAttributeValue

public void removeAttributeValue(String moddn,
                                 String modattr,
                                 String modval)
                          throws Exception
removeAttributeValue: removes a given attribute value from an entry

Parameters:
moddn - String representing the DN to which to remove the attribute value
modattr - String representing the name of the attribute to change
modval - String representing the value you wish to have removed from the attribute
Throws:
java.langException - when underlying modify operation fails
Exception

removeAttribute

public void removeAttribute(String moddn,
                            String modattr)
                     throws Exception
removeAttribute : removes the attribute

Parameters:
moddn - String representing the DN to which to remove the attribute values
modattr - String representing the name of the attribute to remove all values from
Throws:
java.langException - when underlying modify operation fails
Exception

querySchema

public Object querySchema(Object source)
                   throws Exception
Description copied from class: Connector
This function translates to whatever means a connector has to discover schema for a connection. The connector may implement this, in which case a Vector of Entry objects is returned for each column/attribute it discovered. For a database connector this would typically be column names and their attributes.

Each Entry in the Vector returned should contain the following attributes:

NameValue
nameThe name of the column/attribute/field ....
syntaxThe syntax or expected value type
sizeIf specified this will give the user a hint as to how long the field may be

Specified by:
querySchema in interface ConnectorInterface
Overrides:
querySchema in class Connector
Parameters:
source - The object on which to discover schema. This may be an Entry or a string value
Returns:
A Vector of com.ibm.di.entry.Entry objects describing each entity
Throws:
Exception
See Also:
Entry, Vector

getAttributeSyntax

public String getAttributeSyntax(DirContext schema,
                                 String attributeName)

queryObjectClassAttributes

public Vector queryObjectClassAttributes(String objectClass)
                                  throws Exception
Throws:
Exception

mapAttributeSyntax

public String mapAttributeSyntax(String oid)

getVersion

public String getVersion()
Specified by:
getVersion in interface VersionInfoInterface

isDeltaSupported

public boolean isDeltaSupported()
Description copied from class: Connector
Returns true if this connector is able to perform delta updates

Specified by:
isDeltaSupported in interface ConnectorInterface
Overrides:
isDeltaSupported in class Connector
Returns:
true if delta updates are supported, false otherwise

getSearchFilterAll

protected String getSearchFilterAll()

setSearchFilterAll

protected void setSearchFilterAll(String aSearchFilterAll)