public class LdapResultDecorator extends Object implements LdapResult, Decorator<LdapResult>
Constructor and Description |
---|
LdapResultDecorator(LdapResult decoratedLdapResult)
Makes a LdapResult encodable.
|
Modifier and Type | Method and Description |
---|---|
int |
computeLength()
Compute the LdapResult length
LdapResult :
0x0A 01 resultCode (0..80)
0x04 L1 matchedDN (L1 = Length(matchedDN))
0x04 L2 errorMessage (L2 = Length(errorMessage))
[0x83 L3] referrals
|
+--> 0x04 L4 referral
+--> 0x04 L5 referral
+--> ...
|
ByteBuffer |
encode(ByteBuffer buffer)
Encode the LdapResult message to a PDU.
|
LdapApiService |
getCodecService()
Gets the codec service responsible for managing the encoding and
decoding of the decorated objects.
|
LdapResult |
getDecorated()
Gets the object being decorated by this IDecorator.
|
String |
getDiagnosticMessage()
Gets the descriptive diagnostic message associated with the error code.
|
byte[] |
getErrorMessageBytes() |
Dn |
getMatchedDn()
Gets the lowest entry in the directory that was matched.
|
byte[] |
getMatchedDnBytes() |
Referral |
getReferral()
Gets the Referral associated with this LdapResult if the resultCode
property is set to the REFERRAL ResultCodeEnum.
|
ResultCodeEnum |
getResultCode()
Gets the result code enumeration associated with the response.
|
boolean |
isDefaultSuccess()
Tells if the LdapResult is a success, with no added information.
|
boolean |
isReferral()
Gets whether or not this result represents a Referral.
|
void |
setDiagnosticMessage(String diagnosticMessage)
Sets the descriptive diagnostic message associated with the error code.
|
void |
setErrorMessageBytes(byte[] errorMessageBytes)
Set the encoded message's bytes
|
void |
setMatchedDn(Dn dn)
Sets the lowest entry in the directory that was matched.
|
void |
setMatchedDnBytes(byte[] matchedDnBytes)
Sets the encoded value for MatchedDn
|
void |
setReferral(Referral referral)
Sets the Referral associated with this LdapResult if the resultCode
property is set to the REFERRAL ResultCodeEnum.
|
void |
setResultCode(ResultCodeEnum resultCode)
Sets the result code enumeration associated with the response.
|
String |
toString() |
public LdapResultDecorator(LdapResult decoratedLdapResult)
decoratedLdapResult
- the decorated LdapResultpublic byte[] getErrorMessageBytes()
public void setErrorMessageBytes(byte[] errorMessageBytes)
errorMessageBytes
- The encoded bytespublic void setMatchedDnBytes(byte[] matchedDnBytes)
matchedDnBytes
- The encoded MatchedDNpublic byte[] getMatchedDnBytes()
public ResultCodeEnum getResultCode()
getResultCode
in interface LdapResult
public void setResultCode(ResultCodeEnum resultCode)
setResultCode
in interface LdapResult
resultCode
- the result code enum value.public Dn getMatchedDn()
getMatchedDn
in interface LdapResult
public void setMatchedDn(Dn dn)
setMatchedDn
in interface LdapResult
dn
- the Dn of the lowest matched entry.LdapResult.getMatchedDn()
public String getDiagnosticMessage()
getDiagnosticMessage
in interface LdapResult
public void setDiagnosticMessage(String diagnosticMessage)
setDiagnosticMessage
in interface LdapResult
diagnosticMessage
- the descriptive diagnostic message.public boolean isReferral()
isReferral
in interface LdapResult
public Referral getReferral()
getReferral
in interface LdapResult
public void setReferral(Referral referral)
setReferral
in interface LdapResult
referral
- optional referral on REFERRAL errors.public int computeLength()
computeLength
in interface Decorator<LdapResult>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
encode
in interface Decorator<LdapResult>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedpublic LdapResult getDecorated()
getDecorated
in interface Decorator<LdapResult>
public LdapApiService getCodecService()
getCodecService
in interface Decorator<LdapResult>
public boolean isDefaultSuccess()
isDefaultSuccess
in interface LdapResult
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.