Class LdapResultDsml
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.response.LdapResultDsml
-
- All Implemented Interfaces:
DsmlDecorator<LdapResult>,LdapResult
public class LdapResultDsml extends Object implements DsmlDecorator<LdapResult>, LdapResult
DSML Decorator for the LdapResult class.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description LdapResultDsml(LdapApiService codec, LdapResult result, Message message)Creates a new instance of LdapResultDsml.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReferral(LdapUrl referral)Add a referralLdapResultgetDecorated()Gets the Message this DsmlDecorator decorates.StringgetDiagnosticMessage()Gets the descriptive diagnostic message associated with the error code.DngetMatchedDn()Get the matched DnReferralgetReferral()Gets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.List<String>getReferrals()Get the referralsResultCodeEnumgetResultCode()Get the result codebooleanisDefaultSuccess()Tells if the LdapResult is a success, with no added information.booleanisReferral()Gets whether or not this result represents a Referral.voidsetDiagnosticMessage(String diagnosticMessage)Sets the descriptive diagnostic message associated with the error code.voidsetMatchedDn(Dn matchedDn)Set the Matched DnvoidsetReferral(Referral referral)Sets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.voidsetResultCode(ResultCodeEnum resultCode)Set the result codeElementtoDsml(Element root)Converts the request/reponse to its XML representation in the DSMLv2 format
-
-
-
Constructor Detail
-
LdapResultDsml
public LdapResultDsml(LdapApiService codec, LdapResult result, Message message)
Creates a new instance of LdapResultDsml.- Parameters:
codec- The LDAP Service to useresult- the LdapResult to decoratemessage- the associated message
-
-
Method Detail
-
toDsml
public Element toDsml(Element root)
Converts the request/reponse to its XML representation in the DSMLv2 format- Specified by:
toDsmlin interfaceDsmlDecorator<LdapResult>- Parameters:
root- the root dom4j Element- Returns:
- the dom4j Element corresponding to the entry.
-
getDiagnosticMessage
public String getDiagnosticMessage()
Gets the descriptive diagnostic message associated with the error code. May be null for SUCCESS, COMPARETRUE, COMPAREFALSE and REFERRAL operations.- Specified by:
getDiagnosticMessagein interfaceLdapResult- Returns:
- the descriptive diagnostic message.
-
setDiagnosticMessage
public void setDiagnosticMessage(String diagnosticMessage)
Sets the descriptive diagnostic message associated with the error code. May be null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations.- Specified by:
setDiagnosticMessagein interfaceLdapResult- Parameters:
diagnosticMessage- the descriptive diagnostic message.
-
getMatchedDn
public Dn getMatchedDn()
Get the matched Dn- Specified by:
getMatchedDnin interfaceLdapResult- Returns:
- Returns the matchedDN.
-
setMatchedDn
public void setMatchedDn(Dn matchedDn)
Set the Matched Dn- Specified by:
setMatchedDnin interfaceLdapResult- Parameters:
matchedDn- The matchedDn to set.- See Also:
LdapResult.getMatchedDn()
-
addReferral
public void addReferral(LdapUrl referral)
Add a referral- Parameters:
referral- The referral to add.
-
getResultCode
public ResultCodeEnum getResultCode()
Get the result code- Specified by:
getResultCodein interfaceLdapResult- Returns:
- Returns the resultCode.
-
setResultCode
public void setResultCode(ResultCodeEnum resultCode)
Set the result code- Specified by:
setResultCodein interfaceLdapResult- Parameters:
resultCode- The resultCode to set.
-
getDecorated
public LdapResult getDecorated()
Gets the Message this DsmlDecorator decorates.- Specified by:
getDecoratedin interfaceDsmlDecorator<LdapResult>- Returns:
- The decorated Message instance
-
isReferral
public boolean isReferral()
Gets whether or not this result represents a Referral. For referrals the error code is set to REFERRAL and the referral property is not null.- Specified by:
isReferralin interfaceLdapResult- Returns:
- true if this result represents a referral.
-
getReferral
public Referral getReferral()
Gets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.- Specified by:
getReferralin interfaceLdapResult- Returns:
- the referral on REFERRAL resultCode, null on all others.
-
setReferral
public void setReferral(Referral referral)
Sets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum. Setting this property will result in a true return from isReferral and the resultCode should be set to REFERRAL.- Specified by:
setReferralin interfaceLdapResult- Parameters:
referral- optional referral on REFERRAL errors.
-
isDefaultSuccess
public boolean isDefaultSuccess()
Tells if the LdapResult is a success, with no added information. The MatchedDn will be empty, as the diagnostic message and the referral. The ResultCode will always be 0.- Specified by:
isDefaultSuccessin interfaceLdapResult- Returns:
- True if the LdapResult is SUCCESS.
-
-