|
LDAPJDK 4.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--netscape.ldap.LDAPMessageQueue | +--netscape.ldap.LDAPSearchListener
Manages search results, references and responses returned on one or more search requests
Method Summary | |
int[] |
getMessageIDs()
Returns message IDs for all outstanding requests |
LDAPMessage |
getResponse()
Blocks until a search result, reference or response is available, or until all operations associated with the object have completed or been canceled. |
boolean |
isResponseReceived()
Reports true if a response has been received from the server. |
void |
merge(LDAPSearchListener listener2)
Merge two response listeners. |
Methods inherited from class netscape.ldap.LDAPMessageQueue |
getMessageCount,
getRequestCount,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Method Detail |
public LDAPMessage getResponse() throws LDAPException
LDAPResponse
,
LDAPSearchResult
,
LDAPSearchResultReference
public void merge(LDAPSearchListener listener2)
To be used for synchronization of asynchronous LDAP operations where requests are sent by one thread but processed by another one.
A client may be implemented in such a way that one thread makes LDAP requests and calls l.getMessageIDs(), while another thread is responsible for processing of responses (call l.getResponse()). Both threads are using the same listener objects. In such a case, a race condition may occur, where a LDAP response message is retrieved and the request terminated (request ID removed) before the first thread has a chance to execute l.getMessageIDs(). The proper way to handle this scenario is to create a separate listener for each new request, and after l.getMessageIDs() has been invoked, merge the new request with the existing one.
listener2
- the listener with which to mergepublic boolean isResponseReceived()
public int[] getMessageIDs()
|
LDAPJDK 4.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |