org.apache.directory.shared.ldap.message
Enum ResultCodeEnum

java.lang.Object
  extended by java.lang.Enum<ResultCodeEnum>
      extended by org.apache.directory.shared.ldap.message.ResultCodeEnum
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ResultCodeEnum>

public enum ResultCodeEnum
extends java.lang.Enum<ResultCodeEnum>

Type safe LDAP message envelope result code enumeration. The resultCode is a parameter of the LDAPResult which 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. This enumeration represents the various status codes associated with an LDAPResult, hence it is called the ResultCodeEnum. Here are the definitions and values for error codes from section 4.1.10 of RFC 2251:


     resultCode
        ENUMERATED {
           success                      (0),
           operationsError              (1),
           protocolError                (2),
           timeLimitExceeded            (3),
           sizeLimitExceeded            (4),
           compareFalse                 (5),
           compareTrue                  (6),
           authMethodNotSupported       (7),
           strongAuthRequired           (8),
           partialResults               (9),   -- new
           referral                     (10),  -- new
           adminLimitExceeded           (11),  -- new
           unavailableCriticalExtension (12),  -- new
           confidentialityRequired      (13),  -- new
           saslBindInProgress           (14),  -- new
           noSuchAttribute              (16),
           undefinedAttributeType       (17),
           inappropriateMatching        (18),
           constraintViolation          (19),
           attributeOrValueExists       (20),
           invalidAttributeSyntax       (21),
           -- 22-31 unused --
           NO_SUCH_OBJECT                 (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), -- new
           -- 72-79 unused --
           other                        (80) },
           -- 81-90 reserved for APIs --
 
All the result codes with the exception of success, compareFalse and compareTrue are to be treated as meaning the operation could not be completed in its entirety. Most of the result codes are based on problem indications from X.511 error data types. Result codes from 16 to 21 indicate an AttributeProblem, codes 32, 33, 34 and 36 indicate a NameProblem, codes 48, 49 and 50 indicate a SecurityProblem, codes 51 to 54 indicate a ServiceProblem, and codes 64 to 69 and 71 indicates an UpdateProblem. If a client receives a result code which is not listed above, it is to be treated as an unknown error condition. The majority of this javadoc was pasted in from RFC 2251. There's and expired draft out there on error codes which makes alot of sense: ietf (expired) draft on error codes (read at your discretion). Result codes have been identified and split into categories: The result codes are also grouped according to the following LDAP operations which return responses:

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

Enum Constant Summary
ADMIN_LIMIT_EXCEEDED
          The server has reached some limit set by an administrative authority, and no partial results are available to return to the user [X511, Section 12.8].
AFFECTS_MULTIPLE_DSAS
          This error code should be returned to indicate that the operation could not be performed since it affects more than one DSA.
ALIAS_DEREFERENCING_PROBLEM
          An alias was encountered in a situation where it was not allowed or where access was denied [X511, Section 12.5].
ALIAS_PROBLEM
          An alias has been dereferenced which names no object [X511, Section 12.5] Applicable operations: Search.
ATTRIBUTE_OR_VALUE_EXISTS
          This error should be returned by the server if the value specified by the client already exists within the attribute.
AUTH_METHOD_NOT_SUPPORTED
          This error code should be returned if the client requests, in a Bind request, an authentication method which is not supported or recognized by the server.
BUSY
          This error code may be returned if the server is unable to process the client's request at this time.
COMPARE_FALSE
          It is used to indicate that the result of a Compare operation is FALSE and does not indicate an error.
COMPARE_TRUE
          It is used to indicate that the result of a Compare operation is TRUE and does not indicate an error.
CONFIDENTIALITY_REQUIRED
          This error code may be returned if the session is not protected by a protocol which provides session confidentiality.
CONSTRAINT_VIOLATION
          This error should be returned by the server if an attribute value specified by the client violates the constraints placed on the attribute as it was defined in the DSA - this may be a size constraint or a constraint on the content.
ENTRY_ALREADY_EXISTS
          This error should be returned by the server when the client attempts to add an entry which already exists, or if the client attempts to rename an entry with the name of an entry which exists.
INAPPROPRIATE_AUTHENTICATION
          This error should be returned by the server when the client has tried to use a method of authentication that is inappropriate, that is a method of authentication which the client is unable to use correctly.
INAPPROPRIATE_MATCHING
          An attempt was made, e.g., in a filter, to use a matching rule not defined for the attribute type concerned [X511, Section 12.4].
INSUFFICIENT_ACCESS_RIGHTS
          The requestor does not have the right to carry out the requested operation [X511, Section 12.7].
INVALID_ATTRIBUTE_SYNTAX
          This error should be returned by the server if the attribute syntax for the attribute value, specified as an argument of the operation, is unrecognized or invalid.
INVALID_CREDENTIALS
          This error code is returned if the DN or password used in a simple bind operation is incorrect, or if the DN or password is incorrect for some other reason, e.g.
INVALID_DN_SYNTAX
          This error should be returned by the server if the DN syntax is incorrect.
LOOP_DETECT
          This error may be returned by the server if it detects an alias or referral loop, and is unable to satisfy the client's request.
NAMING_VIOLATION
          The attempted addition or modification would violate the structure rules of the DIT as defined in the directory schema and X.501.
NO_SUCH_ATTRIBUTE
          This error may be returned if the attribute specified as an argument of the operation does not exist in the entry.
NO_SUCH_OBJECT
          This error should only be returned if the target object cannot be found.
NOT_ALLOWED_ON_NON_LEAF
          This error should be returned if the client attempts to perform an operation which is permitted only on leaf entries - e.g., if the client attempts to delete a non-leaf entry.
NOT_ALLOWED_ON_RDN
          The attempted operation would affect the RDN (e.g., removal of an attribute which is a part of the RDN) [X511, Section 12.9].
OBJECT_CLASS_MODS_PROHIBITED
          An operation attempted to modify an object class that should not be modified, e.g., the structural object class of an entry.
OBJECT_CLASS_VIOLATION
          This error should be returned if the operation requested by the user would violate the objectClass requirements for the entry if carried out.
OPERATIONS_ERROR
          If the server requires that the client bind before browsing or modifying the directory, the server MAY reject a request other than binding, unbinding or an extended request with the "operationsError" result.
OTHER
          This error code should be returned only if no other error code is suitable.
PARTIAL_RESULTS
          Servers sends this result code to LDAP v2 clients to refer them to another LDAP server.
PROTOCOL_ERROR
          A protocol error should be returned by the server when an invalid or malformed request is received from the client.
REFERRAL
          Rather than indicating an error, this result code is used to indicate that the server does not hold the target entry of the request but is able to provide alternative servers that may.
SASL_BIND_IN_PROGRESS
          This result code is not an error response from the server, but rather, is a request for bind continuation.
SIZE_LIMIT_EXCEEDED
          This error should be returned when the number of results generated by a search exceeds the maximum number of results specified by either the client or the server.
STRONG_AUTH_REQUIRED
          This error may be returned on a bind request if the server only accepts strong authentication or it may be returned when a client attempts an operation which requires the client to be strongly authenticated - for example Delete.
SUCCESS
          It is returned when the client operation completed successfully without errors.
TIME_LIMIT_EXCEEDED
          This error should be returned when the time to perform an operation has exceeded either the time limit specified by the client (which may only be set by the client in a search operation) or the limit specified by the server.
UNAVAILABLE
          This error code is returned when the server is unavailable to process the client's request.
UNAVAILABLE_CRITICAL_EXTENSION
          The server was unable to satisfy the request because one or more critical extensions were not available [X511, Section 12.8].
UNDEFINED_ATTRIBUTE_TYPE
          This error may be returned if the specified attribute is unrecognized by the server, since it is not present in the server's defined schema.
UNKNOWN
          A unknown result code to cover all the other cases
UNWILLING_TO_PERFORM
          This error code should be returned by the server when a client request is properly formed but which the server is unable to complete due to server-defined restrictions.
 
Field Summary
static java.util.Set<ResultCodeEnum> ADD_CODES
          A set of result code enumerations that may result from add operations.
static java.util.Set<ResultCodeEnum> ALL_CODES
          Set of all result code enumerations.
static java.util.Set<ResultCodeEnum> ATTRIBUTE_CODES
          Contains the set of error codes associated with attribute problems.
static java.util.Set<ResultCodeEnum> AUTHENTICATIONNOTSUPPOERTEDEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> BIND_CODES
          A set of result code enumerations that may result from bind operations.
static java.util.Set<ResultCodeEnum> COMMON_CODES
          A set of result code enumerations common to all operations.
static java.util.Set<ResultCodeEnum> COMPARE_CODES
          A set of result code enumerations that may result from compare operations.
static java.util.Set<ResultCodeEnum> DELETE_CODES
          A set of result code enumerations that may result from delete operations.
static java.util.Set<ResultCodeEnum> EMPTY_RESULT_CODE_SET
           
static java.util.Set<ResultCodeEnum> EXTENDED_CODES
          A set of result code enumerations that could result from extended operations.
static java.util.Set<ResultCodeEnum> GENERAL_CODES
          This array holds the set of general error codes.
static java.util.Set<ResultCodeEnum> INVALIDATTRIBUTEVALUEEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> INVALIDNAMEEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> LIMITEXCEEDEDEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> MODIFY_CODES
          A set of result code enumerations that may result from modify operations.
static java.util.Set<ResultCodeEnum> MODIFYDN_CODES
          A set of result code enumerations resulting from modifyDn operations.
static java.util.Set<ResultCodeEnum> NAME_CODES
          Stores the set of error codes associated with name problems.
static java.util.Set<ResultCodeEnum> NAMINGEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a NamingException.
static java.util.Set<ResultCodeEnum> NON_ERRONEOUS_CODES
          Five result codes that may be returned in LDAPResult are not used to indicate an error.
static java.util.Set<ResultCodeEnum> OPERATIONNOTSUPPOERTEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> PARTIAL_RESULTSEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> SCHEMAVIOLATIONEXCEPTION_CODES
          A set of ResultCodes containing those that may correspond to a SchemaViolationException.
static java.util.Set<ResultCodeEnum> SEARCH_CODES
          A set of result code enumerations that may result from search operations.
static java.util.Set<ResultCodeEnum> SECURITY_CODES
          Stores all the result codes associated with security related problems.
static java.util.Set<ResultCodeEnum> SERVICE_CODES
          A service error reports a problem related to the provision of the service [X511, Section 12.8].
static java.util.Set<ResultCodeEnum> SERVICEUNAVAILABLE_CODES
          A set of ResultCodes containing those that may correspond to a Exception.
static java.util.Set<ResultCodeEnum> UPDATE_CODES
          An update error reports problems related to attempts to add, delete, or modify information in the DIB [X511, Section 12.9].
 
Method Summary
static java.util.Set<ResultCodeEnum> getAddCodes()
          Gets an array of result code enumerations resulting from add operations.
static java.util.Set<ResultCodeEnum> getAllCodes()
          Gets all of the result code enumerations defined.
static java.util.Set<ResultCodeEnum> getAttributeCodes()
          Gets an array of result code enumerations that report a problem related to an attribute specified by the client in their request message..
static ResultCodeEnum getBestEstimate(java.lang.Throwable t, MessageTypeEnum type)
          Takes a guess at the result code to use if it cannot figure it out from known Throwable to result code mappings.
static java.util.Set<ResultCodeEnum> getBindCodes()
          Gets an array of result code enumerations resulting from bind operations.
static java.util.Set<ResultCodeEnum> getCommonCodes()
          Gets an array of result code enumerations common to all operations.
static java.util.Set<ResultCodeEnum> getCompareCodes()
          Gets an array of result code enumerations resulting from compare operations.
static java.util.Set<ResultCodeEnum> getDeleteCodes()
          Gets an array of result code enumerations resulting from delete operations.
static java.util.Set<ResultCodeEnum> getExtendedCodes()
          Gets an array of result code enumerations resulting from extended operations.
static java.util.Set<ResultCodeEnum> getGeneralCodes()
          Gets the set of general error codes.
static java.util.Set<ResultCodeEnum> getModifyCodes()
          Gets an array of result code enumerations resulting from modify operations.
static java.util.Set<ResultCodeEnum> getModifyDnCodes()
          Gets an array of result code enumerations resulting from modifyDn operations.
static java.util.Set<ResultCodeEnum> getNameCodes()
          Gets an array of result code enumerations that report a problem related to a distinguished name provided as an argument to a request message.
static java.util.Set<ResultCodeEnum> getNonErroneousCodes()
          Gets the set of result code enumerations that do not represent operational failures.
 int getResultCode()
           
static ResultCodeEnum getResultCode(int value)
           
static ResultCodeEnum getResultCode(java.lang.Throwable t)
          Gets an LDAP result code from a Throwable if it can resolve it unambiguously or returns null if it cannot resolve the exception to a single ResultCode.
static java.util.Set<ResultCodeEnum> getResultCodes(java.lang.Throwable t)
          Gets the set of result codes a Throwable may map to.
static java.util.Set<ResultCodeEnum> getSearchCodes()
          Gets an array of result code enumerations resulting from search operations.
static java.util.Set<ResultCodeEnum> getSecurityCodes()
          Gets an array of result code enumerations that report a problem related to a problem in carrying out an operation for security reasons.
static java.util.Set<ResultCodeEnum> getServiceCodes()
          Gets an array of result code enumerations that report a problem related to the provision of the service.
static java.util.Set<ResultCodeEnum> getUpdateCodes()
          Gets an array of result code enumerations that reports problems related to attempts to add, delete, or modify information in the DIB.
 int getValue()
           
static ResultCodeEnum valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ResultCodeEnum[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SUCCESS

public static final ResultCodeEnum SUCCESS
It is returned when the client operation completed successfully without errors. This code is one of 5 result codes that may be returned in the LDAPResult which are not used to indicate an error. Applicable operations: all except for Compare. Result code type: Non-Erroneous


PARTIAL_RESULTS

public static final ResultCodeEnum PARTIAL_RESULTS
Servers sends this result code to LDAP v2 clients to refer them to another LDAP server. When sending this code to a client, the server includes a newline-delimited list of LDAP URLs that identify another LDAP server. If the client identifies itself as an LDAP v3 client in the request, servers send an REFERRAL result code instead of this result code.


COMPARE_FALSE

public static final ResultCodeEnum COMPARE_FALSE
It is used to indicate that the result of a Compare operation is FALSE and does not indicate an error. 1 of 5 codes that do not indicate an error condition. Applicable operations: Compare. Result code type: Non-Erroneous


COMPARE_TRUE

public static final ResultCodeEnum COMPARE_TRUE
It is used to indicate that the result of a Compare operation is TRUE and does not indicate an error. 1 of 5 codes that do not indicate an error condition. Applicable operations: Compare. Result code type: Non-Erroneous


REFERRAL

public static final ResultCodeEnum REFERRAL
Rather than indicating an error, this result code is used to indicate that the server does not hold the target entry of the request but is able to provide alternative servers that may. A set of server(s) URLs may be returned in the referral field, which the client may subsequently query to attempt to complete their operation. 1 of 5 codes that do not indicate an error condition yet requires further action on behalf of the client to complete the request. This result code is new in LDAPv3. Applicable operations: all. Result code type: Non-Erroneous


SASL_BIND_IN_PROGRESS

public static final ResultCodeEnum SASL_BIND_IN_PROGRESS
This result code is not an error response from the server, but rather, is a request for bind continuation. The server requires the client to send a new bind request, with the same SASL mechanism, to continue the authentication process [RFC2251, Section 4.2.3]. This result code is new in LDAPv3. Applicable operations: Bind. Result code type: Non-Erroneous


AUTH_METHOD_NOT_SUPPORTED

public static final ResultCodeEnum AUTH_METHOD_NOT_SUPPORTED
This error code should be returned if the client requests, in a Bind request, an authentication method which is not supported or recognized by the server. Applicable operations: Bind. Result code type: Specific (Security)


STRONG_AUTH_REQUIRED

public static final ResultCodeEnum STRONG_AUTH_REQUIRED
This error may be returned on a bind request if the server only accepts strong authentication or it may be returned when a client attempts an operation which requires the client to be strongly authenticated - for example Delete. This result code may also be returned in an unsolicited notice of disconnection if the server detects that an established underlying security association protecting communication between the client and server has unexpectedly failed or been compromised. [RFC2251, Section 4.4.1] Applicable operations: all. Result code type: Specific (Security)


CONFIDENTIALITY_REQUIRED

public static final ResultCodeEnum CONFIDENTIALITY_REQUIRED
This error code may be returned if the session is not protected by a protocol which provides session confidentiality. For example, if the client did not establish a TLS connection using a cipher suite which provides confidentiality of the session before sending any other requests, and the server requires session confidentiality then the server may reject that request with a result code of confidentialityRequired. This error code is new in LDAPv3. Applicable operations: all. Result code type: Specific (Security)


ALIAS_DEREFERENCING_PROBLEM

public static final ResultCodeEnum ALIAS_DEREFERENCING_PROBLEM
An alias was encountered in a situation where it was not allowed or where access was denied [X511, Section 12.5]. For example, if the client does not have read permission for the aliasedObjectName attribute and its value then the error aliasDereferencingProblem should be returned. [X511, Section 7.11.1.1] Notice that this error has similar meaning to INSUFFICIENT_ACCESS_RIGHTS (50), but is specific to Searching on an alias. Applicable operations: Search. Result code type: Specific (Security)


INAPPROPRIATE_AUTHENTICATION

public static final ResultCodeEnum INAPPROPRIATE_AUTHENTICATION
This error should be returned by the server when the client has tried to use a method of authentication that is inappropriate, that is a method of authentication which the client is unable to use correctly. In other words, the level of security associated with the requestor's credentials is inconsistent with the level of protection requested, e.g. simple credentials were supplied while strong credentials were required [X511, Section 12.7]. Applicable operations: Bind. Result code type: Specific (Security)


INVALID_CREDENTIALS

public static final ResultCodeEnum INVALID_CREDENTIALS
This error code is returned if the DN or password used in a simple bind operation is incorrect, or if the DN or password is incorrect for some other reason, e.g. the password has expired. This result code only applies to Bind operations -- it should not be returned for other operations if the client does not have sufficient permission to perform the requested operation - in this case the return code should be insufficientAccessRights. Applicable operations: Bind. Result code type: Specific (Security)


INSUFFICIENT_ACCESS_RIGHTS

public static final ResultCodeEnum INSUFFICIENT_ACCESS_RIGHTS
The requestor does not have the right to carry out the requested operation [X511, Section 12.7]. Note that the more specific aliasDereferencingProblem is returned in case of a Search on an alias where the requestor has insufficientAccessRights. Applicable operations: all except for Bind. Result code type: Specific (Security)


OPERATIONS_ERROR

public static final ResultCodeEnum OPERATIONS_ERROR
If the server requires that the client bind before browsing or modifying the directory, the server MAY reject a request other than binding, unbinding or an extended request with the "operationsError" result. [RFC2251, Section 4.2.1] Applicable operations: all except Bind. Result code type: Specific (Service)


PROTOCOL_ERROR

public static final ResultCodeEnum PROTOCOL_ERROR
A protocol error should be returned by the server when an invalid or malformed request is received from the client. This may be a request that is not recognized as an LDAP request, for example, if a nonexistent operation were specified in LDAPMessage. As well, it may be the result of a request that is missing a required parameter, such as a search filter in a search request. If the server can return an error, which is more specific than protocolError, then this error should be returned instead. For example if the server does not recognize the authentication method requested by the client then the error authMethodNotSupported should be returned instead of protocolError. The server may return details of the error in the error string. Applicable operations: all. Result code type: Specific (Service)


TIME_LIMIT_EXCEEDED

public static final ResultCodeEnum TIME_LIMIT_EXCEEDED
This error should be returned when the time to perform an operation has exceeded either the time limit specified by the client (which may only be set by the client in a search operation) or the limit specified by the server. If the time limit is exceeded on a search operation then the result is an arbitrary selection of the accumulated results [X511, Section 7.5]. Note that an arbitrary selection of results may mean that no results are returned to the client. If the LDAP server is a front end for an X.500 server, any operation that is chained may exceed the timelimit, therefore clients can expect to receive timelimitExceeded for all operations. For stand alone LDAP- Servers that do not implement chaining it is unlikely that operations other than search operations will exceed the defined timelimit. Applicable operations: all. Result code type: Specific (Service)


SIZE_LIMIT_EXCEEDED

public static final ResultCodeEnum SIZE_LIMIT_EXCEEDED
This error should be returned when the number of results generated by a search exceeds the maximum number of results specified by either the client or the server. If the size limit is exceeded then the results of a search operation will be an arbitrary selection of the accumulated results, equal in number to the size limit [X511, Section 7.5]. Applicable operations: Search. Result code type: Specific (Service)


ADMIN_LIMIT_EXCEEDED

public static final ResultCodeEnum ADMIN_LIMIT_EXCEEDED
The server has reached some limit set by an administrative authority, and no partial results are available to return to the user [X511, Section 12.8]. For example, there may be an administrative limit to the number of entries a server will check when gathering potential search result candidates [Net]. This error code is new in LDAPv3. Applicable operations: all. Result code type: Specific (Service)


UNAVAILABLE_CRITICAL_EXTENSION

public static final ResultCodeEnum UNAVAILABLE_CRITICAL_EXTENSION
The server was unable to satisfy the request because one or more critical extensions were not available [X511, Section 12.8]. This error is returned, for example, when a control submitted with a request is marked critical but is not recognized by a server or when such a control is not appropriate for the operation type. [RFC2251 section 4.1.12]. This error code is new in LDAPv3. Applicable operations: all. Result code type: Specific (Service)


BUSY

public static final ResultCodeEnum BUSY
This error code may be returned if the server is unable to process the client's request at this time. This implies that if the client retries the request shortly the server will be able to process it then. Applicable operations: all. Result code type: Specific (Service)


UNAVAILABLE

public static final ResultCodeEnum UNAVAILABLE
This error code is returned when the server is unavailable to process the client's request. This usually means that the LDAP server is shutting down [RFC2251, Section 4.2.3]. Applicable operations: all. Result code type: Specific (Service)


UNWILLING_TO_PERFORM

public static final ResultCodeEnum UNWILLING_TO_PERFORM
This error code should be returned by the server when a client request is properly formed but which the server is unable to complete due to server-defined restrictions. For example, the server, or some part of it, is not prepared to execute this request, e.g. because it would lead to excessive consumption of resources or violates the policy of an Administrative Authority involved [X511, Section 12.8]. If the server is able to return a more specific error code such as adminLimitExceeded it should. This error may also be returned if the client attempts to modify attributes which can not be modified by users, e.g., operational attributes such as creatorsName or createTimestamp [X511, Section 7.12]. If appropriate, details of the error should be provided in the error message. Applicable operations: all. Result code type: Specific (Service)


LOOP_DETECT

public static final ResultCodeEnum LOOP_DETECT
This error may be returned by the server if it detects an alias or referral loop, and is unable to satisfy the client's request. Applicable operations: all. Result code type: Specific (Service)


NO_SUCH_ATTRIBUTE

public static final ResultCodeEnum NO_SUCH_ATTRIBUTE
This error may be returned if the attribute specified as an argument of the operation does not exist in the entry. Applicable operations: Modify, Compare. Result code type: Specific (Attribute)


UNDEFINED_ATTRIBUTE_TYPE

public static final ResultCodeEnum UNDEFINED_ATTRIBUTE_TYPE
This error may be returned if the specified attribute is unrecognized by the server, since it is not present in the server's defined schema. If the server doesn't recognize an attribute specified in a search request as the attribute to be returned the server should not return an error in this case - it should just return values for the requested attributes it does recognize. Note that this result code only applies to the Add and Modify operations [X.511, Section 12.4]. Applicable operations: Modify, Add. Result code type: Specific (Attribute)


INAPPROPRIATE_MATCHING

public static final ResultCodeEnum INAPPROPRIATE_MATCHING
An attempt was made, e.g., in a filter, to use a matching rule not defined for the attribute type concerned [X511, Section 12.4]. Applicable operations: Search. Result code type: Specific (Attribute)


CONSTRAINT_VIOLATION

public static final ResultCodeEnum CONSTRAINT_VIOLATION
This error should be returned by the server if an attribute value specified by the client violates the constraints placed on the attribute as it was defined in the DSA - this may be a size constraint or a constraint on the content. Applicable operations: Modify, Add, ModifyDN. Result code type: Specific (Attribute)


ATTRIBUTE_OR_VALUE_EXISTS

public static final ResultCodeEnum ATTRIBUTE_OR_VALUE_EXISTS
This error should be returned by the server if the value specified by the client already exists within the attribute. Applicable operations: Modify, Add. Result code type: Specific (Attribute)


INVALID_ATTRIBUTE_SYNTAX

public static final ResultCodeEnum INVALID_ATTRIBUTE_SYNTAX
This error should be returned by the server if the attribute syntax for the attribute value, specified as an argument of the operation, is unrecognized or invalid. Applicable operations: Modify, Add. Result code type: Specific (Attribute)


NO_SUCH_OBJECT

public static final ResultCodeEnum NO_SUCH_OBJECT
This error should only be returned if the target object cannot be found. For example, in a search operation if the search base can not be located in the DSA the server should return NO_SUCH_OBJECT. If, however, the search base is found but does not match the search filter, success, with no resultant objects, should be returned instead of NO_SUCH_OBJECT. If the LDAP server is a front end for an X.500 DSA then NO_SUCH_OBJECT may also be returned if discloseOnError is not granted for an entry and the client does not have permission to view or modify the entry. Applicable operations: all except for Bind. Result code type: Specific (Name)


ALIAS_PROBLEM

public static final ResultCodeEnum ALIAS_PROBLEM
An alias has been dereferenced which names no object [X511, Section 12.5] Applicable operations: Search. Result code type: Specific (Name)


INVALID_DN_SYNTAX

public static final ResultCodeEnum INVALID_DN_SYNTAX
This error should be returned by the server if the DN syntax is incorrect. It should not be returned if the DN is correctly formed but represents an entry which is not permitted by the structure rules at the DSA ; in this case namingViolation should be returned instead. Applicable operations: all. Result code type: Specific (Name)


NAMING_VIOLATION

public static final ResultCodeEnum NAMING_VIOLATION
The attempted addition or modification would violate the structure rules of the DIT as defined in the directory schema and X.501. That is, it would place an entry as the subordinate of an alias entry, or in a region of the DIT not permitted to a member of its object class, or would define an RDN for an entry to include a forbidden attribute type [X511, Section 12.9]. Applicable operations: Add, ModifyDN. Result code type: Specific (Update)


OBJECT_CLASS_VIOLATION

public static final ResultCodeEnum OBJECT_CLASS_VIOLATION
This error should be returned if the operation requested by the user would violate the objectClass requirements for the entry if carried out. On an add or modify operation this would result from trying to add an object class without a required attribute, or by trying to add an attribute which is not permitted by the current object class set in the entry. On a modify operation this may result from trying to remove a required attribute without removing the associated auxiliary object class, or by attempting to remove an object class while the attributes it permits are still present. Applicable operations: Add, Modify, ModifyDN. Result code type: Specific (Update)


NOT_ALLOWED_ON_NON_LEAF

public static final ResultCodeEnum NOT_ALLOWED_ON_NON_LEAF
This error should be returned if the client attempts to perform an operation which is permitted only on leaf entries - e.g., if the client attempts to delete a non-leaf entry. If the directory does not permit ModifyDN for non-leaf entries then this error may be returned if the client attempts to change the DN of a non-leaf entry. (Note that 1988 edition X.500 servers only permitted change of the RDN of an entry's DN [X.511, Section 11.4.1]). Applicable operations: Delete, ModifyDN. Result code type: Specific (Update)


NOT_ALLOWED_ON_RDN

public static final ResultCodeEnum NOT_ALLOWED_ON_RDN
The attempted operation would affect the RDN (e.g., removal of an attribute which is a part of the RDN) [X511, Section 12.9]. If the client attempts to remove from an entry any of its distinguished values, those values which form the entry's relative distinguished name the server should return the error notAllowedOnRDN. [RFC2251, Section 4.6] Applicable operations: Modify. Result code type: Specific (Update)


ENTRY_ALREADY_EXISTS

public static final ResultCodeEnum ENTRY_ALREADY_EXISTS
This error should be returned by the server when the client attempts to add an entry which already exists, or if the client attempts to rename an entry with the name of an entry which exists. Applicable operations: Add, ModifyDN. Result code type: Specific (Update)


OBJECT_CLASS_MODS_PROHIBITED

public static final ResultCodeEnum OBJECT_CLASS_MODS_PROHIBITED
An operation attempted to modify an object class that should not be modified, e.g., the structural object class of an entry. Some servers may not permit object class modifications, especially modifications to the structural object class since this may change the entry entirely, name forms, structure rules etc. [X.511, Section 12.9]. Applicable operations: Modify. Result code type: Specific (Update)


AFFECTS_MULTIPLE_DSAS

public static final ResultCodeEnum AFFECTS_MULTIPLE_DSAS
This error code should be returned to indicate that the operation could not be performed since it affects more than one DSA. This error code is new for LDAPv3. X.500 restricts the ModifyDN operation to only affect entries that are contained within a single server. If the LDAP server is mapped onto DAP, then this restriction will apply, and the resultCode affectsMultipleDSAs will be returned if this error occurred. In general clients MUST NOT expect to be able to perform arbitrary movements of entries and subtrees between servers [RFC2251, Section 4.9]. Applicable operations: ModifyDN. Result code type: Specific (Update)


OTHER

public static final ResultCodeEnum OTHER
This error code should be returned only if no other error code is suitable. Use of this error code should be avoided if possible. Details of the error should be provided in the error message. Applicable operations: all. Result code type: General


UNKNOWN

public static final ResultCodeEnum UNKNOWN
A unknown result code to cover all the other cases

Field Detail

EMPTY_RESULT_CODE_SET

public static final java.util.Set<ResultCodeEnum> EMPTY_RESULT_CODE_SET

GENERAL_CODES

public static final java.util.Set<ResultCodeEnum> GENERAL_CODES
This array holds the set of general error codes. General error codes are typically returned only when no suitable specific error exists. Specific error codes are meant to capture situations that are specific to the requested operation. A general error code typically specifies an error condition for which there is no suitable specific error code. If the server can return an error, which is more specific than the following general errors, then the specific error should be returned instead. This array only contains the OTHER error code at the present time. The set contains:


NON_ERRONEOUS_CODES

public static final java.util.Set<ResultCodeEnum> NON_ERRONEOUS_CODES
Five result codes that may be returned in LDAPResult are not used to indicate an error. The first three codes, indicate to the client that no further action is required in order to satisfy their request. In contrast, the last two errors require further action by the client in order to complete their original operation request. The set contains:


ATTRIBUTE_CODES

public static final java.util.Set<ResultCodeEnum> ATTRIBUTE_CODES
Contains the set of error codes associated with attribute problems. An attribute error reports a problem related to an attribute specified by the client in their request message. The set contains:


NAME_CODES

public static final java.util.Set<ResultCodeEnum> NAME_CODES
Stores the set of error codes associated with name problems. A name error reports a problem related to the distinguished name provided as an argument to an operation [X511, Section 12.5]. For result codes of NO_SUCH_OBJECT, 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 [X511]. The matchedDN field is to be set to a zero length string with all other result codes [RFC2251, Section 4.1.10]. The set contains:


SECURITY_CODES

public static final java.util.Set<ResultCodeEnum> SECURITY_CODES
Stores all the result codes associated with security related problems. A security error reports a problem in carrying out an operation for security reasons [X511, Section 12.7]. The set contains:


SERVICE_CODES

public static final java.util.Set<ResultCodeEnum> SERVICE_CODES
A service error reports a problem related to the provision of the service [X511, Section 12.8]. This set stores all error codes related to service problems. The set contains:


UPDATE_CODES

public static final java.util.Set<ResultCodeEnum> UPDATE_CODES
An update error reports problems related to attempts to add, delete, or modify information in the DIB [X511, Section 12.9]. This set contains the category of update errors.


COMMON_CODES

public static final java.util.Set<ResultCodeEnum> COMMON_CODES
A set of result code enumerations common to all operations. The set contains:


BIND_CODES

public static final java.util.Set<ResultCodeEnum> BIND_CODES
A set of result code enumerations that may result from bind operations. The set contains:


SEARCH_CODES

public static final java.util.Set<ResultCodeEnum> SEARCH_CODES
A set of result code enumerations that may result from search operations. The set contains:


MODIFY_CODES

public static final java.util.Set<ResultCodeEnum> MODIFY_CODES
A set of result code enumerations that may result from modify operations. The set contains:


ADD_CODES

public static final java.util.Set<ResultCodeEnum> ADD_CODES
A set of result code enumerations that may result from add operations. The set contains:


DELETE_CODES

public static final java.util.Set<ResultCodeEnum> DELETE_CODES
A set of result code enumerations that may result from delete operations. The set may contain:


MODIFYDN_CODES

public static final java.util.Set<ResultCodeEnum> MODIFYDN_CODES
A set of result code enumerations resulting from modifyDn operations. The set contains:


COMPARE_CODES

public static final java.util.Set<ResultCodeEnum> COMPARE_CODES
A set of result code enumerations that may result from compare operations. The set contains:


EXTENDED_CODES

public static final java.util.Set<ResultCodeEnum> EXTENDED_CODES
A set of result code enumerations that could result from extended operations. The set contains:


ALL_CODES

public static final java.util.Set<ResultCodeEnum> ALL_CODES
Set of all result code enumerations. The set contains:


NAMINGEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> NAMINGEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a NamingException.


AUTHENTICATIONNOTSUPPOERTEDEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> AUTHENTICATIONNOTSUPPOERTEDEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a Exception.


SERVICEUNAVAILABLE_CODES

public static final java.util.Set<ResultCodeEnum> SERVICEUNAVAILABLE_CODES
A set of ResultCodes containing those that may correspond to a Exception.


INVALIDATTRIBUTEVALUEEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> INVALIDATTRIBUTEVALUEEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a Exception.


PARTIAL_RESULTSEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> PARTIAL_RESULTSEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a Exception.


LIMITEXCEEDEDEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> LIMITEXCEEDEDEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a Exception.


OPERATIONNOTSUPPOERTEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> OPERATIONNOTSUPPOERTEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a Exception.


INVALIDNAMEEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> INVALIDNAMEEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a Exception.


SCHEMAVIOLATIONEXCEPTION_CODES

public static final java.util.Set<ResultCodeEnum> SCHEMAVIOLATIONEXCEPTION_CODES
A set of ResultCodes containing those that may correspond to a SchemaViolationException.

Method Detail

values

public static final ResultCodeEnum[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ResultCodeEnum c : ResultCodeEnum.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static ResultCodeEnum valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getValue

public int getValue()
Returns:
The value associated with the current element.

getResultCode

public int getResultCode()
Returns:
The integer associated with the result code

getResultCode

public static ResultCodeEnum getResultCode(int value)
Returns:
The integer associated with the result code

getGeneralCodes

public static java.util.Set<ResultCodeEnum> getGeneralCodes()
Gets the set of general error codes.

Returns:
array of result codes enumerations
See Also:
GENERAL_CODES

getNonErroneousCodes

public static java.util.Set<ResultCodeEnum> getNonErroneousCodes()
Gets the set of result code enumerations that do not represent operational failures.

Returns:
array of result codes enumerations
See Also:
NON_ERRONEOUS_CODES

getAttributeCodes

public static java.util.Set<ResultCodeEnum> getAttributeCodes()
Gets an array of result code enumerations that report a problem related to an attribute specified by the client in their request message..

Returns:
array of result codes enumerations
See Also:
ATTRIBUTE_CODES

getNameCodes

public static java.util.Set<ResultCodeEnum> getNameCodes()
Gets an array of result code enumerations that report a problem related to a distinguished name provided as an argument to a request message.

Returns:
array of result codes enumerations
See Also:
NAME_CODES

getSecurityCodes

public static java.util.Set<ResultCodeEnum> getSecurityCodes()
Gets an array of result code enumerations that report a problem related to a problem in carrying out an operation for security reasons.

Returns:
array of result codes enumerations
See Also:
SECURITY_CODES

getServiceCodes

public static java.util.Set<ResultCodeEnum> getServiceCodes()
Gets an array of result code enumerations that report a problem related to the provision of the service.

Returns:
array of result codes enumerations
See Also:
SERVICE_CODES

getUpdateCodes

public static java.util.Set<ResultCodeEnum> getUpdateCodes()
Gets an array of result code enumerations that reports problems related to attempts to add, delete, or modify information in the DIB.

Returns:
array of result codes enumerations
See Also:
UPDATE_CODES

getCommonCodes

public static java.util.Set<ResultCodeEnum> getCommonCodes()
Gets an array of result code enumerations common to all operations.

Returns:
an array of common operation ResultCodeEnum's
See Also:
COMMON_CODES

getBindCodes

public static java.util.Set<ResultCodeEnum> getBindCodes()
Gets an array of result code enumerations resulting from bind operations.

Returns:
an array of bind operation ResultCodeEnum's
See Also:
BIND_CODES

getSearchCodes

public static java.util.Set<ResultCodeEnum> getSearchCodes()
Gets an array of result code enumerations resulting from search operations.

Returns:
an array of search operation ResultCodeEnum's
See Also:
SEARCH_CODES

getModifyCodes

public static java.util.Set<ResultCodeEnum> getModifyCodes()
Gets an array of result code enumerations resulting from modify operations.

Returns:
an array of modify operation ResultCodeEnum's
See Also:
MODIFY_CODES

getAddCodes

public static java.util.Set<ResultCodeEnum> getAddCodes()
Gets an array of result code enumerations resulting from add operations.

Returns:
an array of add operation ResultCodeEnum's
See Also:
ADD_CODES

getDeleteCodes

public static java.util.Set<ResultCodeEnum> getDeleteCodes()
Gets an array of result code enumerations resulting from delete operations.

Returns:
an array of delete operation ResultCodeEnum's
See Also:
DELETE_CODES

getModifyDnCodes

public static java.util.Set<ResultCodeEnum> getModifyDnCodes()
Gets an array of result code enumerations resulting from modifyDn operations.

Returns:
an array of modifyDn operation ResultCodeEnum's
See Also:
MODIFYDN_CODES

getCompareCodes

public static java.util.Set<ResultCodeEnum> getCompareCodes()
Gets an array of result code enumerations resulting from compare operations.

Returns:
an array of compare operation ResultCodeEnum's
See Also:
COMPARE_CODES

getExtendedCodes

public static java.util.Set<ResultCodeEnum> getExtendedCodes()
Gets an array of result code enumerations resulting from extended operations.

Returns:
an array of extended operation ResultCodeEnum's
See Also:
EXTENDED_CODES

getAllCodes

public static java.util.Set<ResultCodeEnum> getAllCodes()
Gets all of the result code enumerations defined.

Returns:
an array of all defined result codes
See Also:
ALL_CODES

getBestEstimate

public static ResultCodeEnum getBestEstimate(java.lang.Throwable t,
                                             MessageTypeEnum type)
Takes a guess at the result code to use if it cannot figure it out from known Throwable to result code mappings. Some however are ambiguous mapping the same Throwable to multiple codes. If no code can be resolved then OTHER is returned.

Parameters:
t - the throwable to estimate a result code for
type - the type of operation being performed
Returns:
the result code or a good estimate of one

getResultCodes

public static java.util.Set<ResultCodeEnum> getResultCodes(java.lang.Throwable t)
Gets the set of result codes a Throwable may map to. If the throwable does not map to any result code at all an empty set is returned. The following Throwables and their subclasses map to result codes:
 
  Unambiguous Exceptions
  ======================
 
  CommunicationException              ==> operationsError(1)
  TimeLimitExceededException          ==> timeLimitExceeded(3)
  SizeLimitExceededException          ==> sizeLimitExceeded(4)
  AuthenticationException             ==> invalidCredentials(49)
  NoPermissionException               ==> insufficientAccessRights(50)
  NoSuchAttributeException            ==> noSuchAttribute(16)
  InvalidAttributeIdentifierException ==> undefinedAttributeType(17)
  InvalidSearchFilterException        ==> inappropriateMatching(18)
  AttributeInUseException             ==> attributeOrValueExists(20)
  NameNotFoundException               ==> NO_SUCH_OBJECT(32)
  NameAlreadyBoundException           ==> entryAlreadyExists(68)
  ContextNotEmptyException            ==> notAllowedOnNonLeaf(66)
 
 
  Ambiguous Exceptions
  ====================
 
  NamingException
  ---------------
  operationsError(1)
  aliasProblem(33)
  aliasDereferencingProblem(36)
  loopDetect(54)
  affectsMultipleDSAs(71)
  other(80)
 
  AuthenticationNotSupportedException
  -----------------------------------
  authMethodNotSupported (7)
  strongAuthRequired (8)
  confidentialityRequired (13)
  inappropriateAuthentication(48)
 
  ServiceUnavailableException
  ---------------------------
  busy(51)
  unavailable(52)
 
  InvalidAttributeValueException
  ------------------------------
  constraintViolation(19)
  invalidAttributeSyntax(21)
 
  PartialResultException
  ----------------------
  partialResults(9)
  referral(10)
 
  LimitExceededException
  ----------------------
  referal(9)
  adminLimitExceeded(11)
 
  OperationNotSupportedException
  ------------------------------
  unavailableCriticalExtention(12)
  unwillingToPerform(53)
 
  InvalidNameException
  --------------------
  invalidDNSyntax(34)
  namingViolation(64)
 
  SchemaViolationException
  ------------------------
  objectClassViolation(65)
  notAllowedOnRDN(67)
  objectClassModsProhibited(69)
 
 

Parameters:
t - the Throwable to find the result code mappings for
Returns:
the set of mapped result codes

getResultCode

public static ResultCodeEnum getResultCode(java.lang.Throwable t)
Gets an LDAP result code from a Throwable if it can resolve it unambiguously or returns null if it cannot resolve the exception to a single ResultCode. If the Throwable is an instance of LdapException this is already done for us, otherwise we use the following mapping:
 
  Unambiguous Exceptions
  ======================
 
  CommunicationException              ==> operationsError(1)
  TimeLimitExceededException          ==> timeLimitExceeded(3)
  SizeLimitExceededException          ==> sizeLimitExceeded(4)
  AuthenticationException             ==> invalidCredentials(49)
  NoPermissionException               ==> insufficientAccessRights(50)
  NoSuchAttributeException            ==> noSuchAttribute(16)
  InvalidAttributeIdentifierException ==> undefinedAttributeType(17)
  InvalidSearchFilterException        ==> inappropriateMatching(18)
  AttributeInUseException             ==> attributeOrValueExists(20)
  NameNotFoundException               ==> NO_SUCH_OBJECT(32)
  NameAlreadyBoundException           ==> entryAlreadyExists(68)
  ContextNotEmptyException            ==> notAllowedOnNonLeaf(66)
 
If we cannot find a mapping then null is returned.

Parameters:
t - The exception for which we need a ResultCodeEnum
Returns:
The ResultCodeEnum associated wit the given exception


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