Class BindResponseDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
-
- org.apache.directory.api.ldap.codec.decorators.ResponseDecorator<BindResponse>
-
- org.apache.directory.api.ldap.codec.decorators.BindResponseDecorator
-
- All Implemented Interfaces:
Asn1Object
,Decorator<BindResponse>
,BindResponse
,Message
,Response
,ResultResponse
public class BindResponseDecorator extends ResponseDecorator<BindResponse> implements BindResponse
A decorator for the BindResponse message- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description BindResponseDecorator(LdapApiService codec, BindResponse decoratedMessage)
Makes a BindResponse a MessageDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the BindResponse length
BindResponse :ByteBuffer
encode(ByteBuffer buffer)
Encode the BindResponse message to a PDU.byte[]
getServerSaslCreds()
Gets the optional property holding SASL authentication response parameters that are SASL mechanism specific.void
setServerSaslCreds(byte[] serverSaslCreds)
Sets the optional property holding SASL authentication response paramters that are SASL mechanism specific.-
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ResponseDecorator
getLdapResult, setLdapResult
-
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
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponse
getLdapResult
-
-
-
-
Constructor Detail
-
BindResponseDecorator
public BindResponseDecorator(LdapApiService codec, BindResponse decoratedMessage)
Makes a BindResponse a MessageDecorator.- Parameters:
codec
- The LDAP service instancedecoratedMessage
- the decorated BindResponse
-
-
Method Detail
-
getServerSaslCreds
public byte[] getServerSaslCreds()
Gets the optional property holding SASL authentication response parameters that are SASL mechanism specific. Will return null if the authentication is simple.- Specified by:
getServerSaslCreds
in interfaceBindResponse
- Returns:
- the sasl mech. specific credentials or null of auth. is simple
-
setServerSaslCreds
public void setServerSaslCreds(byte[] serverSaslCreds)
Sets the optional property holding SASL authentication response paramters that are SASL mechanism specific. Leave null if authentication mode is simple.- Specified by:
setServerSaslCreds
in interfaceBindResponse
- Parameters:
serverSaslCreds
- the sasl auth. mech. specific credentials
-
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 interfaceAsn1Object
- 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 interfaceAsn1Object
- Parameters:
buffer
- The buffer where to put the PDU- Returns:
- The encoded response
- Throws:
EncoderException
- when encoding operations fail
-
-