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

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.SearchResultEntry

public class SearchResultEntry
extends LdapMessage

A SearchResultEntry Message. Its syntax is : SearchResultEntry ::= [APPLICATION 4] SEQUENCE { objectName LDAPDN, attributes PartialAttributeList } PartialAttributeList ::= SEQUENCE OF SEQUENCE { type AttributeDescription, vals SET OF AttributeValue } AttributeDescription ::= LDAPString AttributeValue ::= OCTET STRING It contains an entry, with all its attributes, and all the attributes values. If a search request is submited, all the results are sent one by one, followed by a searchResultDone message.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.Asn1Object
parent
 
Constructor Summary
SearchResultEntry()
          Creates a new SearchResultEntry object.
 
Method Summary
 void addAttributeValue(java.lang.Object value)
          Add a new value to the current attribute
 void addAttributeValues(LdapString type)
          Create a new attributeValue
 int computeLength()
          Compute the SearchResultEntry length SearchResultEntry : 0x64 L1 | +--> 0x04 L2 objectName +--> 0x30 L3 (attributes) | +--> 0x30 L4-1 (partial attributes list) | | | +--> 0x04 L5-1 type | +--> 0x31 L6-1 (values) | | | +--> 0x04 L7-1-1 value | +--> ...
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the SearchResultEntry message to a PDU.
 java.lang.String getCurrentAttributeValueType()
           
 int getMessageType()
          Get the message type
 java.lang.String getObjectName()
          Get the entry DN
 javax.naming.directory.Attributes getPartialAttributeList()
          Get the entry's attributes
 void setObjectName(javax.naming.Name objectName)
          Set the entry DN
 void setPartialAttributeList(javax.naming.directory.Attributes partialAttributeList)
          Initialize the partial Attribute list.
 java.lang.String toString()
          Returns the Search Result Entry string
 
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

SearchResultEntry

public SearchResultEntry()
Creates a new SearchResultEntry object.

Method Detail

getMessageType

public int getMessageType()
Get the message type

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

getObjectName

public java.lang.String getObjectName()
Get the entry DN

Returns:
Returns the objectName.

setObjectName

public void setObjectName(javax.naming.Name objectName)
Set the entry DN

Parameters:
objectName - The objectName to set.

getPartialAttributeList

public javax.naming.directory.Attributes getPartialAttributeList()
Get the entry's attributes

Returns:
Returns the partialAttributeList.

setPartialAttributeList

public void setPartialAttributeList(javax.naming.directory.Attributes partialAttributeList)
Initialize the partial Attribute list.


addAttributeValues

public void addAttributeValues(LdapString type)
Create a new attributeValue

Parameters:
type - The attribute's name

addAttributeValue

public void addAttributeValue(java.lang.Object value)
Add a new value to the current attribute

Parameters:
value -

computeLength

public int computeLength()
Compute the SearchResultEntry length SearchResultEntry : 0x64 L1 | +--> 0x04 L2 objectName +--> 0x30 L3 (attributes) | +--> 0x30 L4-1 (partial attributes list) | | | +--> 0x04 L5-1 type | +--> 0x31 L6-1 (values) | | | +--> 0x04 L7-1-1 value | +--> ... | +--> 0x04 L7-1-n value | +--> 0x30 L4-2 (partial attributes list) | | | +--> 0x04 L5-2 type | +--> 0x31 L6-2 (values) | | | +--> 0x04 L7-2-1 value | +--> ... | +--> 0x04 L7-2-n value | +--> ... | +--> 0x30 L4-m (partial attributes list) | +--> 0x04 L5-m type +--> 0x31 L6-m (values) | +--> 0x04 L7-m-1 value +--> ... +--> 0x04 L7-m-n value

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 SearchResultEntry message to a PDU. SearchResultEntry : 0x64 LL 0x04 LL objectName 0x30 LL attributes 0x30 LL partialAttributeList 0x04 LL type 0x31 LL vals 0x04 LL attributeValue ... 0x04 LL attributeValue ... 0x30 LL partialAttributeList 0x04 LL type 0x31 LL vals 0x04 LL attributeValue ... 0x04 LL attributeValue

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()
Returns the Search Result Entry string

Overrides:
toString in class LdapMessage
Returns:
The Search Result Entry string

getCurrentAttributeValueType

public java.lang.String getCurrentAttributeValueType()
Returns:
Returns the currentAttributeValue.


Copyright © 2003-2006 . All Rights Reserved.