|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ibm.di.connector.Connector
com.ibm.di.connector.LDAPConnector
public class LDAPConnector
The LDAP connector provides full access to LDAP based directories. It allows operations on user entries and schema.
| Field Summary |
|---|
| Fields inherited from class com.ibm.di.connector.Connector |
|---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
| Constructor Summary | |
|---|---|
LDAPConnector()
Constructor for the LDAPConnector object |
|
| Method Summary | |
|---|---|
void |
addAttributeValue(String moddn,
String modattr,
String modval)
Adds a given value to an attribute. |
BasicAttributes |
at2entry(Entry entry,
boolean removeEmptyAttrs)
Internal method used to convert an Entry into BasicAttributes that can be sent to the LDAP Server |
void |
callErrorHookOnAttributeInUseException(boolean errorHook)
Sets the value for invoking error hook on attribute in use exception |
boolean |
compare(String compdn,
String attname,
String attvalue)
compare: performs an ldapcompare operation for the given parameters |
void |
deleteEntry(Entry entry,
SearchCriteria search)
Delete an entry in the LDAP Server. |
Entry |
entry2at(SearchResult sr)
Internal method used to convert a SearchResult from the LDAP Server to an Entry. |
Entry |
findEntry(SearchCriteria search)
Find an entry matching a SearchCriteria. |
boolean |
flagSet(int flag)
Utility method to see if a flag is set |
String |
getAttributeSyntax(DirContext schema,
String attributeName)
Gets an Attribute Syntax from the LDAP Server |
boolean |
getCallErrorHook()
Returns true if Error hooks should be called on AttributeInUseException |
Entry |
getCurrentEntry()
Gets the current Entry. |
InitialLdapContext |
getLdapContext()
Returns the InitialLdapContext (Connection to the LDAP Server) |
Entry |
getNextEntry()
Get the next entry that was retrieved by selectEntries(). |
Vector<Object> |
getServerControls()
Get the supported server Controls from the LDAP Server |
Entry |
getServerInfo()
Gets the serverInfo from the LDAP Server |
String |
getVersion()
Version information. |
void |
initialize(Object o)
Initialize the Connector, connect to the LDAP Server |
boolean |
isDeltaSupported()
This connector is able to perform delta updates |
boolean |
isExceptionFatal(Exception e)
Utility method, that checks if an Exception thrown by underlying libraries is fatal |
String |
mapAttributeSyntax(String oid)
Utility method used for parsing attribute syntax |
void |
modEntry(Entry entry,
SearchCriteria search)
Modify an Object in the LDAP Server. |
void |
modEntry(Entry entry,
SearchCriteria search,
Entry old)
Modify an Object in the LDAP Server. |
void |
moveEntry(String p1,
String p2)
If the LDAP Server does not support renaming, this method can be used to delete an object and recreating it with another name |
void |
putEntry(Entry entry)
Adds a new entry to the data source. |
Vector<Object> |
queryNamingContexts()
Query the LDAP Server for naming contexts |
Vector<Object> |
queryObjectClassAttributes(String objectClass)
Look up an objectclass in the LDAP Server. |
Object |
querySchema(Object source)
Query the schema of the LDAP server. |
void |
rebind(String dn,
String password)
Attempts to reauthenticate using the currently open connection. |
void |
rebind(String dn,
String password,
String authMethod)
Attempts to reauthenticate using the currently open connection. |
void |
removeAllAttributeValues(String moddn,
String modattr)
removeAllAttributeValues: removes all values for a given 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. |
Attribute |
setADPassword(Object password)
setADPassword - Returns an Attribute (JNDI) containing the UNICODE version of a password for ActiveDirectory. |
void |
setsubtreeDeleteSupported(boolean subtreeDeleteSupported)
Allows deleting subtrees. |
void |
showServerInfo()
Logs server information, supported controls and naming contexts |
boolean |
supportsControl(String oid)
Check if the LDAP Server supports a Control |
boolean |
supportsExtension(String oid)
Check if the LDAP Server supports an Extension |
boolean |
supportsPagedResults()
Check if the LDAP Server supports paged results |
boolean |
supportsPersistantSearch()
Check if the LDAP Server supports Persistant Search |
boolean |
supportsSorting()
Check if the LDAP Server supports sorting |
boolean |
supportsVirtualListView()
Check if the LDAP Server supports virtual list view |
void |
terminate()
Close the connection to the LDAP server |
| 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 |
|---|
public LDAPConnector()
| Method Detail |
|---|
public void terminate()
terminate in interface ConnectorInterfaceterminate in class Connectorpublic InitialLdapContext getLdapContext()
public void initialize(Object o)
throws Exception
initialize in interface ConnectorInterfaceinitialize in class Connectoro - An Object sent to the initialize method, ignored.
Exception - Any Exception by the underlying methods to connect to the
LDAP Server
public void selectEntries()
throws Exception
selectEntries in interface ConnectorInterfaceselectEntries in class ConnectorException - Any Exception by the underlying library
public Entry getNextEntry()
throws Exception
getNextEntry in interface ConnectorInterfacegetNextEntry in class ConnectorException - Any Exception thrown by the underlying librariesConnectorInterface.selectEntries()public Entry getCurrentEntry()
public void putEntry(Entry entry)
throws Exception
putEntry in interface ConnectorInterfaceputEntry in class Connectorentry - An Entry populated with values that are to be sent to the LDAP
server.
Exception - If there is no distinguished name
public void modEntry(Entry entry,
SearchCriteria search)
throws Exception
modEntry in interface ConnectorInterfacemodEntry in class Connectorentry - An Entry populated with the values to modifysearch - The SearchCriteria
Exception - if an error occurs.modEntry(Entry, SearchCriteria, Entry)
public void modEntry(Entry entry,
SearchCriteria search,
Entry old)
throws Exception
modEntry in interface ConnectorInterfacemodEntry in class Connectorentry - An Entry containing the new values to be set in the LDAP
Serversearch - Only used if there is no $dn Attribute in entry.old - The old values, used to supply $dn if not present in Entry.
Exception - If no distinguished name can be found
public void setsubtreeDeleteSupported(boolean subtreeDeleteSupported)
throws Exception
subtreeDeleteSupported - If true, delete subtrees.
Exception
public void deleteEntry(Entry entry,
SearchCriteria search)
throws Exception
deleteEntry in interface ConnectorInterfacedeleteEntry in class Connectorentry - An Entry object containing the distinguished name of the entry
to delete.search - Used if the entry parameter is null, or does not contain a
distinguished name.
Exception - If no distinguished name can be found.
public Entry findEntry(SearchCriteria search)
throws Exception
findEntry in interface ConnectorInterfacefindEntry in class Connectorsearch - The SearchCriteria containing the values to match.
Exception - Any Exception thrown by the underlying librariespublic boolean isExceptionFatal(Exception e)
isExceptionFatal in interface ConnectorInterfaceisExceptionFatal in class Connectore - The Exception
public Entry entry2at(SearchResult sr)
sr - The SearchResult
public BasicAttributes at2entry(Entry entry,
boolean removeEmptyAttrs)
throws Exception
entry - The Entry to convert to BasicAttributesremoveEmptyAttrs - If true, do not include empty Attributes in the
BasicAttributes
Exception - If the userPassword Attribute is multivalued, and the Auto
Map AD Password parameter is set
public void moveEntry(String p1,
String p2)
throws Exception
p1 - The old distinguished namep2 - The new distinguished name
Exception - If the old entry could not be deleted
Exception - If the old entry could be deleted, but the new entry could
not be added
public boolean compare(String compdn,
String attname,
String attvalue)
throws Exception
compdn - String representing the DN for which to do a compareattname - String representing the name of the attribute to compare (left
side of ldap filter)attvalue - String representing the value of the attribute to compare
(right side of ldap filter)
Exception - when underlying compare funtion fails
public void addAttributeValue(String moddn,
String modattr,
String modval)
throws Exception
moddn - String representing the DN to which to add the attribute valuemodattr - String representing the name of the attribute to add a value
tomodval - String representing the value of the attribute add
Exception - when underlying modify operation fails
public void replaceAttributeValue(String moddn,
String modattr,
String modval)
throws Exception
moddn - String representing the DN to which to replace the attribute
valuemodattr - String representing the name of the attribute to replace the
value formodval - String representing the desired value for the attribute
Exception - when underlying modify operation fails
public void removeAttributeValue(String moddn,
String modattr,
String modval)
throws Exception
moddn - String representing the DN to which to remove the attribute
valuemodattr - String representing the name of the attribute to changemodval - String representing the value you wish to have removed from
the attribute
Exception - when underlying modify operation fails
public void removeAllAttributeValues(String moddn,
String modattr)
throws Exception
moddn - String representing the DN to which to remove the attribute
valuesmodattr - String representing the name of the attribute to remove all
values from
Exception - when underlying modify operation failspublic boolean flagSet(int flag)
flag - the flag we want to check for
public Object querySchema(Object source)
throws Exception
querySchema in interface ConnectorInterfacequerySchema in class Connectorsource - A distinguished name
Exception - Any Exception thrown by underlying librariesEntry,
Vector
public String getAttributeSyntax(DirContext schema,
String attributeName)
schema - A DirContextattributeName - Name of the attribute
public Vector<Object> queryObjectClassAttributes(String objectClass)
throws Exception
objectClass - The name of the objectclass
Exception - Any Exception thrown by the underlying librariespublic String mapAttributeSyntax(String oid)
oid - An oid
public Vector<Object> queryNamingContexts()
throws Exception
Exception - An exception is thrown if this method fails.
public Vector<Object> getServerControls()
throws Exception
Exception - An exception is thrown if this method fails.public Entry getServerInfo()
public boolean supportsControl(String oid)
oid - The Control oid
public boolean supportsExtension(String oid)
oid - The Extension oid
public boolean supportsPagedResults()
public boolean supportsSorting()
public boolean supportsVirtualListView()
public boolean supportsPersistantSearch()
public void showServerInfo()
public String getVersion()
getVersion in interface VersionInfoInterface
public Attribute setADPassword(Object password)
throws UnsupportedEncodingException
password - The new aDPassword value
UnsupportedEncodingException - An exception is thrown if the encoding required by Active
Directory is not supported on this platform.
public void rebind(String dn,
String password)
throws NamingException
dn - the distinguished name to rebind withpassword - the password for this distinguished name
NamingException - when underlying reconnect function fails
public void rebind(String dn,
String password,
String authMethod)
throws NamingException
dn - The DN used in the bind requestpassword - The password used in the bind requestauthMethod - The authentication method
NamingException - when underlying reconnect function failspublic boolean isDeltaSupported()
isDeltaSupported in interface ConnectorInterfaceisDeltaSupported in class Connectorpublic void callErrorHookOnAttributeInUseException(boolean errorHook)
errorHook - value to be setpublic boolean getCallErrorHook()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||