org.apache.directory.ldap.client.api.message
Class LdapResult

java.lang.Object
  extended by org.apache.directory.ldap.client.api.message.LdapResult

public class LdapResult
extends java.lang.Object

LDAPv3 result structure embedded into Responses. See section 4.1.10 in RFC 2251 for a description of the LDAPResult ASN.1 structure, here's a snippet from it:

   The LDAPResult is the construct used in this protocol to return
   success or failure indications from servers to clients. In response
   to various requests servers will return responses containing fields
   of type LDAPResult to indicate the final status of a protocol
   operation request.
 

Version:
$Revision: 760984 $
Author:
Apache Directory Project

Constructor Summary
LdapResult()
           
 
Method Summary
 java.lang.String getErrorMessage()
          Gets the descriptive error message associated with the error code.
 java.lang.String 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.
 org.apache.directory.shared.ldap.message.ResultCodeEnum getResultCode()
          Gets the result code enumeration associated with the response.
 boolean isReferral()
          Gets whether or not this result represents a Referral.
 void setErrorMessage(java.lang.String errorMessage)
          Sets the descriptive error message associated with the error code.
 void setMatchedDn(java.lang.String matchedDn)
          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(org.apache.directory.shared.ldap.message.ResultCodeEnum resultCode)
          Sets the result code enumeration associated with the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapResult

public LdapResult()
Method Detail

getErrorMessage

public java.lang.String getErrorMessage()
Gets the descriptive error message associated with the error code. May be null for SUCCESS, COMPARETRUE, COMPAREFALSE and REFERRAL operations.

Returns:
the descriptive error message.

setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)
Sets the descriptive error message associated with the error code. May be null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations.

Parameters:
errorMessage - the descriptive error message.

getMatchedDn

public java.lang.String 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.

Returns:
the Dn of the lowest matched entry.

setMatchedDn

public void setMatchedDn(java.lang.String matchedDn)
Sets the lowest entry in the directory that was matched.

Parameters:
dn - the Dn of the lowest matched entry.
See Also:
getMatchedDn()

getResultCode

public org.apache.directory.shared.ldap.message.ResultCodeEnum getResultCode()
Gets the result code enumeration associated with the response. Corresponds to the resultCode field within the LDAPResult ASN.1 structure.

Returns:
the result code enum value.

setResultCode

public void setResultCode(org.apache.directory.shared.ldap.message.ResultCodeEnum resultCode)
Sets the result code enumeration associated with the response. Corresponds to the resultCode field within the LDAPResult ASN.1 structure.

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.

Returns:
the referral on REFERRAL errors, 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.

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.

Parameters:
referral - optional referral on REFERRAL errors.


Copyright © 2009-2011 Apache Software Foundation. All Rights Reserved.