public enum ResultCodeEnum extends Enum<ResultCodeEnum>
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:
Enum Constant and Description |
---|
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.
|
CANCELED
This error code is returned when an operation has been canceled using
the Cancel extended operation.
|
CANNOT_CANCEL
The cannotCancel resultCode is returned if the identified operation
does not support cancelation or the cancel operation could not be
performed.
|
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.
|
E_SYNC_REFRESH_REQUIRED
The server may return this result code on the initial content poll
if it is safe to do so when it is unable to perform the operation
due to various reasons.
|
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.
|
NO_SUCH_OPERATION
This error code is returned if the server has no knowledge of
the operation requested for cancelation.
|
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.
|
TOO_LATE
The tooLate resultCode is returned to indicate that it is too late to
cancel the outstanding operation.
|
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.
|
Modifier and Type | Method and Description |
---|---|
static ResultCodeEnum |
getBestEstimate(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.
|
String |
getMessage() |
int |
getResultCode() |
static ResultCodeEnum |
getResultCode(int value)
Gets the ResultCode enum from its integer value
|
static ResultCodeEnum |
getResultCode(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.
|
int |
getValue() |
static boolean |
processResponse(ResultResponse response)
Process the response, throwing the associated exception if needed.
|
static ResultCodeEnum |
valueOf(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 are declared.
|
public static final ResultCodeEnum SUCCESS
public static final ResultCodeEnum PARTIAL_RESULTS
public static final ResultCodeEnum COMPARE_FALSE
public static final ResultCodeEnum COMPARE_TRUE
public static final ResultCodeEnum REFERRAL
public static final ResultCodeEnum SASL_BIND_IN_PROGRESS
public static final ResultCodeEnum AUTH_METHOD_NOT_SUPPORTED
public static final ResultCodeEnum STRONG_AUTH_REQUIRED
public static final ResultCodeEnum CONFIDENTIALITY_REQUIRED
public static final ResultCodeEnum ALIAS_DEREFERENCING_PROBLEM
public static final ResultCodeEnum INAPPROPRIATE_AUTHENTICATION
public static final ResultCodeEnum INVALID_CREDENTIALS
public static final ResultCodeEnum INSUFFICIENT_ACCESS_RIGHTS
public static final ResultCodeEnum OPERATIONS_ERROR
public static final ResultCodeEnum PROTOCOL_ERROR
public static final ResultCodeEnum TIME_LIMIT_EXCEEDED
public static final ResultCodeEnum SIZE_LIMIT_EXCEEDED
public static final ResultCodeEnum ADMIN_LIMIT_EXCEEDED
public static final ResultCodeEnum UNAVAILABLE_CRITICAL_EXTENSION
public static final ResultCodeEnum BUSY
public static final ResultCodeEnum UNAVAILABLE
public static final ResultCodeEnum UNWILLING_TO_PERFORM
public static final ResultCodeEnum LOOP_DETECT
public static final ResultCodeEnum NO_SUCH_ATTRIBUTE
public static final ResultCodeEnum UNDEFINED_ATTRIBUTE_TYPE
public static final ResultCodeEnum INAPPROPRIATE_MATCHING
public static final ResultCodeEnum CONSTRAINT_VIOLATION
public static final ResultCodeEnum ATTRIBUTE_OR_VALUE_EXISTS
public static final ResultCodeEnum INVALID_ATTRIBUTE_SYNTAX
public static final ResultCodeEnum NO_SUCH_OBJECT
public static final ResultCodeEnum ALIAS_PROBLEM
public static final ResultCodeEnum INVALID_DN_SYNTAX
public static final ResultCodeEnum NAMING_VIOLATION
public static final ResultCodeEnum OBJECT_CLASS_VIOLATION
public static final ResultCodeEnum NOT_ALLOWED_ON_NON_LEAF
public static final ResultCodeEnum NOT_ALLOWED_ON_RDN
public static final ResultCodeEnum ENTRY_ALREADY_EXISTS
public static final ResultCodeEnum OBJECT_CLASS_MODS_PROHIBITED
public static final ResultCodeEnum AFFECTS_MULTIPLE_DSAS
public static final ResultCodeEnum OTHER
public static final ResultCodeEnum CANCELED
public static final ResultCodeEnum NO_SUCH_OPERATION
public static final ResultCodeEnum TOO_LATE
public static final ResultCodeEnum CANNOT_CANCEL
public static final ResultCodeEnum E_SYNC_REFRESH_REQUIRED
public static final ResultCodeEnum UNKNOWN
public static ResultCodeEnum[] values()
for (ResultCodeEnum c : ResultCodeEnum.values()) System.out.println(c);
public static ResultCodeEnum valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getValue()
public String getMessage()
public int getResultCode()
public static ResultCodeEnum getResultCode(int value)
value
- the ResultCode numneric valuepublic static ResultCodeEnum getBestEstimate(Throwable t, MessageTypeEnum type)
OTHER
is returned.t
- the throwable to estimate a result code fortype
- the type of operation being performedpublic static ResultCodeEnum getResultCode(Throwable t)
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.
t
- The exception for which we need a ResultCodeEnumpublic static boolean processResponse(ResultResponse response) throws LdapException
response
- The response to processLdapException
- The associated exceptionCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.