org.apache.directory.shared.ldap.codec.search
Class SearchRequest

java.lang.Object
  extended byorg.apache.directory.shared.asn1.Asn1Object
      extended byorg.apache.directory.shared.ldap.codec.LdapMessage
          extended byorg.apache.directory.shared.ldap.codec.search.SearchRequest

public class SearchRequest
extends LdapMessage

A SearchRequest ldapObject. It's a sub-class of Asn1Object, and it implements the ldapObject class to be seen as a member of the LdapMessage CHOICE.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.Asn1Object
parent
 
Constructor Summary
SearchRequest()
          Creates a new SearchRequest object.
 
Method Summary
 void addAttribute(LdapString attribute)
          Add an attribute to the attributes list.
 int computeLength()
          Compute the SearchRequest length SearchRequest : 0x63 L1 | +--> 0x04 L2 baseObject +--> 0x0A 0x01 scope +--> 0x0A 0x01 derefAliases +--> 0x02 0x0(1..4) sizeLimit +--> 0x02 0x0(1..4) timeLimit +--> 0x01 0x01 typesOnly +--> filter.computeLength() +--> 0x30 L3 (Attribute description list) | +--> 0x04 L4-1 Attribute description +--> 0x04 L4-2 Attribute description +--> ...
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the SearchRequest message to a PDU.
 javax.naming.directory.Attributes getAttributes()
          Get the list of attributes
 java.lang.String getBaseObject()
          Get the base object
 Filter getCurrentFilter()
          Get the current dilter
 int getDerefAliases()
          Get the derefAliases flag
 Filter getFilter()
          Get the filter
 int getMessageType()
          Get the message type
 int getScope()
          Get the search scope
 int getSizeLimit()
          Get the size limit
 int getTimeLimit()
          Get the time limit
 boolean isTypesOnly()
          Get the typesOnly flag
 void setBaseObject(javax.naming.Name baseObject)
          Set the base object
 void setCurrentFilter(Filter currentFilter)
          Set the current dilter
 void setDerefAliases(int derefAliases)
          Set the derefAliases flag
 void setFilter(Filter filter)
          Set the filter
 void setScope(int scope)
          Set the search scope
 void setSizeLimit(int sizeLimit)
          Set the size limit
 void setTimeLimit(int timeLimit)
          Set the time limit
 void setTypesOnly(boolean typesOnly)
          Set the typesOnly flag
 java.lang.String toString()
          Return a string the represent a SearchRequest
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessage
addControl, getAbandonRequest, getAddRequest, getAddResponse, getBindRequest, getBindResponse, getCompareRequest, getCompareResponse, getControls, getControls, getCurrentControl, getDelRequest, getDelResponse, getExtendedRequest, getExtendedResponse, getLdapResponse, getMessageId, getMessageTypeName, getModifyDNRequest, getModifyDNResponse, getModifyRequest, getModifyResponse, getSearchRequest, getSearchResultDone, getSearchResultEntry, getSearchResultReference, getUnBindRequest, initControl, setMessageId, setProtocolOP
 
Methods inherited from class org.apache.directory.shared.asn1.Asn1Object
addLength, getCurrentLength, getExpectedLength, getParent, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchRequest

public SearchRequest()
Creates a new SearchRequest object.

Method Detail

getMessageType

public int getMessageType()
Get the message type

Overrides:
getMessageType in class LdapMessage
Returns:
Returns the type.

getAttributes

public javax.naming.directory.Attributes getAttributes()
Get the list of attributes

Returns:
Returns the attributes.

addAttribute

public void addAttribute(LdapString attribute)
Add an attribute to the attributes list.

Parameters:
attribute - The attribute to add to the list

getBaseObject

public java.lang.String getBaseObject()
Get the base object

Returns:
Returns the baseObject.

setBaseObject

public void setBaseObject(javax.naming.Name baseObject)
Set the base object

Parameters:
baseObject - The baseObject to set.

getDerefAliases

public int getDerefAliases()
Get the derefAliases flag

Returns:
Returns the derefAliases.

setDerefAliases

public void setDerefAliases(int derefAliases)
Set the derefAliases flag

Parameters:
derefAliases - The derefAliases to set.

getFilter

public Filter getFilter()
Get the filter

Returns:
Returns the filter.

setFilter

public void setFilter(Filter filter)
Set the filter

Parameters:
filter - The filter to set.

getScope

public int getScope()
Get the search scope

Returns:
Returns the scope.

setScope

public void setScope(int scope)
Set the search scope

Parameters:
scope - The scope to set.

getSizeLimit

public int getSizeLimit()
Get the size limit

Returns:
Returns the sizeLimit.

setSizeLimit

public void setSizeLimit(int sizeLimit)
Set the size limit

Parameters:
sizeLimit - The sizeLimit to set.

getTimeLimit

public int getTimeLimit()
Get the time limit

Returns:
Returns the timeLimit.

setTimeLimit

public void setTimeLimit(int timeLimit)
Set the time limit

Parameters:
timeLimit - The timeLimit to set.

isTypesOnly

public boolean isTypesOnly()
Get the typesOnly flag

Returns:
Returns the typesOnly.

setTypesOnly

public void setTypesOnly(boolean typesOnly)
Set the typesOnly flag

Parameters:
typesOnly - The typesOnly to set.

getCurrentFilter

public Filter getCurrentFilter()
Get the current dilter

Returns:
Returns the currentFilter.

setCurrentFilter

public void setCurrentFilter(Filter currentFilter)
Set the current dilter

Parameters:
currentFilter - The currentFilter to set.

computeLength

public int computeLength()
Compute the SearchRequest length SearchRequest : 0x63 L1 | +--> 0x04 L2 baseObject +--> 0x0A 0x01 scope +--> 0x0A 0x01 derefAliases +--> 0x02 0x0(1..4) sizeLimit +--> 0x02 0x0(1..4) timeLimit +--> 0x01 0x01 typesOnly +--> filter.computeLength() +--> 0x30 L3 (Attribute description list) | +--> 0x04 L4-1 Attribute description +--> 0x04 L4-2 Attribute description +--> ... +--> 0x04 L4-i Attribute description +--> ... +--> 0x04 L4-n Attribute description

Overrides:
computeLength in class LdapMessage

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Encode the SearchRequest message to a PDU. SearchRequest : 0x63 LL 0x04 LL baseObject 0x0A 01 scope 0x0A 01 derefAliases 0x02 0N sizeLimit 0x02 0N timeLimit 0x01 0x01 typesOnly filter.encode() 0x30 LL attributeDescriptionList 0x04 LL attributeDescription ... 0x04 LL attributeDescription

Overrides:
encode in class LdapMessage
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
org.apache.directory.shared.asn1.codec.EncoderException - If anything goes wrong.

toString

public java.lang.String toString()
Return a string the represent a SearchRequest

Overrides:
toString in class LdapMessage
Returns:
A LdapMessage String


Copyright © 2003-2006 . All Rights Reserved.