|
||||||||||
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(java.lang.String moddn,
java.lang.String modattr,
java.lang.String modval)
Adds a given value to an attribute. |
javax.naming.directory.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(java.lang.String compdn,
java.lang.String attname,
java.lang.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(javax.naming.directory.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 |
java.lang.String |
getAttributeSyntax(javax.naming.directory.DirContext schema,
java.lang.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. |
javax.naming.ldap.InitialLdapContext |
getLdapContext()
Returns the InitialLdapContext (Connection to the LDAP Server) |
Entry |
getNextEntry()
Get the next entry that was retrieved by selectEntries(). |
java.util.Vector<java.lang.Object> |
getServerControls()
Get the supported server Controls from the LDAP Server |
Entry |
getServerInfo()
Gets the serverInfo from the LDAP Server |
java.lang.String |
getVersion()
Version information. |
void |
initialize(java.lang.Object o)
Initialize the Connector, connect to the LDAP Server |
boolean |
isDeltaSupported()
This connector is able to perform delta updates |
boolean |
isExceptionFatal(java.lang.Exception e)
Utility method, that checks if an Exception thrown by underlying libraries is fatal |
java.lang.String |
mapAttributeSyntax(java.lang.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(java.lang.String p1,
java.lang.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. |
java.util.Vector<java.lang.Object> |
queryNamingContexts()
Query the LDAP Server for naming contexts |
java.util.Vector<java.lang.Object> |
queryObjectClassAttributes(java.lang.String objectClass)
Look up an objectclass in the LDAP Server. |
java.lang.Object |
querySchema(java.lang.Object source)
Query the schema of the LDAP server. |
void |
rebind(java.lang.String dn,
java.lang.String password)
Attempts to reauthenticate using the currently open connection. |
void |
rebind(java.lang.String dn,
java.lang.String password,
java.lang.String authMethod)
Attempts to reauthenticate using the currently open connection. |
void |
removeAllAttributeValues(java.lang.String moddn,
java.lang.String modattr)
removeAllAttributeValues: removes all values for a given attribute |
void |
removeAttributeValue(java.lang.String moddn,
java.lang.String modattr,
java.lang.String modval)
removeAttributeValue: removes a given attribute value from an entry |
void |
replaceAttributeValue(java.lang.String moddn,
java.lang.String modattr,
java.lang.String modval)
replaceAttributeValue: replaces a given attribute with a certain value |
void |
selectEntries()
Prepare the Connector for sequential read. |
javax.naming.directory.Attribute |
setADPassword(java.lang.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(java.lang.String oid)
Check if the LDAP Server supports a Control |
boolean |
supportsExtension(java.lang.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 ConnectorInterface
terminate
in class Connector
public javax.naming.ldap.InitialLdapContext getLdapContext()
public void initialize(java.lang.Object o) throws java.lang.Exception
initialize
in interface ConnectorInterface
initialize
in class Connector
o
- An Object sent to the initialize method, ignored.
java.lang.Exception
- Any Exception by the underlying methods to connect to the
LDAP Serverpublic void selectEntries() throws java.lang.Exception
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
java.lang.Exception
- Any Exception by the underlying librarypublic Entry getNextEntry() throws java.lang.Exception
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
java.lang.Exception
- Any Exception thrown by the underlying librariesConnectorInterface.selectEntries()
public Entry getCurrentEntry()
public void putEntry(Entry entry) throws java.lang.Exception
putEntry
in interface ConnectorInterface
putEntry
in class Connector
entry
- An Entry populated with values that are to be sent to the LDAP
server.
java.lang.Exception
- If there is no distinguished namepublic void modEntry(Entry entry, SearchCriteria search) throws java.lang.Exception
modEntry
in interface ConnectorInterface
modEntry
in class Connector
entry
- An Entry populated with the values to modifysearch
- The SearchCriteria
java.lang.Exception
- if an error occurs.modEntry(Entry, SearchCriteria, Entry)
public void modEntry(Entry entry, SearchCriteria search, Entry old) throws java.lang.Exception
modEntry
in interface ConnectorInterface
modEntry
in class Connector
entry
- 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.
java.lang.Exception
- If no distinguished name can be foundpublic void setsubtreeDeleteSupported(boolean subtreeDeleteSupported) throws java.lang.Exception
subtreeDeleteSupported
- If true, delete subtrees.
java.lang.Exception
public void deleteEntry(Entry entry, SearchCriteria search) throws java.lang.Exception
deleteEntry
in interface ConnectorInterface
deleteEntry
in class Connector
entry
- 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.
java.lang.Exception
- If no distinguished name can be found.public Entry findEntry(SearchCriteria search) throws java.lang.Exception
findEntry
in interface ConnectorInterface
findEntry
in class Connector
search
- The SearchCriteria containing the values to match.
java.lang.Exception
- Any Exception thrown by the underlying librariespublic boolean isExceptionFatal(java.lang.Exception e)
isExceptionFatal
in interface ConnectorInterface
isExceptionFatal
in class Connector
e
- The Exception
public Entry entry2at(javax.naming.directory.SearchResult sr)
sr
- The SearchResult
public javax.naming.directory.BasicAttributes at2entry(Entry entry, boolean removeEmptyAttrs) throws java.lang.Exception
entry
- The Entry to convert to BasicAttributesremoveEmptyAttrs
- If true, do not include empty Attributes in the
BasicAttributes
java.lang.Exception
- If the userPassword Attribute is multivalued, and the Auto
Map AD Password parameter is setpublic void moveEntry(java.lang.String p1, java.lang.String p2) throws java.lang.Exception
p1
- The old distinguished namep2
- The new distinguished name
java.lang.Exception
- If the old entry could not be deleted
java.lang.Exception
- If the old entry could be deleted, but the new entry could
not be addedpublic boolean compare(java.lang.String compdn, java.lang.String attname, java.lang.String attvalue) throws java.lang.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)
java.lang.Exception
- when underlying compare funtion failspublic void addAttributeValue(java.lang.String moddn, java.lang.String modattr, java.lang.String modval) throws java.lang.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
java.lang.Exception
- when underlying modify operation failspublic void replaceAttributeValue(java.lang.String moddn, java.lang.String modattr, java.lang.String modval) throws java.lang.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
java.lang.Exception
- when underlying modify operation failspublic void removeAttributeValue(java.lang.String moddn, java.lang.String modattr, java.lang.String modval) throws java.lang.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
java.lang.Exception
- when underlying modify operation failspublic void removeAllAttributeValues(java.lang.String moddn, java.lang.String modattr) throws java.lang.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
java.lang.Exception
- when underlying modify operation failspublic boolean flagSet(int flag)
flag
- the flag we want to check for
public java.lang.Object querySchema(java.lang.Object source) throws java.lang.Exception
querySchema
in interface ConnectorInterface
querySchema
in class Connector
source
- A distinguished name
java.lang.Exception
- Any Exception thrown by underlying librariesEntry
,
Vector
public java.lang.String getAttributeSyntax(javax.naming.directory.DirContext schema, java.lang.String attributeName)
schema
- A DirContextattributeName
- Name of the attribute
public java.util.Vector<java.lang.Object> queryObjectClassAttributes(java.lang.String objectClass) throws java.lang.Exception
objectClass
- The name of the objectclass
java.lang.Exception
- Any Exception thrown by the underlying librariespublic java.lang.String mapAttributeSyntax(java.lang.String oid)
oid
- An oid
public java.util.Vector<java.lang.Object> queryNamingContexts() throws java.lang.Exception
java.lang.Exception
- An exception is thrown if this method fails.public java.util.Vector<java.lang.Object> getServerControls() throws java.lang.Exception
java.lang.Exception
- An exception is thrown if this method fails.public Entry getServerInfo()
public boolean supportsControl(java.lang.String oid)
oid
- The Control oid
public boolean supportsExtension(java.lang.String oid)
oid
- The Extension oid
public boolean supportsPagedResults()
public boolean supportsSorting()
public boolean supportsVirtualListView()
public boolean supportsPersistantSearch()
public void showServerInfo()
public java.lang.String getVersion()
getVersion
in interface VersionInfoInterface
public javax.naming.directory.Attribute setADPassword(java.lang.Object password) throws java.io.UnsupportedEncodingException
password
- The new aDPassword value
java.io.UnsupportedEncodingException
- An exception is thrown if the encoding required by Active
Directory is not supported on this platform.public void rebind(java.lang.String dn, java.lang.String password) throws javax.naming.NamingException
dn
- the distinguished name to rebind withpassword
- the password for this distinguished name
javax.naming.NamingException
- when underlying reconnect function failspublic void rebind(java.lang.String dn, java.lang.String password, java.lang.String authMethod) throws javax.naming.NamingException
dn
- The DN used in the bind requestpassword
- The password used in the bind requestauthMethod
- The authentication method
javax.naming.NamingException
- when underlying reconnect function failspublic boolean isDeltaSupported()
isDeltaSupported
in interface ConnectorInterface
isDeltaSupported
in class Connector
public 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 |