public class LdapResultDecorator extends Object implements LdapResult, Decorator<LdapResult>
Constructor and Description |
---|
LdapResultDecorator(LdapApiService codec,
LdapResult decoratedLdapResult)
Makes a LdapResult encodable.
|
Modifier and Type | Method and Description |
---|---|
int |
computeLength()
Compute the LdapResult length
LdapResult : |
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.
|
Dn |
getMatchedDn()
Gets the lowest entry in the directory that was matched.
|
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 |
setMatchedDn(Dn dn)
Sets the lowest entry in the directory that was matched.
|
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(LdapApiService codec, LdapResult decoratedLdapResult)
codec
- The LDAP service instancedecoratedLdapResult
- the decorated LdapResultpublic 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()
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 +--> ... +--> 0x04 Li referral +--> ... +--> 0x04 Ln referral L1 = Length(matchedDN) L2 = Length(errorMessage) L3 = n*Length(0x04) + sum(Length(L4) .. Length(Ln)) + sum(L4..Ln) L4..n = Length(0x04) + Length(Li) + Li Length(LdapResult) = Length(0x0x0A) + Length(0x01) + 1 + Length(0x04) + Length(L1) + L1 + Length(0x04) + Length(L2) + L2 + Length(0x83) + Length(L3) + L3
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–2018 The Apache Software Foundation. All rights reserved.