Class SearchResultReferenceDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.MessageDecorator<SearchResultReference>
-
- org.apache.directory.api.ldap.codec.decorators.SearchResultReferenceDecorator
-
- All Implemented Interfaces:
Asn1Object
,Decorator<SearchResultReference>
,Message
,Response
,SearchResultReference
public class SearchResultReferenceDecorator extends MessageDecorator<SearchResultReference> implements SearchResultReference
A decorator for the SearchResultReference message- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description SearchResultReferenceDecorator(LdapApiService codec, SearchResultReference decoratedMessage)
Makes a SearchResultReference encodable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the SearchResultReference length
SearchResultReference :ByteBuffer
encode(ByteBuffer buffer)
Encode the SearchResultReference message to a PDU.Referral
getReferral()
Gets the sequence of LdapUrls as a Referral instance.void
setReferral(Referral referral)
Sets the sequence of LdapUrls as a Referral instance.-
Methods inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
addAllControls, addControl, get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, removeControl, setControlsLength, setMessageId, setMessageLength, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
-
-
-
-
Constructor Detail
-
SearchResultReferenceDecorator
public SearchResultReferenceDecorator(LdapApiService codec, SearchResultReference decoratedMessage)
Makes a SearchResultReference encodable.- Parameters:
codec
- The LDAP service instancedecoratedMessage
- the decorated SearchResultReference
-
-
Method Detail
-
getReferral
public Referral getReferral()
Gets the sequence of LdapUrls as a Referral instance.- Specified by:
getReferral
in interfaceSearchResultReference
- Returns:
- the sequence of LdapUrls
-
setReferral
public void setReferral(Referral referral)
Sets the sequence of LdapUrls as a Referral instance.- Specified by:
setReferral
in interfaceSearchResultReference
- Parameters:
referral
- the sequence of LdapUrls
-
computeLength
public int computeLength()
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:
computeLength
in interfaceAsn1Object
- Returns:
- The encoded length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the SearchResultReference message to a PDU.
SearchResultReference :0x73 LL 0x04 LL reference [0x04 LL reference]*
- Specified by:
encode
in interfaceAsn1Object
- Parameters:
buffer
- The buffer where to put the PDU- Returns:
- The PDU.
- Throws:
EncoderException
- if the buffer can't be encoded
-
-