|
IP*Works! V8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ipworks.Ldap
The LDAP bean is used to communicate with LDAP Directory Servers using the LDAP (Lightweight Directory Access) protocol.
The LDAP bean implements a standard LDAP client as specified in RFC 1777, 2251, and other LDAP RFCs. Support for both LDAP v2 and v3 is provided.
The first step in using the bean is specifying the ServerName ,
a DN (Distinguished Name) to bind as, and optionally a Password .
Then you can call one or more of the bean methods to act
upon the server. Server responses are normally received through the Result event. The only exception are search requests which result in
one or more SearchResult events, followed by a final SearchComplete event.
Attributes are set and returned through the Attributes collection. Other command arguments are specified
through other properties. These are specified in detail in each method.
Search filters are to be specified as string arguments to the Search method.
The format must be a standard LDAP search string as specified in
RFC 1558. Other search attributes are set in properties such as SearchScope , SearchTimeLimit , SearchSizeLimit , SearchReturnValues ,
and SearchDerefAliases .
The bean operates synchronously by default (waits for a response before
returning control to the caller), however, the bean may also operate
asynchronously (return control immediately), by setting Timeout to 0.
Please refer to the Timeout property for more information.
| Field Summary | |
static int |
sdaAlways
|
static int |
sdaFindingBaseObject
|
static int |
sdaInSearching
|
static int |
sdaNever
|
static int |
ssBaseObject
|
static int |
ssSingleLevel
|
static int |
ssWholeSubtree
|
| Constructor Summary | |
Ldap()
|
|
| Method Summary | |
void |
abandon(int messageId)
Ask the server to abandon a request. |
void |
add()
Add an entry specified by DN to the directory server using the type and value attributes defined in Attributes collection. |
void |
addLdapEventListener(ipworks.LdapEventListener l)
|
java.lang.String |
attr(java.lang.String attrType)
Returns the value of the specified ldap attribute. |
void |
bind()
Connect and bind to the directory server. |
void |
compare()
Compare attributes and values with those of the entry specified by DN . |
java.lang.String |
config(java.lang.String configurationString)
Sets or retrieves a beanconfiguration setting. |
void |
copyToDN(java.lang.String newSuperior)
Performs an LDAP 'modify' operation on the entry specified by DN by duplicating it. |
void |
delete()
Delete an entry specified by DN from the directory server. |
void |
doEvents()
Processes events from the internal message queue. |
void |
extendedRequest(java.lang.String requestName,
byte[] requestValue)
Perform an LDAP V3 Extended Operation. |
LDAPAttributeList |
getAttributes()
Attributes for the current entry. |
java.lang.String |
getDN()
The Distinguished Name used as the base for LDAP operations. |
ipworks.Firewall |
getFirewall()
A set of properties related to firewall access. |
int |
getLDAPVersion()
The version of LDAP used. |
java.lang.String |
getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
int |
getMessageId()
The message id for the next LDAP request. |
int |
getPageSize()
The maximum number of results per page for the Search method. |
java.lang.String |
getPassword()
The password used to authenticate to the LDAP server. |
LDAPReferenceList |
getReferences()
Collection of References returned from the server. |
int |
getResultCode()
The result code returned in the last server response. |
java.lang.String |
getResultDescription()
The descriptive text returned in the last server response (if any). |
java.lang.String |
getResultDN()
The Distinguished Name returned in the last server response (if any). |
int |
getSearchDerefAliases()
Controls alias dereferencing during searching. |
int |
getSearchScope()
Controls the scope of LDAP search operations. |
int |
getSearchSizeLimit()
Maximum number of entries that can be returned by the next search operation. |
int |
getSearchTimeLimit()
A time limit for the next search operation (in seconds). |
java.lang.String |
getServerName()
The name or address of the LDAP server. |
int |
getServerPort()
The server port for LDAP (default 389). |
java.lang.String |
getSortAttributes()
A string of attribute names to sort on with optional relative matching rules. |
int |
getTimeout()
A timeout for the bean. |
void |
interrupt()
Interrupt the current method. |
boolean |
isAcceptData()
Enables or disables data reception from the server. |
boolean |
isConnected()
Shows whether the bean is connected. |
boolean |
isDeleteOldRDN()
Controls whether the old RDN (Relative Distinguished Name) should be deleted. |
boolean |
isIdle()
The current status of the component. |
boolean |
isSearchReturnValues()
Controls whether the search operation returns values of attributes, or only types. |
void |
modify()
Perform an LDAP 'modify' operation on the entry specified by DN . |
void |
modifyRDN(java.lang.String newRDN)
Perform an LDAP 'modify RDN' operation an entry specified by DN . |
void |
moveToDN(java.lang.String newSuperior)
Performs an LDAP 'modify' operation on the entry specified by DN by changing its superior. |
void |
removeLdapEventListener(ipworks.LdapEventListener l)
|
void |
search(java.lang.String searchFilter)
Search the directory server using the base object specified in DN and the search filter SearchFilter . |
void |
setAcceptData(boolean acceptData)
Enables or disables data reception from the server. |
void |
setAttributes(LDAPAttributeList attributes)
Attributes for the current entry. |
void |
setConnected(boolean connected)
Shows whether the bean is connected. |
void |
setDeleteOldRDN(boolean deleteOldRDN)
Controls whether the old RDN (Relative Distinguished Name) should be deleted. |
void |
setDN(java.lang.String DN)
The Distinguished Name used as the base for LDAP operations. |
void |
setFirewall(ipworks.Firewall firewall)
A set of properties related to firewall access. |
void |
setLDAPVersion(int LDAPVersion)
The version of LDAP used. |
void |
setLocalHost(java.lang.String localHost)
The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
void |
setMessageId(int messageId)
The message id for the next LDAP request. |
void |
setPageSize(int pageSize)
The maximum number of results per page for the Search method. |
void |
setPassword(java.lang.String password)
The password used to authenticate to the LDAP server. |
void |
setSearchDerefAliases(int searchDerefAliases)
Controls alias dereferencing during searching. |
void |
setSearchReturnValues(boolean searchReturnValues)
Controls whether the search operation returns values of attributes, or only types. |
void |
setSearchScope(int searchScope)
Controls the scope of LDAP search operations. |
void |
setSearchSizeLimit(int searchSizeLimit)
Maximum number of entries that can be returned by the next search operation. |
void |
setSearchTimeLimit(int searchTimeLimit)
A time limit for the next search operation (in seconds). |
void |
setServerName(java.lang.String serverName)
The name or address of the LDAP server. |
void |
setServerPort(int serverPort)
The server port for LDAP (default 389). |
void |
setSortAttributes(java.lang.String sortAttributes)
A string of attribute names to sort on with optional relative matching rules. |
void |
setTimeout(int timeout)
A timeout for the bean. |
void |
unbind()
Search the directory server using the base object specified in DN and the search filter SearchFilter . |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int sdaNever
public static final int sdaInSearching
public static final int sdaFindingBaseObject
public static final int sdaAlways
public static final int ssBaseObject
public static final int ssSingleLevel
public static final int ssWholeSubtree
| Constructor Detail |
public Ldap()
| Method Detail |
public boolean isAcceptData()
Setting the property to False, temporarily disables data reception. Setting the property to True, reenables data reception.
public void setAcceptData(boolean acceptData)
throws IPWorksException
Setting the property to False, temporarily disables data reception. Setting the property to True, reenables data reception.
IPWorksExceptionpublic LDAPAttributeList getAttributes()
This is a collection of all of the attributes
for the current entry. Each attributes details are found in
the fields of the LDAPATTRIBUTE type.
After a Search , this property will be populated with the attributes of each search results and can be read
within the SearchResult event (one event for each resulting DN).
During an LDAP Modify operation, this property
describes the modifications that are to be made
to the attributes. You may specify the attribute,
the new value, and the operation to be executed
by the server in this property.
This collection is indexed from 0 to Count - 1.
public void setAttributes(LDAPAttributeList attributes)
throws IPWorksException
This is a collection of all of the attributes
for the current entry. Each attributes details are found in
the fields of the LDAPATTRIBUTE type.
After a Search , this property will be populated with the attributes of each search results and can be read
within the SearchResult event (one event for each resulting DN).
During an LDAP Modify operation, this property
describes the modifications that are to be made
to the attributes. You may specify the attribute,
the new value, and the operation to be executed
by the server in this property.
This collection is indexed from 0 to Count - 1.
IPWorksExceptionpublic boolean isConnected()
Use this property to determine whether the bean is connected to the remote host or not.
public void setConnected(boolean connected)
throws IPWorksException
Use this property to determine whether the bean is connected to the remote host or not.
IPWorksExceptionpublic boolean isDeleteOldRDN()
Used when ModifyRDN is called. The default value is True, which instructs
the server to delete the old RDN.
public void setDeleteOldRDN(boolean deleteOldRDN)
throws IPWorksException
Used when ModifyRDN is called. The default value is True, which instructs
the server to delete the old RDN.
IPWorksExceptionpublic java.lang.String getDN()
Also the base object during LDAP searches.
The Distinguished Name is provided in string format as specified by RFC 1779. Example (Setting DN)
LDAPControl.DN = "uid=TThompson,ou=Employees,dc=server"
LDAPControl.DN = "Domain/Username"
public void setDN(java.lang.String DN)
throws IPWorksException
Also the base object during LDAP searches.
The Distinguished Name is provided in string format as specified by RFC 1779. Example (Setting DN)
LDAPControl.DN = "uid=TThompson,ou=Employees,dc=server"
LDAPControl.DN = "Domain/Username"
IPWorksExceptionpublic ipworks.Firewall getFirewall()
This is a FIREWALL type property which
contains fields describing the firewall
through which the bean will attempt to connect.
public void setFirewall(ipworks.Firewall firewall)
throws IPWorksException
This is a FIREWALL type property which
contains fields describing the firewall
through which the bean will attempt to connect.
IPWorksExceptionpublic boolean isIdle()
Idle will be False if the component is currently busy (communicating
and/or waiting for an answer), and True at all other times.
public int getLDAPVersion()
The default value is 2 (for LDAPv2).
public void setLDAPVersion(int LDAPVersion)
throws IPWorksException
The default value is 2 (for LDAPv2).
IPWorksExceptionpublic java.lang.String getLocalHost()
The LocalHost property contains the name of the local host
as obtained by the gethostname() system call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.
If the bean is connected, the LocalHost property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost is not persistent. You must always set it in
code, and never in the property window.
public void setLocalHost(java.lang.String localHost)
throws IPWorksException
The LocalHost property contains the name of the local host
as obtained by the gethostname() system call, or if the
user has assigned an IP address, the value of that address.
In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.
If the bean is connected, the LocalHost property shows
the IP address of the interface through which the connection
is made in internet dotted format (aaa.bbb.ccc.ddd). In most
cases, this is the address of the local host, except for multihomed
hosts (machines with more than one IP interface).
NOTE: LocalHost is not persistent. You must always set it in
code, and never in the property window.
IPWorksExceptionpublic int getMessageId()
If a custom value is needed for MessageId , the property must be set
before calling any other methods. The bean increments MessageId automatically after each request.
public void setMessageId(int messageId)
throws IPWorksException
If a custom value is needed for MessageId , the property must be set
before calling any other methods. The bean increments MessageId automatically after each request.
IPWorksExceptionpublic int getPageSize()
Search method.
The default value is 0 (no paging). If set to a value greater than zero, results
will be paged, i.e. returned in blocks of maximum PageSize results.
For each page sent by the server, a SearchPage event will fire. you may
decide to cancel or continue displaying results from within this event.
Note: LDAP paging functionality is described by LDAP extension RFCs and may or may not be implemented by the LDAP server being accessed.
public void setPageSize(int pageSize)
throws IPWorksException
Search method.
The default value is 0 (no paging). If set to a value greater than zero, results
will be paged, i.e. returned in blocks of maximum PageSize results.
For each page sent by the server, a SearchPage event will fire. you may
decide to cancel or continue displaying results from within this event.
Note: LDAP paging functionality is described by LDAP extension RFCs and may or may not be implemented by the LDAP server being accessed.
IPWorksExceptionpublic java.lang.String getPassword()
Leave this value empty if no password is required.
public void setPassword(java.lang.String password)
throws IPWorksException
Leave this value empty if no password is required.
IPWorksExceptionpublic LDAPReferenceList getReferences()
References will be SearchResult references if inside
a SearchResult or SearchResultReference event
in which case they represent URLs to contact to continue
the search. References will be regular Result references
if inside the Result event or SearchComplete event in which case they represent the URLs to contact
in order to complete the requested operation.
This collection is indexed from 0 to Count - 1.
public int getResultCode()
This is identical to the corresponding parameter provided by the last Result , SearchResult , or SearchComplete event.
Possible result codes are:
All the result codes with the exception of success, compareFalse and compareTrue are to be treated as meaning the operation could not be completed in its entirety. Result codes from 16 to 21 indicate an AttributeProblem, codes 32, 33, 34 and 36 indicate a NameProblem, codes 48, 49 and 50 indicate a SecurityProblem, codes 51 to 54 indicate a ServiceProblem, and codes 64 to 69 and 71 indicate an UpdateProblem.
public java.lang.String getResultDescription()
This is identical to the corresponding parameter provided by the last Result , SearchResult , or SearchComplete event.
public java.lang.String getResultDN()
This is identical to the corresponding parameter provided by the last Result , SearchResult , or SearchComplete event.
public int getSearchDerefAliases()
Possible values are:
Default is to never dereference aliases.
public void setSearchDerefAliases(int searchDerefAliases)
throws IPWorksException
Possible values are:
Default is to never dereference aliases.
IPWorksExceptionpublic boolean isSearchReturnValues()
If only attributes are needed, disabling returning of values will enhance performance.
public void setSearchReturnValues(boolean searchReturnValues)
throws IPWorksException
If only attributes are needed, disabling returning of values will enhance performance.
IPWorksExceptionpublic int getSearchScope()
Possible values are:
Default is to search the whole subtree.
public void setSearchScope(int searchScope)
throws IPWorksException
Possible values are:
Default is to search the whole subtree.
IPWorksExceptionpublic int getSearchSizeLimit()
This limit is provided as a hint to the directory server. A value of 0 means that no size limits are in effect for the search.
public void setSearchSizeLimit(int searchSizeLimit)
throws IPWorksException
This limit is provided as a hint to the directory server. A value of 0 means that no size limits are in effect for the search.
IPWorksExceptionpublic int getSearchTimeLimit()
This limit is provided as a hint to the directory server. A value of 0 means that no time limits are in effect for the search.
public void setSearchTimeLimit(int searchTimeLimit)
throws IPWorksException
This limit is provided as a hint to the directory server. A value of 0 means that no time limits are in effect for the search.
IPWorksExceptionpublic java.lang.String getServerName()
The ServerName property specifies the IP address (IP number in
dotted internet format) or Domain Name of the directory server.
It is set before a connection is attempted and cannot be changed
once a connection is in progress.
If the ServerName property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the ServerName property is set to the corresponding address. If the
search is not successful, an error is returned.
public void setServerName(java.lang.String serverName)
throws IPWorksException
The ServerName property specifies the IP address (IP number in
dotted internet format) or Domain Name of the directory server.
It is set before a connection is attempted and cannot be changed
once a connection is in progress.
If the ServerName property is set to a Domain Name, a DNS request
is initiated and upon successful termination of the request, the ServerName property is set to the corresponding address. If the
search is not successful, an error is returned.
IPWorksExceptionpublic int getServerPort()
A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.
public void setServerPort(int serverPort)
throws IPWorksException
A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.
IPWorksExceptionpublic java.lang.String getSortAttributes()
When set prior to a Search , entries returned by the server will be sorted according to SortAttributes .
The format consists of one or more attribute names separated by spaces. Each attribute
may be followed by an optional matching rule.
If matching rules are defined, they should be separated from the attribute names with a "/".
Normally the values are returned in ascending order. If descending (reverse) order of sorting is desired, the attribute type must be preceeded with a "-".
Examples:
LDAPControl.SortAttributes = "loginTime"
LDAPControl.SortAttributes = "name/caseIgnoreSubstringsMatch age/numericStringSubstringsMatch"
LDAPControl.SortAttributes = "cn age/1.3.6.1.4.1.1466.115.121.1.27"
LDAPControl.SortAttributes = "-cn age/1.3.6.1.4.1.1466.115.121.1.27" Matching Rules for Equality Filters
public void setSortAttributes(java.lang.String sortAttributes)
throws IPWorksException
When set prior to a Search , entries returned by the server will be sorted according to SortAttributes .
The format consists of one or more attribute names separated by spaces. Each attribute
may be followed by an optional matching rule.
If matching rules are defined, they should be separated from the attribute names with a "/".
Normally the values are returned in ascending order. If descending (reverse) order of sorting is desired, the attribute type must be preceeded with a "-".
Examples:
LDAPControl.SortAttributes = "loginTime"
LDAPControl.SortAttributes = "name/caseIgnoreSubstringsMatch age/numericStringSubstringsMatch"
LDAPControl.SortAttributes = "cn age/1.3.6.1.4.1.1466.115.121.1.27"
LDAPControl.SortAttributes = "-cn age/1.3.6.1.4.1.1466.115.121.1.27" Matching Rules for Equality Filters
IPWorksExceptionpublic int getTimeout()
If the Timeout property is set to 0, all operations return
immediately, potentially failing with an error if they can't be
completed immediately.
If Timeout is set to a positive value, the bean will
wait for the operation to complete before returning control.
The bean will use DoEvents to enter an efficient wait loop
during any potential waiting period, making sure that all system events
are processed immediately as they arrive. This ensures that the host
application does not "freeze" and remains responsive.
If Timeout expires, and the operation is not yet complete,
the bean throws an IPWorksException
raises an IPWorksException exception
.
Please note that by default, all timeouts are inactivity timeouts ,
i.e. the timeout period is extended by Timeout seconds when
data is successfully sent or received.
Optionally, the behaviour of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum
of Timeout seconds since the beginning of the operation, without
extending the timeout period during communications.
This behavior is controlled by theAbsoluteTimeoutconfiguration setting.
The default value for the Timeout property is 60 seconds.
public void setTimeout(int timeout)
throws IPWorksException
If the Timeout property is set to 0, all operations return
immediately, potentially failing with an error if they can't be
completed immediately.
If Timeout is set to a positive value, the bean will
wait for the operation to complete before returning control.
The bean will use DoEvents to enter an efficient wait loop
during any potential waiting period, making sure that all system events
are processed immediately as they arrive. This ensures that the host
application does not "freeze" and remains responsive.
If Timeout expires, and the operation is not yet complete,
the bean throws an IPWorksException
raises an IPWorksException exception
.
Please note that by default, all timeouts are inactivity timeouts ,
i.e. the timeout period is extended by Timeout seconds when
data is successfully sent or received.
Optionally, the behaviour of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum
of Timeout seconds since the beginning of the operation, without
extending the timeout period during communications.
This behavior is controlled by theAbsoluteTimeoutconfiguration setting.
The default value for the Timeout property is 60 seconds.
IPWorksException
public void abandon(int messageId)
throws IPWorksException
Ask the server to abandon the request specified by MessageId .
The result of the operation is returned via the Result event.
IPWorksException
public void add()
throws IPWorksException
DN to the directory server using the type and value attributes defined in Attributes collection. All Entries are required to have an objectClass attribute.
Add the entry specified by DN to the directory.
The result of the operation is returned via the Result event.
Example (Add a New Entry)
LDAPControl.DN = "uid=NewUser,ou=Employees,dc=server"
LDAPControl.Attributes.Add(new LDAPAttribute("objectClass", "top"))
LDAPControl.Attributes.Add(new LDAPAttribute("objectClass", "person"))
LDAPControl.Attributes.Add(new LDAPAttribute("objectClass", "organizationalPerson"))
LDAPControl.Attributes.Add(new LDAPAttribute("objectClass", "inetorgperson"))
LDAPControl.Attributes.Add(new LDAPAttribute("sn", "UserName"))
LDAPControl.Attributes.Add(new LDAPAttribute("cn", "New S. UserName"))
LDAPControl.Attributes.Add(new LDAPAttribute("uid", "NewUser"))
LDAPControl.Add()
IPWorksException
public java.lang.String attr(java.lang.String attrType)
throws IPWorksException
If the attribute does not exist, an empty string is returned.
Please refer to the Attributes collection for more information.
IPWorksException
public void bind()
throws IPWorksException
Connect and bind to the directory server. If the Password property has a value, it is used for authentication. If not, the Bind is performed
anonymously.
The result of the operation is returned via the Result event.
Example (Binding)
LDAPControl.DN = "uid=TThompson,ou=Employees,dc=server"
LDAPControl.Password = "mypassword"
LDAPControl.Bind()
LDAPControl.DN = "Domain/Username"
LDAPControl.Password = "mypassword"
LDAPControl.Bind()
IPWorksException
public void compare()
throws IPWorksException
DN .
Compare attributes types and values specified via the Attributes collection,
with the values in the directory for the entry specified by DN .
The result of the operation is returned via the Result event.
IPWorksException
public java.lang.String config(java.lang.String configurationString)
throws IPWorksException
Config is a generic method available in every bean.
It is used to set and retrieveconfiguration settingsfor the
bean.
Configuration settings are similar in functionality to properties,
but they are rarely used. In order to avoid "polluting" the property
namespace of the bean, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.
IPWorksException
public void copyToDN(java.lang.String newSuperior)
throws IPWorksException
DN by duplicating it.
Performs an LDAP 'modify' operation on the entry specified by DN by duplicating it and
changing the superior of the new entry to the new superior. All other entrie's attributes
will copied unchanged. DeleteOldRDN property will be automatically set to false to prevent
deletion of the current entry.
The result of the operation is returned via the Result event.
IPWorksException
public void delete()
throws IPWorksException
DN from the directory server.
Delete the entry specified by DN from the directory.
The result of the operation is returned via the Result event.
IPWorksException
public void doEvents()
throws IPWorksException
When DoEvents is called, the bean processes any
available events. If no events are available, it waits for a
preset period of time, and then returns.
IPWorksException
public void extendedRequest(java.lang.String requestName,
byte[] requestValue)
throws IPWorksException
RequestName must contain the OID of the operation, and RequestValue may contain an optional value.
IPWorksException
public void interrupt()
throws IPWorksException
If there is no method in progress, Interrupt simply returns doing nothing.
IPWorksException
public void modify()
throws IPWorksException
DN .
Perform an LDAP 'modify' operation on the entry specified by DN . The attribute(s) to
modify should be set via the Attributes collection.
The modification can be a replacement, an addition (for multivalued attributes), and deletion.
The result of the operation is returned via the Result event.
Example (Modify an Entry - Replace an Attribute Value)
LDAPControl.DN = "uid=TThompson,ou=Employees,dc=server"
LDAPControl.AttrCount = 1
LDAPControl.AttrType(0) = "description"
LDAPControl.AttrValue(0) = "changed"
LDAPControl.AttrModOp(0) = amoReplace
LDAPControl.Modify()
IPWorksException
public void modifyRDN(java.lang.String newRDN)
throws IPWorksException
DN .
Perform an LDAP 'modify RDN' operation on the entry specified by DN .
NewRDN is the new RDN for the entry specified by DN
The result of the operation is returned via the Result event.
IPWorksException
public void moveToDN(java.lang.String newSuperior)
throws IPWorksException
DN by changing its superior.
Performs an LDAP 'modify' operation on the entry specified by DN by changing its superior.
None of the entry's attributes will change. DeleteOldRDN property will
be set to true to delete the old entry.
The result of the operation is returned via the Result event.
IPWorksException
public void search(java.lang.String searchFilter)
throws IPWorksException
DN and the search filter SearchFilter .
Search the directory server using the base object specified
in the DN and the search filter specified in the SearchFilter parameter. Additional search parameters are specified through the SearchScope , SearchDerefAliases , SearchSizeLimit , SearchTimeLimit ,
and SearchReturnValues properties.
Results are returned through
zero or more SearchResult events, after which a SearchComplete event is fired.
Example (Searching for a User)
LDAPControl.DN = "ou=Employees,dc=server"
LDAPControl.Search("uid=TThompson")
A DSE Search (Directory Specific Entries) will search for attributes of the server itself. Example (DSE Search)
LDAPControl.DN = ""
LDAPControl.SearchScope = 0
LDAPControl.Search("objectClass=*")
SearchFilter is a string representation of the LDAP search filter used for the search.
The format of the search filter is specified by RFC 1558 and is identical to the format used by most LDAP applications.
The following are examples of search filters, as provided in the RFC:
(cn=Babs Jensen)
(!(cn=Tim Howes))
(&(objectClass=Person)(|(sn=Jensen)(cn=Babs J*)))
(o=univ*of*mich*)
The complete specification is given by the following BNF:
<filter> ::= "(" <filtercomp> ")"
<filtercomp> ::= <and> | <or> | <not> | <item>
<and> ::= "&" <filterlist>
<or> ::= "|" <filterlist>
<not> ::= "!" <filter>
<filterlist> ::= <filter> | <filter> <filterlist>
<item> ::= <simple> | <present> | <substring>
<simple> ::= <attr> <filtertype> <value>
<filtertype> ::= <equal> | <approx> | <greater> | <less>
<equal> ::= "="
<approx> ::= "~="
<greater> ::= ">="
<less> ::= "<="
<present> ::= <attr> "=*"
<substring> ::= <attr> "=" <initial> <any> <final>
<initial> ::= NULL | <value>
<any> ::= "*" <starval>
<starval> ::= NULL | <value> "*" <starval>
<final> ::= NULL | <value>
<attr> is a string representing an attribute type as defined in RFC 1777. <value> is a string representing an attribute value, or part of one, and has the form defined in RFC 1779. If a <value> must contain one of the characters '*' or '(' or ')', these should be escaped by preceding them with the backslash '\\' character.
IPWorksException
public void unbind()
throws IPWorksException
DN and the search filter SearchFilter .
Search the directory server using the base object specified
in the DN and the search filter specified in the SearchFilter parameter. Additional search parameters are specified through the SearchScope , SearchDerefAliases , SearchSizeLimit , SearchTimeLimit ,
and SearchReturnValues properties.
Results are returned through
zero or more SearchResult events, after which a SearchComplete event is fired.
IPWorksException
public void addLdapEventListener(ipworks.LdapEventListener l)
throws java.util.TooManyListenersException
java.util.TooManyListenersExceptionpublic void removeLdapEventListener(ipworks.LdapEventListener l)
|
IP*Works! V8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||