Package com.iplanet.ums
Class SearchResults
- java.lang.Object
-
- com.iplanet.ums.SearchResults
-
- All Implemented Interfaces:
Serializable
public class SearchResults extends Object implements Serializable
Represents search results. Each search result is a PersistentObject- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
VLVRESPONSE_CONTENT_COUNT
Attribute name used with Object get( String ).static String
VLVRESPONSE_CONTEXT
Attribute name used with Object get( String ).static String
VLVRESPONSE_FIRST_POSITION
Attribute name used with Object get( String ).static String
VLVRESPONSE_RESULT_CODE
Attribute name used with Object get( String ).
-
Constructor Summary
Constructors Modifier Constructor Description protected
SearchResults(org.forgerock.opendj.ldap.Connection connection, org.forgerock.opendj.ldif.ConnectionEntryReader ldapSearchResult, org.forgerock.opendj.ldap.Connection conn)
Constructs Search Results fromldapSearchResult
.protected
SearchResults(org.forgerock.opendj.ldap.Connection connection, org.forgerock.opendj.ldif.ConnectionEntryReader ldapSearchResult, org.forgerock.opendj.ldap.Connection conn, DataLayer dataLayer)
Constructs SearchResults fromldapSearchResult
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abandon()
Abandons a current search operation, notifying the server not to send additional search results.PersistentObject
assertOneEntry()
Assert if the search result contains one and only one entry.Object
get(String name)
Get search result attributes related to the search operation performed.boolean
hasMoreElements()
Checks whether there are entries available.PersistentObject
next()
Returns the next entry in the search results.protected void
setPrincipal(Principal principal)
Sets the principal with which to associate search results.
-
-
-
Field Detail
-
VLVRESPONSE_CONTENT_COUNT
public static final String VLVRESPONSE_CONTENT_COUNT
Attribute name used with Object get( String ). Expected return object is Integer getting the content count from the VirtualListResponse control returned by server after a search- See Also:
- Constant Field Values
-
VLVRESPONSE_FIRST_POSITION
public static final String VLVRESPONSE_FIRST_POSITION
Attribute name used with Object get( String ). Expected return object is Integer getting the index of first position from VirtualListResponse control returned by server after a search- See Also:
- Constant Field Values
-
VLVRESPONSE_RESULT_CODE
public static final String VLVRESPONSE_RESULT_CODE
Attribute name used with Object get( String ). Expected return object is Integer getting the result code from from VirtualListResponse control returned by server after a search.- See Also:
- Constant Field Values
-
VLVRESPONSE_CONTEXT
public static final String VLVRESPONSE_CONTEXT
Attribute name used with Object get( String ). Expected return object is String getting the context cookie from VirtualListResponse control returned by server after a search.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SearchResults
protected SearchResults(org.forgerock.opendj.ldap.Connection connection, org.forgerock.opendj.ldif.ConnectionEntryReader ldapSearchResult, org.forgerock.opendj.ldap.Connection conn, DataLayer dataLayer)
Constructs SearchResults fromldapSearchResult
.- Parameters:
ldapSearchResult
-LDAPSearchResults
to construct fromconn
-LDAPConnection
assosciated with the search results.dataLayer
- Data Layer assosciated with the connection.
-
SearchResults
protected SearchResults(org.forgerock.opendj.ldap.Connection connection, org.forgerock.opendj.ldif.ConnectionEntryReader ldapSearchResult, org.forgerock.opendj.ldap.Connection conn)
Constructs Search Results fromldapSearchResult
.- Parameters:
ldapSearchResult
-LDAPSearchResults
to construct from.conn
-LDAPConnection
associated with the search results.
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Checks whether there are entries available.- Returns:
true
if there is more to read
-
next
public PersistentObject next() throws UMSException
Returns the next entry in the search results.- Throws:
UMSException
- No more entries in the search results.
-
assertOneEntry
public PersistentObject assertOneEntry() throws EntryNotFoundException, UMSException
Assert if the search result contains one and only one entry.- Returns:
- Entry if and only if there is one single entry
- Throws:
EntryNotFoundException
- if there is no entry at allUMSException
-
get
public Object get(String name) throws UMSException
Get search result attributes related to the search operation performed.- Parameters:
name
- Name of attribute to return, null if attribute is unknown or not found- Throws:
UMSException
- from accessor methods on LDAPVirtualListResponse control
-
abandon
public void abandon() throws UMSException
Abandons a current search operation, notifying the server not to send additional search results.- Throws:
UMSException
- from abandoning a search operation from LDAP
-
setPrincipal
protected void setPrincipal(Principal principal)
Sets the principal with which to associate search results.- Parameters:
principal
- Authenticated principal.
-
-