/** * Retrieves the set of response controls for this LDAP exception. * * @return The set of response controls for this LDAP exception, or an empty * array if there are none. */ public Control[] getResponseControls() { return ldapException.getResponseControls(); }
/** * Retrieves the set of response controls for this LDAP exception. * * @return The set of response controls for this LDAP exception, or an empty * array if there are none. */ public Control[] getResponseControls() { return ldapException.getResponseControls(); }
/** * Sets the response controls for this connection. * * @param ldapException The exception containing the controls to use. */ private void setResponseControls( final com.unboundid.ldap.sdk.LDAPException ldapException) { if (ldapException.hasResponseControl()) { responseControls = LDAPControl.toLDAPControls(ldapException.getResponseControls()); } else { responseControls = null; } } }
/** * Ensures that the provided LDAP exception does not include any control with * the specified OID. * * @param exception The LDAP exception to examine. * @param oid The OID of the control which is not expected to be * present in the exception. * * @throws AssertionError If the provided LDAP exception includes any * control with the specified OID. */ public static void assertMissingControl(final LDAPException exception, final String oid) throws AssertionError { for (final Control c : exception.getResponseControls()) { if (c.getOID().equals(oid)) { throw new AssertionError(ERR_TEST_RESULT_HAS_CONTROL.get( StaticUtils.getExceptionMessage(exception), oid)); } } }
/** * Ensures that the provided LDAP exception includes at least one control with * the specified OID. * * @param exception The LDAP exception to examine. * @param oid The OID of the control which is expected to be present * in the exception. * * @return The first control found with the specified OID. * * @throws AssertionError If the provided LDAP exception does not include * any control with the specified OID. */ public static Control assertHasControl(final LDAPException exception, final String oid) throws AssertionError { for (final Control c : exception.getResponseControls()) { if (c.getOID().equals(oid)) { return c; } } throw new AssertionError(ERR_TEST_RESULT_MISSING_CONTROL.get( StaticUtils.getExceptionMessage(exception), oid)); }
/** * Creates a new instance of this notice of disconnection extended result from * the provided LDAP exception. * * @param ldapException The LDAP exception to use to create this notice of * disconnection extended result. */ public NoticeOfDisconnectionExtendedResult(final LDAPException ldapException) { this(0, ldapException.getResultCode(), ldapException.getDiagnosticMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), ldapException.getResponseControls()); }
/** * Creates a new instance of this notice of disconnection extended result from * the provided LDAP exception. * * @param ldapException The LDAP exception to use to create this notice of * disconnection extended result. */ public NoticeOfDisconnectionExtendedResult(final LDAPException ldapException) { this(0, ldapException.getResultCode(), ldapException.getDiagnosticMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), ldapException.getResponseControls()); }
/** * Creates a new LDAP search exception from the provided exception. * * @param ldapException The LDAP exception with the information to include * in this LDAP search exception. */ public LDAPSearchException(final LDAPException ldapException) { super(ldapException.getResultCode(), ldapException.getMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), ldapException.getResponseControls(), ldapException); if (ldapException instanceof LDAPSearchException) { final LDAPSearchException lse = (LDAPSearchException) ldapException; searchResult = lse.searchResult; } else { searchResult = new SearchResult(-1, ldapException.getResultCode(), ldapException.getMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), 0, 0, ldapException.getResponseControls()); } }
/** * Creates a new LDAP search exception from the provided exception. * * @param ldapException The LDAP exception with the information to include * in this LDAP search exception. */ public LDAPSearchException(final LDAPException ldapException) { super(ldapException.getResultCode(), ldapException.getMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), ldapException.getResponseControls(), ldapException); if (ldapException instanceof LDAPSearchException) { final LDAPSearchException lse = (LDAPSearchException) ldapException; searchResult = lse.searchResult; } else { searchResult = new SearchResult(-1, ldapException.getResultCode(), ldapException.getMessage(), ldapException.getMatchedDN(), ldapException.getReferralURLs(), 0, 0, ldapException.getResponseControls()); } }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP exception. * * @param e The LDAP exception to use to create this exception. */ public LDAPException(final LDAPException e) { super(e.getMessage(), e.getCause()); resultCode = e.getResultCode(); matchedDN = e.getMatchedDN(); diagnosticMessage = e.getDiagnosticMessage(); referralURLs = e.getReferralURLs(); responseControls = e.getResponseControls(); }
/** * Creates a new LDAP exception using the information contained in the * provided LDAP exception. * * @param e The LDAP exception to use to create this exception. */ public LDAPException(final LDAPException e) { super(e.getMessage(), e.getCause()); resultCode = e.getResultCode(); matchedDN = e.getMatchedDN(); diagnosticMessage = e.getDiagnosticMessage(); referralURLs = e.getReferralURLs(); responseControls = e.getResponseControls(); }
Arrays.asList(le.getReferralURLs()), null, null); return new LDAPMessage(messageID, extendedResponseProtocolOp, Arrays.asList(le.getResponseControls()));
return new LDAPMessage(messageID, new ModifyResponseProtocolOp(le.toLDAPResult()), le.getResponseControls());
return new LDAPMessage(messageID, new DeleteResponseProtocolOp(le.toLDAPResult()), le.getResponseControls());
return new LDAPMessage(messageID, new ModifyDNResponseProtocolOp(le.toLDAPResult()), le.getResponseControls());
return new LDAPMessage(messageID, new CompareResponseProtocolOp(le.toLDAPResult()), le.getResponseControls());
return new LDAPMessage(messageID, new AddResponseProtocolOp(le.toLDAPResult()), le.getResponseControls());
return new LDAPMessage(messageID, new ExtendedResponseProtocolOp(le.toLDAPResult()), le.getResponseControls());
le.getMatchedDN(), le.getDiagnosticMessage(), StaticUtils.toList(le.getReferralURLs()), null, null), le.getResponseControls());