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

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.LdapMessageCodec
          extended by org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec
All Implemented Interfaces:
Asn1Object

public class SearchResultReferenceCodec
extends LdapMessageCodec

A SearchResultReference Message. Its syntax is : SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL

Version:
$Rev: 912399 $, $Date: 2010-02-21 21:52:31 +0100 (Sun, 21 Feb 2010) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec
ldapMessageLength
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
SearchResultReferenceCodec()
          Creates a new SearchResultEntry object.
 
Method Summary
 void addSearchResultReference(LdapURL searchResultReference)
          Add a new reference to the list.
protected  int computeLengthProtocolOp()
          Compute the SearchResultReference length SearchResultReference :
protected  void encodeProtocolOp(java.nio.ByteBuffer buffer)
          Encode the SearchResultReference message to a PDU.
 MessageTypeEnum getMessageType()
          Get the message type
 java.lang.String getMessageTypeName()
          Get the message type Name
 java.util.List<LdapURL> getSearchResultReferences()
          Get the list of references
 java.lang.String toString()
          Returns the Search Result Reference string
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec
addControl, addControls, computeLength, encode, getCodecControl, getControls, getControls, getCurrentControl, getMessageId, initControls, setMessageId, toString
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, encode, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchResultReferenceCodec

public SearchResultReferenceCodec()
Creates a new SearchResultEntry object.

Method Detail

getMessageType

public MessageTypeEnum getMessageType()
Get the message type

Specified by:
getMessageType in class LdapMessageCodec
Returns:
Returns the type.

getMessageTypeName

public java.lang.String getMessageTypeName()
Get the message type Name

Specified by:
getMessageTypeName in class LdapMessageCodec
Returns:
The message type name

addSearchResultReference

public void addSearchResultReference(LdapURL searchResultReference)
Add a new reference to the list.

Parameters:
searchResultReference - The search result reference

getSearchResultReferences

public java.util.List<LdapURL> getSearchResultReferences()
Get the list of references

Returns:
An ArrayList of SearchResultReferences

computeLengthProtocolOp

protected int computeLengthProtocolOp()
Compute the SearchResultReference length SearchResultReference :
 0x73 L1
  |
  +--> 0x04 L2 reference
  +--> 0x04 L3 reference
  +--> ...
  +--> 0x04 Li reference
  +--> ...
  +--> 0x04 Ln reference
 
 L1 = n*Length(0x04) + sum(Length(Li)) + sum(Length(reference[i]))
 
 Length(SearchResultReference) = Length(0x73 + Length(L1) + L1
 

Specified by:
computeLengthProtocolOp in class LdapMessageCodec

encodeProtocolOp

protected void encodeProtocolOp(java.nio.ByteBuffer buffer)
                         throws EncoderException
Encode the SearchResultReference message to a PDU. SearchResultReference :
 0x73 LL
   0x04 LL reference
   [0x04 LL reference]*
 

Specified by:
encodeProtocolOp in class LdapMessageCodec
Parameters:
buffer - The buffer where to put the PDU
Throws:
EncoderException

toString

public java.lang.String toString()
Returns the Search Result Reference string

Overrides:
toString in class java.lang.Object
Returns:
The Search Result Reference string


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.