/** * Creates a new LDAP exception with the provided result code. A default * message (based on the result code) will be used. * * @param resultCode The result code for this LDAP exception. */ public LDAPException(final ResultCode resultCode) { super(resultCode.getName()); this.resultCode = resultCode; matchedDN = null; diagnosticMessage = null; referralURLs = NO_REFERRALS; responseControls = NO_CONTROLS; }
/** * Creates a new LDAP exception with the provided result code. A default * message (based on the result code) will be used. * * @param resultCode The result code for this LDAP exception. */ public LDAPException(final ResultCode resultCode) { super(resultCode.getName()); this.resultCode = resultCode; matchedDN = null; diagnosticMessage = null; referralURLs = NO_REFERRALS; responseControls = NO_CONTROLS; }
/** * Creates a new LDAP exception with the provided result code. A default * message (based on the result code) will be used. * * @param resultCode The result code for this LDAP exception. * @param cause The underlying exception that triggered this exception. */ public LDAPException(final ResultCode resultCode, final Throwable cause) { super(resultCode.getName(), cause); this.resultCode = resultCode; matchedDN = null; diagnosticMessage = null; referralURLs = NO_REFERRALS; responseControls = NO_CONTROLS; }
/** * Creates a new LDAP exception with the provided result code. A default * message (based on the result code) will be used. * * @param resultCode The result code for this LDAP exception. * @param cause The underlying exception that triggered this exception. */ public LDAPException(final ResultCode resultCode, final Throwable cause) { super(resultCode.getName(), cause); this.resultCode = resultCode; matchedDN = null; diagnosticMessage = null; referralURLs = NO_REFERRALS; responseControls = NO_CONTROLS; }
/** * 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(); }
/** * 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(); }
buffer.append(resultCode.getName());
String message = ldapCode.getName();
message = ldapCode.getName(); // try alternative
throw new PersistenceException("LDAP delete of " + dn + " failed: " + resultCode.getName());
throw new PersistenceException("LDAP add for " + entry.getDN() + " failed: " + resultCode.getName());
throw new PersistenceException("LDAP add for " + entry.getDN() + " failed: " + resultCode.getName());
throw new PersistenceException("LDAP delete of " + dn + " failed: " + resultCode.getName());
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. */ public LDAPException(final LDAPResult ldapResult) { super((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. * @param cause The underlying exception that triggered this exception. */ public LDAPException(final LDAPResult ldapResult, final Throwable cause) { super(((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()), cause); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. * @param cause The underlying exception that triggered this exception. */ public LDAPException(final LDAPResult ldapResult, final Throwable cause) { super(((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()), cause); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP result object. * * @param ldapResult The LDAP result object containing the information to * use for this LDAP exception. */ public LDAPException(final LDAPResult ldapResult) { super((ldapResult.getDiagnosticMessage() == null) ? ldapResult.getResultCode().getName() : ldapResult.getDiagnosticMessage()); resultCode = ldapResult.getResultCode(); matchedDN = ldapResult.getMatchedDN(); diagnosticMessage = ldapResult.getDiagnosticMessage(); referralURLs = ldapResult.getReferralURLs(); responseControls = ldapResult.getResponseControls(); }