Class ResultCode

  • All Implemented Interfaces:
    java.io.Serializable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class ResultCode
    extends java.lang.Object
    implements java.io.Serializable
    This class defines a number of constants associated with LDAP result codes. The ResultCode constant values defined in this class are immutable, and at most one result code object will ever be created for a given int value, so it is acceptable to compare result codes with either the equals(java.lang.Object) method or the "==" operator.

    The result codes that are currently defined include:
    Name Integer Value
    SUCCESS 0
    OPERATIONS_ERROR 1
    PROTOCOL_ERROR 2
    TIME_LIMIT_EXCEEDED 3
    SIZE_LIMIT_EXCEEDED 4
    COMPARE_FALSE 5
    COMPARE_TRUE 6
    AUTH_METHOD_NOT_SUPPORTED 7
    STRONG_AUTH_REQUIRED 8
    REFERRAL 10
    ADMIN_LIMIT_EXCEEDED 11
    UNAVAILABLE_CRITICAL_EXTENSION 12
    CONFIDENTIALITY_REQUIRED 13
    SASL_BIND_IN_PROGRESS 14
    NO_SUCH_ATTRIBUTE 16
    UNDEFINED_ATTRIBUTE_TYPE 17
    INAPPROPRIATE_MATCHING 18
    CONSTRAINT_VIOLATION 19
    ATTRIBUTE_OR_VALUE_EXISTS 20
    INVALID_ATTRIBUTE_SYNTAX 21
    NO_SUCH_OBJECT 32
    ALIAS_PROBLEM 33
    INVALID_DN_SYNTAX 34
    ALIAS_DEREFERENCING_PROBLEM 36
    INAPPROPRIATE_AUTHENTICATION 48
    INVALID_CREDENTIALS 49
    INSUFFICIENT_ACCESS_RIGHTS 50
    BUSY 51
    UNAVAILABLE 52
    UNWILLING_TO_PERFORM 53
    LOOP_DETECT 54
    SORT_CONTROL_MISSING 60
    OFFSET_RANGE_ERROR 61
    NAMING_VIOLATION 64
    OBJECT_CLASS_VIOLATION 65
    NOT_ALLOWED_ON_NONLEAF 66
    NOT_ALLOWED_ON_NONLEAF 66
    NOT_ALLOWED_ON_RDN 67
    ENTRY_ALREADY_EXISTS 68
    OBJECT_CLASS_MODS_PROHIBITED 69
    AFFECTS_MULTIPLE_DSAS 71
    VIRTUAL_LIST_VIEW_ERROR 76
    OTHER 80
    SERVER_DOWN 81
    LOCAL_ERROR 82
    ENCODING_ERROR 83
    DECODING_ERROR 84
    TIMEOUT 85
    AUTH_UNKNOWN 86
    FILTER_ERROR 87
    USER_CANCELED 88
    PARAM_ERROR 89
    NO_MEMORY 90
    CONNECT_ERROR 91
    NOT_SUPPORTED 92
    CONTROL_NOT_FOUND 93
    NO_RESULTS_RETURNED 94
    MORE_RESULTS_TO_RETURN 95
    CLIENT_LOOP 96
    REFERRAL_LIMIT_EXCEEDED 97
    CANCELED 118
    NO_SUCH_OPERATION 119
    TOO_LATE 120
    CANNOT_CANCEL 121
    ASSERTION_FAILED 122
    AUTHORIZATION_DENIED 123
    E_SYNC_REFRESH_REQUIRED 4096
    NO_OPERATION 16654
    INTERACTIVE_TRANSACTION_ABORTED 30221001
    DATABASE_LOCK_CONFLICT 30221002
    MIRRORED_SUBTREE_DIGEST_MISMATCH 30221003
    TOKEN_DELIVERY_MECHANISM_UNAVAILABLE 30221004
    TOKEN_DELIVERY_ATTEMPT_FAILED 30221005
    TOKEN_DELIVERY_INVALID_RECIPIENT_ID 30221006
    TOKEN_DELIVERY_INVALID_ACCOUNT_STATE 30221007
    See Also:
    Serialized Form
    • Method Detail

      • getName

        @NotNull
        public java.lang.String getName()
        Retrieves the name for this result code.
        Returns:
        The name for this result code.
      • intValue

        public int intValue()
        Retrieves the integer value for this result code.
        Returns:
        The integer value for this result code.
      • valueOf

        @NotNull
        public static ResultCode valueOf​(int intValue)
        Retrieves the result code with the specified integer value. If the provided integer value does not correspond to a predefined ResultCode object, then a new ResultCode object will be created and returned. Any new result codes created will also be cached and returned for any subsequent requests with that integer value so the same object will always be returned for a given integer value.
        Parameters:
        intValue - The integer value for which to retrieve the corresponding result code.
        Returns:
        The result code with the specified integer value, or a new result code
      • valueOf

        @NotNull
        public static ResultCode valueOf​(int intValue,
                                         @Nullable
                                         java.lang.String name)
        Retrieves the result code with the specified integer value. If the provided integer value does not correspond to a predefined ResultCode object, then a new ResultCode object will be created and returned. Any new result codes created will also be cached and returned for any subsequent requests with that integer value so the same object will always be returned for a given integer value.
        Parameters:
        intValue - The integer value for which to retrieve the corresponding result code.
        name - The user-friendly name to use for the result code if no result code has been previously accessed with the same integer value. It may be null if this is not known or a string representation of the integer value should be used.
        Returns:
        The result code with the specified integer value, or a new result code
      • valueOf

        @Nullable
        public static ResultCode valueOf​(int intValue,
                                         @Nullable
                                         java.lang.String name,
                                         boolean createNewResultCode)
        Retrieves the result code with the specified integer value. If the provided integer value does not correspond to an already-defined ResultCode object, then this method may optionally create and return a new ResultCode. Any new result codes created will also be cached and returned for any subsequent requests with that integer value so the same object will always be returned for a given integer value.
        Parameters:
        intValue - The integer value for which to retrieve the corresponding result code.
        name - The user-friendly name to use for the result code if no result code has been previously accessed with the same integer value. It may be null if this is not known or a string representation of the integer value should be used.
        createNewResultCode - Indicates whether to create a new result code object with the specified integer value and name if that value does not correspond to any already-defined result code.
        Returns:
        The existing result code with the specified integer value if one already existed, a newly-created result code with the specified name and integer value if none already existed but createNewResultCode is true, or null if no result code already existed with the specified integer value and createNewResultCode is false.
      • values

        @NotNull
        public static ResultCode[] values()
        Retrieves an array of all result codes defined in the LDAP SDK. This will not include dynamically-generated values.
        Returns:
        An array of all result codes defined in the LDAP SDK.
      • isClientSideResultCode

        public boolean isClientSideResultCode()
        Indicates whether this result code is one that should be used for client-side errors rather than returned by the server.
        Returns:
        true if this result code is a client-side result code, or false if it is one that may be returned by the server.
      • isClientSideResultCode

        public static boolean isClientSideResultCode​(@NotNull
                                                     ResultCode resultCode)
        Indicates whether the provided result code is one that should be used for client-side errors rather than returned by the server.
        Parameters:
        resultCode - The result code for which to make the determination.
        Returns:
        true if the provided result code is a client-side result code, or false if it is one that may be returned by the server.
      • isConnectionUsable

        public boolean isConnectionUsable()
        Indicates whether the connection on which this result code was received is likely still usable. Note that this is a best guess, and it may or may not be correct. It will attempt to be conservative so that a connection is more likely to be classified as unusable when it may still be valid than to be classified as usable when that is no longer the case.
        Returns:
        true if it is likely that the connection on which this result code was received is still usable, or false if it may no longer be valid.
      • isConnectionUsable

        public static boolean isConnectionUsable​(@NotNull
                                                 ResultCode resultCode)
        Indicates whether the connection on which the provided result code was received is likely still usable. Note that this is a best guess based on the provided result code, and it may or may not be correct. It will attempt to be conservative so that a connection is more likely to be classified as unusable when it may still be valid than to be classified as usable when that is no longer the case.
        Parameters:
        resultCode - The result code for which to make the determination.
        Returns:
        true if it is likely that the connection on which the provided result code was received is still usable, or false if it may no longer be valid.
      • hashCode

        public int hashCode()
        The hash code for this result code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code for this result code.
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object o)
        Indicates whether the provided object is equal to this result code.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The object for which to make the determination.
        Returns:
        true if the provided object is a result code that is equal to this result code, or false if not.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this result code.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this result code.