LDAP Classes
Implements Java LDAP

com.novell.ldap
Class LDAPMessageQueue

java.lang.Object
  extended bycom.novell.ldap.LDAPMessageQueue
Direct Known Subclasses:
LDAPResponseQueue, LDAPSearchQueue

public abstract class LDAPMessageQueue
extends java.lang.Object

Represents a queue of incoming asynchronous messages from the server. It is the common interface for LDAPResponseQueue and LDAPSearchQueue.


Method Summary
 int[] getMessageIDs()
          Returns the message IDs for all outstanding requests.
 LDAPMessage getResponse()
          Returns the response from an LDAP request.
 LDAPMessage getResponse(int msgid)
          Returns the response from an LDAP request for a particular message ID.
 boolean isComplete(int msgid)
          Reports true if all results have been received for a particular message id.
 boolean isResponseReceived()
          Reports true if any response has been received from the server and not yet retrieved with getResponse.
 boolean isResponseReceived(int msgid)
          Reports true if a response has been received from the server for a particular message ID but not yet retrieved with getResponse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessageIDs

public int[] getMessageIDs()
Returns the message IDs for all outstanding requests. These are requests for which a response has not been received from the server or which still have messages to be retrieved with getResponse.

The last ID in the array is the messageID of the last submitted request.

Returns:
The message IDs for all outstanding requests.

getResponse

public LDAPMessage getResponse()
                        throws LDAPException
Returns the response from an LDAP request.

The getResponse method blocks until a response is available, or until all operations associated with the object have completed or been canceled, and then returns the response.

The application is responsible to determine the type of message returned.

Returns:
The response.
Throws:
LDAPException - A general exception which includes an error message and an LDAP error code.
See Also:
LDAPResponse, LDAPSearchResult, LDAPSearchResultReference

getResponse

public LDAPMessage getResponse(int msgid)
                        throws LDAPException
Returns the response from an LDAP request for a particular message ID.

The getResponse method blocks until a response is available for a particular message ID, or until all operations associated with the object have completed or been canceled, and then returns the response. If there is no outstanding operation for the message ID (or if it is zero or a negative number), IllegalArgumentException is thrown.

The application is responsible to determine the type of message returned.

Parameters:
msgid - query for responses for a specific message request
Returns:
The response from the server.
Throws:
LDAPException - A general exception which includes an error message and an LDAP error code.
See Also:
LDAPResponse, LDAPSearchResult, LDAPSearchResultReference

isResponseReceived

public boolean isResponseReceived()
Reports true if any response has been received from the server and not yet retrieved with getResponse. If getResponse has been used to retrieve all messages received to this point, then isResponseReceived returns false.

Returns:
true if a response is available to be retrieved via getResponse, otherwise false.
See Also:
getResponse()

isResponseReceived

public boolean isResponseReceived(int msgid)
Reports true if a response has been received from the server for a particular message ID but not yet retrieved with getResponse. If there is no outstanding operation for the message ID (or if it is zero or a negative number), IllegalArgumentException is thrown.

Parameters:
msgid - A particular message ID to query for available responses.
Returns:
true if a response is available to be retrieved via getResponse for the specified message ID, otherwise false.
See Also:
getResponse(int)

isComplete

public boolean isComplete(int msgid)
Reports true if all results have been received for a particular message id.

If the search result done has been received from the server for the message id, it reports true. There may still be messages waiting to be retrieved by the applcation with getResponse.

Throws:
java.lang.IllegalArgumentException - if there is no outstanding operation for the message ID,

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000