/** * Retrieves the result code with the specified integer value. If the * provided integer value does not correspond to a predefined * {@code ResultCode} object, then a new {@code 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. * * @param intValue The integer value for which to retrieve the corresponding * result code. * * @return The result code with the specified integer value, or a new result * code */ public static ResultCode valueOf(final int intValue) { return valueOf(intValue, null); }
/** * Retrieves the result code with the specified integer value. If the * provided integer value does not correspond to a predefined * {@code ResultCode} object, then a new {@code 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. * * @param intValue The integer value for which to retrieve the corresponding * result code. * * @return The result code with the specified integer value, or a new result * code */ public static ResultCode valueOf(final int intValue) { return valueOf(intValue, null); }
/** * Retrieves a string representation of the result code for this LDAP * exception. * * @return A string representation of the result code for this LDAP * exception. */ public String errorCodeToString() { return ResultCode.valueOf(resultCode).getName(); }
/** * Retrieves a string representation of the result code for this LDAP * exception. * * @param l The locale for the string representation. * * @return A string representation of the result code for this LDAP * exception. */ public String errorCodeToString(final Locale l) { return ResultCode.valueOf(resultCode).getName(); }
/** * Retrieves a string representation of the result code for this LDAP * exception. * * @param code The result code for which to retrieve the corresponding * message. * * @return A string representation of the result code for this LDAP * exception. */ public static String errorCodeToString(final int code) { return ResultCode.valueOf(code).getName(); }
/** * Retrieves a string representation of the result code for this LDAP * exception. * * @param code The result code for which to retrieve the corresponding * message. * @param locale The locale for the string representation. * * @return A string representation of the result code for this LDAP * exception. */ public static String errorCodeToString(final int code, final Locale locale) { return ResultCode.valueOf(code).getName(); }
/** * Creates a extended result from this protocol op. * * @param controls The set of controls to include in the extended result. * It may be empty or {@code null} if no controls should be * included. * * @return The extended result that was created. */ public ExtendedResult toExtendedResult(final Control... controls) { final String[] referralArray = new String[referralURLs.size()]; referralURLs.toArray(referralArray); return new ExtendedResult(-1, ResultCode.valueOf(resultCode), diagnosticMessage, matchedDN, referralArray, responseOID, responseValue, controls); }
/** * Creates a extended result from this protocol op. * * @param controls The set of controls to include in the extended result. * It may be empty or {@code null} if no controls should be * included. * * @return The extended result that was created. */ public ExtendedResult toExtendedResult(final Control... controls) { final String[] referralArray = new String[referralURLs.size()]; referralURLs.toArray(referralArray); return new ExtendedResult(-1, ResultCode.valueOf(resultCode), diagnosticMessage, matchedDN, referralArray, responseOID, responseValue, controls); }
/** * Creates a new LDAP result object from this response protocol op. * * @param controls The set of controls to include in the LDAP result. It * may be empty or {@code null} if no controls should be * included. * * @return The LDAP result that was created. */ public BindResult toBindResult(final Control... controls) { final String[] refs; if (referralURLs.isEmpty()) { refs = NO_STRINGS; } else { refs = new String[referralURLs.size()]; referralURLs.toArray(refs); } return new BindResult(-1, ResultCode.valueOf(resultCode), diagnosticMessage, matchedDN, refs, controls, serverSASLCredentials); }
/** * Creates a new LDAP result object from this response protocol op. * * @param controls The set of controls to include in the LDAP result. It * may be empty or {@code null} if no controls should be * included. * * @return The LDAP result that was created. */ public BindResult toBindResult(final Control... controls) { final String[] refs; if (referralURLs.isEmpty()) { refs = NO_STRINGS; } else { refs = new String[referralURLs.size()]; referralURLs.toArray(refs); } return new BindResult(-1, ResultCode.valueOf(resultCode), diagnosticMessage, matchedDN, refs, controls, serverSASLCredentials); }
/** * Creates a new LDAP result object from this response protocol op. * * @param controls The set of controls to include in the LDAP result. It * may be empty or {@code null} if no controls should be * included. * * @return The LDAP result that was created. */ public LDAPResult toLDAPResult(final Control... controls) { final String[] refs; if (referralURLs.isEmpty()) { refs = NO_STRINGS; } else { refs = new String[referralURLs.size()]; referralURLs.toArray(refs); } return new LDAPResult(-1, ResultCode.valueOf(resultCode), diagnosticMessage, matchedDN, refs, controls); }
/** * Creates a new LDAP result object from this response protocol op. * * @param controls The set of controls to include in the LDAP result. It * may be empty or {@code null} if no controls should be * included. * * @return The LDAP result that was created. */ public LDAPResult toLDAPResult(final Control... controls) { final String[] refs; if (referralURLs.isEmpty()) { refs = NO_STRINGS; } else { refs = new String[referralURLs.size()]; referralURLs.toArray(refs); } return new LDAPResult(-1, ResultCode.valueOf(resultCode), diagnosticMessage, matchedDN, refs, controls); }
/** * Determines the appropriate message to use for this LDAP exception. * * @param message The message for this exception, if available. * @param serverErrorMessage The error message received from the server, if * available. * @param resultCode The result code for this exception. * * @return The appropriate message to use for this LDAP exception. */ private static String getMessage(final String message, final String serverErrorMessage, final int resultCode) { if ((message != null) && (message.length() > 0)) { return message; } if ((serverErrorMessage != null) && (serverErrorMessage.length() > 0)) { return serverErrorMessage; } return ResultCode.valueOf(resultCode).getName(); }
/** * Retrieves an {@link com.unboundid.ldap.sdk.LDAPException} object that is * the equivalent of this LDAP exception. * * @return The {@code LDAPException} object that is the equivalent of this * LDAP exception. */ public final com.unboundid.ldap.sdk.LDAPException toLDAPException() { return new com.unboundid.ldap.sdk.LDAPException( ResultCode.valueOf(resultCode), getMessage(), matchedDN, null); }
final List<String> referralURLs) b.append(" Result Code: ").append(ResultCode.valueOf(resultCode)). append(EOL);
ResultCode.valueOf(modifyResponse.getResultCode()), modifyResponse.getDiagnosticMessage(), modifyResponse.getMatchedDN(), stringListToArray(modifyResponse.getReferralURLs()));
/** * Creates a new entry rebalancing result access log message from the provided * log message. * * @param m The log message to be parsed as an entry rebalancing result * access log message. */ public EntryRebalancingResultAccessLogMessage(final LogMessage m) { super(m); final Integer rcInteger = getNamedValueAsInteger("resultCode"); if (rcInteger == null) { resultCode = null; } else { resultCode = ResultCode.valueOf(rcInteger); } adminActionRequired = getNamedValue("adminActionRequired"); entriesAddedToTarget = getNamedValueAsInteger("entriesAddedToTarget"); entriesDeletedFromSource = getNamedValueAsInteger("entriesDeletedFromSource"); entriesReadFromSource = getNamedValueAsInteger("entriesReadFromSource"); errorMessage = getNamedValue("errorMessage"); sourceAltered = getNamedValueAsBoolean("sourceAltered"); targetAltered = getNamedValueAsBoolean("targetAltered"); }
ResultCode.valueOf(addResponse.getResultCode()), addResponse.getDiagnosticMessage(), addResponse.getMatchedDN(), addResponse.getReferralURLs(), responseMessage.getControls());
ResultCode.valueOf(modifyResponse.getResultCode()), modifyResponse.getDiagnosticMessage(), modifyResponse.getMatchedDN(), modifyResponse.getReferralURLs(), responseMessage.getControls());
ResultCode.valueOf(modifyDNResponse.getResultCode()), modifyDNResponse.getDiagnosticMessage(), modifyDNResponse.getMatchedDN(), modifyDNResponse.getReferralURLs(),