|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.LDAPSearchResults
public class LDAPSearchResults
An LDAPSearchResults object is returned from a synchronous search operation. It provides access to all results received during the operation (entries and exceptions).
Sample Code: Search.java
LDAPConnection.search(java.lang.String, int, java.lang.String, java.lang.String[], boolean)
,
Serialized FormField Summary | |
---|---|
private int |
batchSize
|
private boolean |
completed
|
private LDAPConnection |
conn
|
private LDAPSearchConstraints |
cons
|
private LDAPControl[] |
controls
|
private java.util.Vector |
entries
|
private int |
entryCount
|
private int |
entryIndex
|
private java.lang.String |
name
|
private static java.lang.Object |
nameLock
|
private LDAPSearchQueue |
queue
|
private int |
referenceCount
|
private int |
referenceIndex
|
private java.util.Vector |
references
|
private java.util.ArrayList |
referralConn
|
private static int |
resultsNum
|
Constructor Summary | |
---|---|
LDAPSearchResults()
This constructor was added to support default Serialization |
|
LDAPSearchResults(LDAPConnection conn,
LDAPSearchQueue queue,
LDAPSearchConstraints cons)
Constructs a queue object for search results. |
Method Summary | |
---|---|
(package private) void |
abandon()
Cancels the search request and clears the message and enumeration. |
private boolean |
getBatchOfResults()
Collects batchSize elements from an LDAPSearchQueue message queue and places them in a Vector. |
int |
getCount()
Returns a count of the items in the search result. |
LDAPControl[] |
getDeSerializedControls()
Returns LDAP Server Controls after De-serialization |
java.util.Vector |
getDeSerializedEntries()
Returns LDAP Entries after De-serialization |
LDAPControl[] |
getResponseControls()
Returns the latest server controls returned by the server in the context of this search request, or null if no server controls were returned. |
private static LDAPXMLHandler |
getTopXMLHandler(java.lang.String tagname,
LDAPXMLHandler parenthandler)
|
(package private) static LDAPXMLHandler |
getXMLControlHandler(java.lang.String tagname,
LDAPXMLHandler parenthandler)
This method return the LDAPHandler which handles the XML (DSML) tags for returned Server controls of this class |
(package private) static LDAPXMLHandler |
getXMLEntryHandler(java.lang.String tagname,
LDAPXMLHandler parenthandler)
This method return the LDAPHandler which handles the XML (DSML) tags for returned LDAPEntries of this class |
boolean |
hasMore()
Reports if there are more search results. |
LDAPEntry |
next()
Returns the next result as an LDAPEntry. |
static java.lang.Object |
readDSML(java.io.InputStream input)
This method is used to deserialize the DSML encoded representation of this class. |
void |
readExternal(java.io.ObjectInput in)
Reads the serialized object from the underlying input stream. |
private void |
resetVectors()
|
private void |
writeAttribute(LDAPAttribute attr,
java.lang.StringBuffer buff)
|
private void |
writeControl(LDAPControl control,
java.lang.StringBuffer buff)
|
void |
writeExternal(java.io.ObjectOutput out)
Writes the object state to a stream in XML format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector entries
private int entryCount
private int entryIndex
private java.util.Vector references
private int referenceCount
private int referenceIndex
private int batchSize
private boolean completed
private LDAPControl[] controls
private LDAPSearchQueue queue
private static java.lang.Object nameLock
private static int resultsNum
private java.lang.String name
private LDAPConnection conn
private LDAPSearchConstraints cons
private java.util.ArrayList referralConn
Constructor Detail |
---|
public LDAPSearchResults()
LDAPSearchResults(LDAPConnection conn, LDAPSearchQueue queue, LDAPSearchConstraints cons)
conn
- The LDAPConnection which initiated the search
queue
- The queue for the search results.
cons
- The LDAPSearchConstraints associated with this searchMethod Detail |
---|
public int getCount()
Returns a count of the entries and exceptions remaining in the object. If the search was submitted with a batch size greater than zero, getCount reports the number of results received so far but not enumerated with next(). The behavior is same for search submitted with batch size equals to 0.
For blocking calls with batch size equals to 0, get count returns the count of all the expected results from search for first time once after enumerated with hasMore(). The subsequent iterations decrement count value for both blocking and non-blocking calls.
public LDAPControl[] getResponseControls()
public boolean hasMore()
private void resetVectors()
public LDAPEntry next() throws LDAPException
If automatic referral following is disabled or if a referral was not followed, next() will throw an LDAPReferralException when the referral is received.
LDAPException
- A general exception which includes an error
message and an LDAP error code.
LDAPReferralException
- A referral was received and not
followed.private boolean getBatchOfResults()
If the last message from the server, the result message, contains an error, it will be stored in the Vector for nextElement to process. (although it does not increment the search result count) All search result entries will be placed in the Vector. If a null is returned from getResponse(), it is likely that the search was abandoned.
void abandon()
private void writeAttribute(LDAPAttribute attr, java.lang.StringBuffer buff) throws java.io.IOException
java.io.IOException
private void writeControl(LDAPControl control, java.lang.StringBuffer buff) throws java.io.IOException
java.io.IOException
public static java.lang.Object readDSML(java.io.InputStream input) throws java.io.IOException
input
- InputStream for the DSML formatted data.
java.io.IOException
- when serialization fails.private static LDAPXMLHandler getTopXMLHandler(java.lang.String tagname, LDAPXMLHandler parenthandler)
static LDAPXMLHandler getXMLControlHandler(java.lang.String tagname, LDAPXMLHandler parenthandler)
tagname
- Name of the Root tag used to represent this class.parenthandler
- Parent LDAPXMLHandler for this tag.
static LDAPXMLHandler getXMLEntryHandler(java.lang.String tagname, LDAPXMLHandler parenthandler)
tagname
- Name of the Root tag used to represent this class.parenthandler
- Parent LDAPXMLHandler for this tag.
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The ObjectOutput stream where the Object in XML format
is being written to
java.io.IOException
- - If I/O errors occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The ObjectInput stream where the Serialized Object is being read from
java.io.IOException
- - If I/O errors occur
java.lang.ClassNotFoundException
- - If the class for an object being restored
cannot be found.public java.util.Vector getDeSerializedEntries()
public LDAPControl[] getDeSerializedControls()
|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |