org.apache.directory.api.ldap.model.message
Interface LdapResult

All Known Implementing Classes:
LdapResultImpl

public interface LdapResult

LDAPv3 result structure embedded into Responses. See section 4.1.9 in RFC 4511 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. To various
  requests, servers will return responses containing the elements found
  in LDAPResult to indicate the final status of the protocol operation
  request.

 LDAPResult ::= SEQUENCE {
     resultCode         ENUMERATED {
         success                      (0),
         operationsError              (1),
         protocolError                (2),
         timeLimitExceeded            (3),
         sizeLimitExceeded            (4),
         compareFalse                 (5),
         compareTrue                  (6),
         authMethodNotSupported       (7),
         strongerAuthRequired         (8),
              -- 9 reserved --
         referral                     (10),
         adminLimitExceeded           (11),
         unavailableCriticalExtension (12),
         confidentialityRequired      (13),
         saslBindInProgress           (14),
         noSuchAttribute              (16),
         undefinedAttributeType       (17),
         inappropriateMatching        (18),
         constraintViolation          (19),
         attributeOrValueExists       (20),
         invalidAttributeSyntax       (21),
              -- 22-31 unused --
         noSuchObject                 (32),
         aliasProblem                 (33),
         invalidDNSyntax              (34),
              -- 35 reserved for undefined isLeaf --
         aliasDereferencingProblem    (36),
              -- 37-47 unused --
         inappropriateAuthentication  (48),
         invalidCredentials           (49),
         insufficientAccessRights     (50),
         busy                         (51),
         unavailable                  (52),
         unwillingToPerform           (53),
         loopDetect                   (54),
              -- 55-63 unused --
         namingViolation              (64),
         objectClassViolation         (65),
         notAllowedOnNonLeaf          (66),
         notAllowedOnRDN              (67),
         entryAlreadyExists           (68),
         objectClassModsProhibited    (69),
              -- 70 reserved for CLDAP --
         affectsMultipleDSAs          (71),
              -- 72-79 unused --
         other                        (80),
         ...  },
     matchedDN          LDAPDN,
     diagnosticMessage  LDAPString,
     referral           [3] Referral OPTIONAL }
 

Author:
Apache Directory Project

Method Summary
 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.
 

Method Detail

getResultCode

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

void setResultCode(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.

getMatchedDn

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.

Returns:
the Dn of the lowest matched entry.

setMatchedDn

void setMatchedDn(Dn dn)
Sets the lowest entry in the directory that was matched.

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

getDiagnosticMessage

String getDiagnosticMessage()
Gets the descriptive diagnostic message associated with the error code. May be null for SUCCESS, COMPARETRUE, COMPAREFALSE and REFERRAL operations.

Returns:
the descriptive diagnostic message.

setDiagnosticMessage

void setDiagnosticMessage(String diagnosticMessage)
Sets the descriptive diagnostic message associated with the error code. May be null for SUCCESS, COMPARETRUE, and COMPAREFALSE operations.

Parameters:
diagnosticMessage - the descriptive diagnostic message.

isReferral

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.

getReferral

Referral getReferral()
Gets the Referral associated with this LdapResult if the resultCode property is set to the REFERRAL ResultCodeEnum.

Returns:
the referral on REFERRAL resultCode, null on all others.

setReferral

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.

isDefaultSuccess

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.

Returns:
True if the LdapResult is SUCCESS.


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.