|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cisco.ipphone.sdk.LDAPProvider
public class LDAPProvider
The LDAPProvider implements the LDAPProviderIF and provides a simple
Java "wrapper" around a generic LDAP directory. This class handles the formatting and communication
of LDAP query commands and provides basic LDAP attribute parsing.
LDAPProviderIF| Constructor Summary | |
|---|---|
LDAPProvider(java.lang.String ldapServer,
java.lang.String ldapUserId,
java.lang.String ldapPassword,
int ldapPort,
java.lang.String rootDn)
This is the only constructor provided for the LDAPProvider class and
all parameters must be supplied. |
|
| Method Summary | |
|---|---|
java.lang.String[] |
getAttributeNames(int index)
|
java.lang.String |
getAttributeValue(java.lang.String attrName)
This method searches the previous LDAP sendReqest result looking for the
first child node with the specified LDAP attribute and returns the value (the first value
if multiple values exist) of that attribute. |
java.lang.String[] |
getAttributeValues(java.lang.String attrName)
This method searches the previous LDAP sendReqest result looking for the
first child node with the specified LDAP attribute and returns the values of that attribute. |
static void |
main(java.lang.String[] args)
This main() method is for testing purposes only. |
java.util.Vector |
sendRequest(java.lang.String searchBase,
java.util.HashMap matchRules,
boolean ignoreCase,
java.lang.String[] returnAttrs)
This method performs an LDAP query based on the specified parameters and returns the result as a Vector of HashMaps. |
java.util.Vector |
sendRequest(java.lang.String searchBase,
java.lang.String filter,
boolean ignoreCase,
java.lang.String[] returnAttrs)
This method performs an LDAP query based on the specified parameters and returns the result as a Vector of HashMaps. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LDAPProvider(java.lang.String ldapServer,
java.lang.String ldapUserId,
java.lang.String ldapPassword,
int ldapPort,
java.lang.String rootDn)
LDAPProvider class and
all parameters must be supplied. The parameters can be modified after instantiation, if
needed, by direct access to the public attributes.
ldapServer - The IP address or hostname of the LDAP server to be queriedldapUserId - The UserId used to authenticate to the LDAP serverldapPassword - The password of the above UserIdldapPort - The TCP port number used by the LDAP server (Example: 8404 for CallManager's integrated LDAP directory)| Method Detail |
|---|
public java.lang.String getAttributeValue(java.lang.String attrName)
sendReqest result looking for the
first child node with the specified LDAP attribute and returns the value (the first value
if multiple values exist) of that attribute.
The sendReqest MUST always be called first to populate the search result - otherwise
this method will always return null.
getAttributeValue in interface LDAPProviderIFattrName - The String name of the desired attribute (Example: telephoneNumber);
null will be returned.public java.lang.String[] getAttributeValues(java.lang.String attrName)
sendReqest result looking for the
first child node with the specified LDAP attribute and returns the values of that attribute.
The sendReqest MUST always be called first to populate the search result - otherwise
this method will always return null.
getAttributeValues in interface LDAPProviderIFattrName - The String name of the desired attribute (Example: ciscoCCNatControlDevices);
null will be returned.public java.lang.String[] getAttributeNames(int index)
public java.util.Vector sendRequest(java.lang.String searchBase,
java.util.HashMap matchRules,
boolean ignoreCase,
java.lang.String[] returnAttrs)
LDAPProvider object for
subsequent getAttributeValue requests - those methods provide a simple method of extracting
attribute values without the need to parse the Vector of HashMaps returned by this method.
sendRequest in interface LDAPProviderIFsearchBase - The LDAP Search Base to be used for this search (Example: ou=Users)matchRules - A HashMap containing attribute String names (the HashMap keys) and their String values. These filters limit the search results to only those nodes which match the specified criteria. A value of null will specify that no filtering is applied.
(Example: sn=Stearns, givenName=Kelly)ignoreCase - boolean value indicating whether or not the search should be case-sensitive. If true, the search ignores case.returnAttrs - an Array of Strings indicating which attributes should be returned in the result. A value of null will specify ALL attributes.
(Example: sn, givenName, telephoneNumber)
User class in this SDK
for an example of how to extract information from this result.User
public java.util.Vector sendRequest(java.lang.String searchBase,
java.lang.String filter,
boolean ignoreCase,
java.lang.String[] returnAttrs)
LDAPProvider object for
subsequent getAttributeValue requests - those methods provide a simple method of extracting
attribute values without the need to parse the Vector of HashMaps returned by this method.
sendRequest in interface LDAPProviderIFsearchBase - The LDAP Search Base to be used for this search (Example: ou=Users)filter - An LDAP filter String containing attributes to match. For example: (sn=Stearns*)ignoreCase - boolean value indicating whether or not the search should be case-sensitive. If true, the search ignores case.returnAttrs - an Array of Strings indicating which attributes should be returned in the result. A value of null will specify ALL attributes.
(Example: sn, givenName, telephoneNumber)
User class in this SDK
for an example of how to extract information from this result.Userpublic static void main(java.lang.String[] args)
args - String[]
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||