org.apache.directory.shared.ldap.codec.decorators
Class BindResponseDecorator

java.lang.Object
  extended by org.apache.directory.shared.ldap.codec.decorators.MessageDecorator<M>
      extended by org.apache.directory.shared.ldap.codec.decorators.ResponseDecorator<BindResponse>
          extended by org.apache.directory.shared.ldap.codec.decorators.BindResponseDecorator
All Implemented Interfaces:
Decorator<BindResponse>, BindResponse, Message, Response, ResultResponse

public class BindResponseDecorator
extends ResponseDecorator<BindResponse>
implements BindResponse

A decorator for the BindResponse message

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.decorators.MessageDecorator
messageLength
 
Fields inherited from interface org.apache.directory.shared.ldap.model.message.BindResponse
TYPE
 
Constructor Summary
BindResponseDecorator(LdapCodecService codec, BindResponse decoratedMessage)
          Makes a BindResponse a MessageDecorator.
 
Method Summary
 int computeLength()
          Compute the BindResponse length BindResponse :
 ByteBuffer encode(ByteBuffer buffer)
          Encode the BindResponse message to a PDU.
 int getBindResponseLength()
           
 byte[] getServerSaslCreds()
          
 void setBindResponseLength(int bindResponseLength)
          Stores the encoded length for the BindResponse
 void setServerSaslCreds(byte[] serverSaslCreds)
          
 
Methods inherited from class org.apache.directory.shared.ldap.codec.decorators.ResponseDecorator
getLdapResult, setLdapResult
 
Methods inherited from class org.apache.directory.shared.ldap.codec.decorators.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.ResultResponse
getLdapResult
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
 

Constructor Detail

BindResponseDecorator

public BindResponseDecorator(LdapCodecService codec,
                             BindResponse decoratedMessage)
Makes a BindResponse a MessageDecorator.

Parameters:
decoratedMessage - the decorated BindResponse
Method Detail

setBindResponseLength

public void setBindResponseLength(int bindResponseLength)
Stores the encoded length for the BindResponse

Parameters:
bindResponseLength - The encoded length

getBindResponseLength

public int getBindResponseLength()
Returns:
The encoded BindResponse's length

getServerSaslCreds

public byte[] getServerSaslCreds()

Specified by:
getServerSaslCreds in interface BindResponse

setServerSaslCreds

public void setServerSaslCreds(byte[] serverSaslCreds)

Specified by:
setServerSaslCreds in interface BindResponse

computeLength

public int computeLength()
Compute the BindResponse length BindResponse :
 0x61 L1 
   | 
   +--> LdapResult
   +--> [serverSaslCreds] 
   
 L1 = Length(LdapResult) [ + Length(serverSaslCreds) ] 
 Length(BindResponse) = Length(0x61) + Length(L1) + L1
 

Specified by:
computeLength in interface Decorator<BindResponse>
Returns:
The object's computed length

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Encode the BindResponse message to a PDU. BindResponse :
 LdapResult.encode 
 [0x87 LL serverSaslCreds]
 

Specified by:
encode in interface Decorator<BindResponse>
Parameters:
bb - The buffer where to put the PDU
bindResponseDecorator - The decorated BindResponse to encode
Returns:
The PDU.
Throws:
EncoderException - when encoding operations fail


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