Class LdapResultImpl
- java.lang.Object
-
- org.apache.directory.api.ldap.model.message.LdapResultImpl
-
- All Implemented Interfaces:
LdapResult
public class LdapResultImpl extends Object implements LdapResult
The LdapResult implementation. RFC 4511 definition for a LdapResult is given below.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description LdapResultImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetDiagnosticMessage()Gets the descriptive diagnostic message associated with the error code.DngetMatchedDn()Gets the lowest entry in the directory that was matched.ReferralgetReferral()Gets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.ResultCodeEnumgetResultCode()Gets the result code enumeration associated with the response.inthashCode()booleanisDefaultSuccess()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)Sets the lowest entry in the directory that was matched.voidsetReferral(Referral referral)Sets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.voidsetResultCode(ResultCodeEnum resultCode)Sets the result code enumeration associated with the response.StringtoString()Get a String representation of a LdapResult
-
-
-
Method Detail
-
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()
Gets the lowest entry in the directory that was matched. For result codes of noSuchObject, aliasProblem, invalidDNSyntax and aliasDereferencingProblem, the matchedDN field is set to the name of the lowest entry (object or alias) in the directory that was matched. If no aliases were dereferenced while attempting to locate the entry, this will be a truncated form of the name provided, or if aliases were dereferenced, of the resulting name, as defined in section 12.5 of X.511 [8]. The matchedDN field is to be set to a zero length string with all other result codes.- Specified by:
getMatchedDnin interfaceLdapResult- Returns:
- the Dn of the lowest matched entry.
-
setMatchedDn
public void setMatchedDn(Dn matchedDn)
Sets the lowest entry in the directory that was matched.- Specified by:
setMatchedDnin interfaceLdapResult- Parameters:
matchedDn- the Dn of the lowest matched entry.- See Also:
LdapResult.getMatchedDn()
-
getResultCode
public ResultCodeEnum getResultCode()
Gets the result code enumeration associated with the response. Corresponds to the resultCode field within the LDAPResult ASN.1 structure.- Specified by:
getResultCodein interfaceLdapResult- Returns:
- the result code enum value.
-
setResultCode
public void setResultCode(ResultCodeEnum resultCode)
Sets the result code enumeration associated with the response. Corresponds to the resultCode field within the LDAPResult ASN.1 structure.- Specified by:
setResultCodein interfaceLdapResult- Parameters:
resultCode- the result code enum value.
-
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.
-
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.
-
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.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- Returns:
- the instance's hash code
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
-
-