org.apache.directory.shared.ldap.message
Interface SearchRequest

All Superinterfaces:
AbandonableRequest, ManyReplyRequest, Message, Request, ResultResponseRequest
All Known Implementing Classes:
SearchRequestImpl

public interface SearchRequest
extends ManyReplyRequest, AbandonableRequest

Search request protocol message interface.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Field Summary
static MessageTypeEnum[] RESPONSE_TYPES
          Different response types that a search request may return.
static MessageTypeEnum TYPE
          Search request protocol message type
 
Method Summary
 void addAttribute(java.lang.String a_attribute)
          Adds an attribute to the set of entry attributes to return.
 java.util.Collection getAttributes()
          Gets a list of the attributes to be returned from each entry which matches the search filter.
 java.lang.String getBase()
          Gets the search base as a distinguished name.
 DerefAliasesEnum getDerefAliases()
          Gets the alias handling parameter.
 ExprNode getFilter()
          Gets the search filter associated with this search request.
 MessageTypeEnum[] getResponseTypes()
          Gets the different response types generated by a search request.
 ScopeEnum getScope()
          Gets the search scope parameter enumeration.
 int getSizeLimit()
          A sizelimit that restricts the maximum number of entries to be returned as a result of the search.
 int getTimeLimit()
          Gets the timelimit that restricts the maximum time (in seconds) allowed for a search.
 boolean getTypesOnly()
          An indicator as to whether search results will contain both attribute types and values, or just attribute types.
 void removeAttribute(java.lang.String a_attribute)
          Removes an attribute to the set of entry attributes to return.
 void setBase(java.lang.String a_baseDn)
          Sets the search base as a distinguished name.
 void setDerefAliases(DerefAliasesEnum a_derefAliases)
          Sets the alias handling parameter.
 void setFilter(ExprNode a_filter)
          Sets the search filter associated with this search request.
 void setScope(ScopeEnum a_scope)
          Sets the search scope parameter enumeration.
 void setSizeLimit(int a_entriesMax)
          Sets sizelimit that restricts the maximum number of entries to be returned as a result of the search.
 void setTimeLimit(int a_secondsMax)
          Sets the timelimit that restricts the maximum time (in seconds) allowed for a search.
 void setTypesOnly(boolean a_typesOnly)
          An indicator as to whether search results will contain both attribute types and values, or just attribute types.
 
Methods inherited from interface org.apache.directory.shared.ldap.message.ResultResponseRequest
getResultResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.message.Message
add, get, getControls, getMessageId, getType, put, remove
 
Methods inherited from interface org.apache.directory.shared.ldap.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
 

Field Detail

TYPE

public static final MessageTypeEnum TYPE
Search request protocol message type


RESPONSE_TYPES

public static final MessageTypeEnum[] RESPONSE_TYPES
Different response types that a search request may return. A search request unlike any other request type can generate four different kinds of responses. It is at most required to return a done response when it is complete however before then it can return search entry, search reference, and extended responses to the client.

See Also:
getResponseTypes()
Method Detail

getResponseTypes

public MessageTypeEnum[] getResponseTypes()
Gets the different response types generated by a search request.

Specified by:
getResponseTypes in interface ManyReplyRequest
Returns:
the RESPONSE_TYPES array
See Also:
RESPONSE_TYPES

getBase

public java.lang.String getBase()
Gets the search base as a distinguished name.

Returns:
the search base

setBase

public void setBase(java.lang.String a_baseDn)
Sets the search base as a distinguished name.

Parameters:
a_baseDn - the search base

getScope

public ScopeEnum getScope()
Gets the search scope parameter enumeration.

Returns:
the scope enumeration parameter.

setScope

public void setScope(ScopeEnum a_scope)
Sets the search scope parameter enumeration.

Parameters:
a_scope - the scope enumeration parameter.

getDerefAliases

public DerefAliasesEnum getDerefAliases()
Gets the alias handling parameter.

Returns:
the alias handling parameter enumeration.

setDerefAliases

public void setDerefAliases(DerefAliasesEnum a_derefAliases)
Sets the alias handling parameter.

Parameters:
a_derefAliases - the alias handling parameter enumeration.

getSizeLimit

public int getSizeLimit()
A sizelimit that restricts the maximum number of entries to be returned as a result of the search. A value of 0 in this field indicates that no client-requested sizelimit restrictions are in effect for the search. Servers may enforce a maximum number of entries to return.

Returns:
search size limit.

setSizeLimit

public void setSizeLimit(int a_entriesMax)
Sets sizelimit that restricts the maximum number of entries to be returned as a result of the search. A value of 0 in this field indicates that no client-requested sizelimit restrictions are in effect for the search. Servers may enforce a maximum number of entries to return.

Parameters:
a_entriesMax - maximum search result entries to return.

getTimeLimit

public int getTimeLimit()
Gets the timelimit that restricts the maximum time (in seconds) allowed for a search. A value of 0 in this field indicates that no client- requested timelimit restrictions are in effect for the search.

Returns:
the search time limit in seconds.

setTimeLimit

public void setTimeLimit(int a_secondsMax)
Sets the timelimit that restricts the maximum time (in seconds) allowed for a search. A value of 0 in this field indicates that no client- requested timelimit restrictions are in effect for the search.

Parameters:
a_secondsMax - the search time limit in seconds.

getTypesOnly

public boolean getTypesOnly()
An indicator as to whether search results will contain both attribute types and values, or just attribute types. Setting this field to TRUE causes only attribute types (no values) to be returned. Setting this field to FALSE causes both attribute types and values to be returned.

Returns:
true for only types, false for types and values.

setTypesOnly

public void setTypesOnly(boolean a_typesOnly)
An indicator as to whether search results will contain both attribute types and values, or just attribute types. Setting this field to TRUE causes only attribute types (no values) to be returned. Setting this field to FALSE causes both attribute types and values to be returned.

Parameters:
a_typesOnly - true for only types, false for types and values.

getFilter

public ExprNode getFilter()
Gets the search filter associated with this search request.

Returns:
the expression node for the root of the filter expression tree.

setFilter

public void setFilter(ExprNode a_filter)
Sets the search filter associated with this search request.

Parameters:
a_filter - the expression node for the root of the filter expression tree.

getAttributes

public java.util.Collection getAttributes()
Gets a list of the attributes to be returned from each entry which matches the search filter. There are two special values which may be used: an empty list with no attributes, and the attribute description string "*". Both of these signify that all user attributes are to be returned. (The "*" allows the client to request all user attributes in addition to specific operational attributes). Attributes MUST be named at most once in the list, and are returned at most once in an entry. If there are attribute descriptions in the list which are not recognized, they are ignored by the server. If the client does not want any attributes returned, it can specify a list containing only the attribute with OID "1.1". This OID was chosen arbitrarily and does not correspond to any attribute in use. Client implementors should note that even if all user attributes are requested, some attributes of the entry may not be included in search results due to access control or other restrictions. Furthermore, servers will not return operational attributes, such as objectClasses or attributeTypes, unless they are listed by name, since there may be extremely large number of values for certain operational attributes.

Returns:
the attributes to return for this request

addAttribute

public void addAttribute(java.lang.String a_attribute)
Adds an attribute to the set of entry attributes to return.

Parameters:
a_attribute - the attribute description or identifier.

removeAttribute

public void removeAttribute(java.lang.String a_attribute)
Removes an attribute to the set of entry attributes to return.

Parameters:
a_attribute - the attribute description or identifier.


Copyright © 2003-2006 . All Rights Reserved.