org.opends.server.protocols.ldap
Class SearchRequestProtocolOp

java.lang.Object
  extended by org.opends.server.protocols.ldap.ProtocolOp
      extended by org.opends.server.protocols.ldap.SearchRequestProtocolOp

public class SearchRequestProtocolOp
extends ProtocolOp

This class defines the structures and methods for an LDAP search request protocol op, which is used to locate entries based on a set of criteria.


Constructor Summary
SearchRequestProtocolOp(ASN1OctetString baseDN, SearchScope scope, DereferencePolicy dereferencePolicy, int sizeLimit, int timeLimit, boolean typesOnly, LDAPFilter filter, java.util.LinkedHashSet<java.lang.String> attributes)
          Creates a new search request protocol op with the provided information.
 
Method Summary
static SearchRequestProtocolOp decodeSearchRequest(ASN1Element element)
          Decodes the provided ASN.1 element as an LDAP search request protocol op.
 ASN1Element encode()
          Encodes this protocol op to an ASN.1 element suitable for including in an LDAP message.
 java.util.LinkedHashSet<java.lang.String> getAttributes()
          Retrieves the set of requested attributes for this search request.
 ASN1OctetString getBaseDN()
          Retrieves the base DN for this search request.
 DereferencePolicy getDereferencePolicy()
          Retrieves the alias dereferencing policy for this search request.
 LDAPFilter getFilter()
          Retrieves the filter for this search request.
 java.lang.String getProtocolOpName()
          Retrieves the name for this protocol op type.
 SearchScope getScope()
          Retrieves the scope for this search request.
 int getSizeLimit()
          Retrieves the size limit for this search request.
 int getTimeLimit()
          Retrieves the time limit for this search request.
 byte getType()
          Retrieves the BER type for this protocol op.
 boolean getTypesOnly()
          Retrieves the value of the typesOnly flag for this search request.
 void setAttributes(java.util.LinkedHashSet<java.lang.String> attributes)
          Specifies the set of requested attributes for this search request.
 void setBaseDN(ASN1OctetString baseDN)
          Specifies the base DN for this search request.
 void setDereferencePolicy(DereferencePolicy dereferencePolicy)
          Specifies the alias dereferencing policy for this search request.
 void setFilter(LDAPFilter filter)
          Specifies the filter for this search request.
 void setScope(SearchScope scope)
          Specifies the scope for this search request.
 void setSizeLimit(int sizeLimit)
          Specifies the size limit for this search request.
 void setTimeLimit(int timeLimit)
          Specifies the time limit for this search request.
 void setTypesOnly(boolean typesOnly)
          Specifies the value of the typesOnly flag for this search request.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP protocol op to the provided buffer.
 void toString(java.lang.StringBuilder buffer, int indent)
          Appends a multi-line string representation of this LDAP protocol op to the provided buffer.
 
Methods inherited from class org.opends.server.protocols.ldap.ProtocolOp
decode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchRequestProtocolOp

public SearchRequestProtocolOp(ASN1OctetString baseDN,
                               SearchScope scope,
                               DereferencePolicy dereferencePolicy,
                               int sizeLimit,
                               int timeLimit,
                               boolean typesOnly,
                               LDAPFilter filter,
                               java.util.LinkedHashSet<java.lang.String> attributes)
Creates a new search request protocol op with the provided information.

Parameters:
baseDN - The base DN for this search request.
scope - The scope for this search request.
dereferencePolicy - The alias dereferencing policy for this search request.
sizeLimit - The size limit for this search request.
timeLimit - The time limit for this search request.
typesOnly - The typesOnly flag for this search request.
filter - The filter for this search request.
attributes - The set of requested attributes for this search request.
Method Detail

getBaseDN

public ASN1OctetString getBaseDN()
Retrieves the base DN for this search request.

Returns:
The base DN for this search request.

setBaseDN

public void setBaseDN(ASN1OctetString baseDN)
Specifies the base DN for this search request.

Parameters:
baseDN - The base DN for this search request.

getScope

public SearchScope getScope()
Retrieves the scope for this search request.

Returns:
The scope for this search request.

setScope

public void setScope(SearchScope scope)
Specifies the scope for this search request.

Parameters:
scope - The scope for this search request.

getDereferencePolicy

public DereferencePolicy getDereferencePolicy()
Retrieves the alias dereferencing policy for this search request.

Returns:
The alias dereferencing policy for this search request.

setDereferencePolicy

public void setDereferencePolicy(DereferencePolicy dereferencePolicy)
Specifies the alias dereferencing policy for this search request.

Parameters:
dereferencePolicy - The alias dereferencing policy for this search request.

getSizeLimit

public int getSizeLimit()
Retrieves the size limit for this search request.

Returns:
The size limit for this search request.

setSizeLimit

public void setSizeLimit(int sizeLimit)
Specifies the size limit for this search request.

Parameters:
sizeLimit - The size limit for this search request.

getTimeLimit

public int getTimeLimit()
Retrieves the time limit for this search request.

Returns:
The time limit for this search request.

setTimeLimit

public void setTimeLimit(int timeLimit)
Specifies the time limit for this search request.

Parameters:
timeLimit - The time limit for this search request.

getTypesOnly

public boolean getTypesOnly()
Retrieves the value of the typesOnly flag for this search request.

Returns:
The value of tye typesOnly flag for this search request.

setTypesOnly

public void setTypesOnly(boolean typesOnly)
Specifies the value of the typesOnly flag for this search request.

Parameters:
typesOnly - The value of the typesOnly flag for this search request.

getFilter

public LDAPFilter getFilter()
Retrieves the filter for this search request.

Returns:
The filter for this search request.

setFilter

public void setFilter(LDAPFilter filter)
Specifies the filter for this search request.

Parameters:
filter - The filter for this search request.

getAttributes

public java.util.LinkedHashSet<java.lang.String> getAttributes()
Retrieves the set of requested attributes for this search request. The returned list may be modified by the caller.

Returns:
The set of requested attributes for this search request.

setAttributes

public void setAttributes(java.util.LinkedHashSet<java.lang.String> attributes)
Specifies the set of requested attributes for this search request.

Parameters:
attributes - The set of requested attributes for this search request.

getType

public byte getType()
Retrieves the BER type for this protocol op.

Specified by:
getType in class ProtocolOp
Returns:
The BER type for this protocol op.

getProtocolOpName

public java.lang.String getProtocolOpName()
Retrieves the name for this protocol op type.

Specified by:
getProtocolOpName in class ProtocolOp
Returns:
The name for this protocol op type.

encode

public ASN1Element encode()
Encodes this protocol op to an ASN.1 element suitable for including in an LDAP message.

Specified by:
encode in class ProtocolOp
Returns:
The ASN.1 element containing the encoded protocol op.

decodeSearchRequest

public static SearchRequestProtocolOp decodeSearchRequest(ASN1Element element)
                                                   throws LDAPException
Decodes the provided ASN.1 element as an LDAP search request protocol op.

Parameters:
element - The ASN.1 element to decode.
Returns:
The decoded LDAP search request protocol op.
Throws:
LDAPException - If a problem occurs while decoding the provided ASN.1 element as an LDAP search request protocol op.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP protocol op to the provided buffer.

Specified by:
toString in class ProtocolOp
Parameters:
buffer - The buffer to which the string should be appended.

toString

public void toString(java.lang.StringBuilder buffer,
                     int indent)
Appends a multi-line string representation of this LDAP protocol op to the provided buffer.

Specified by:
toString in class ProtocolOp
Parameters:
buffer - The buffer to which the information should be appended.
indent - The number of spaces from the margin that the lines should be indented.