/** * Creates a new compare result from the provided {@code LDAPException}. * * @param exception The {@code LDAPException} to use to create this compare * result. */ public CompareResult(final LDAPException exception) { super(exception.toLDAPResult()); }
/** * Creates a new extended result from the provided {@code LDAPException}. * The extended result will not have an OID or value. * * @param exception The {@code LDAPException} to use to create this extended * result. */ public ExtendedResult(final LDAPException exception) { this(exception.toLDAPResult()); }
/** * Creates a new extended result from the provided {@code LDAPException}. * The extended result will not have an OID or value. * * @param exception The {@code LDAPException} to use to create this extended * result. */ public ExtendedResult(final LDAPException exception) { this(exception.toLDAPResult()); }
/** * Creates a new {@code LDAPResult} object from this exception. * * @return The {@code LDAPResult} object created from this exception. */ public LDAPResult toLDAPResult() { return ldapException.toLDAPResult(); }
/** * Creates a new search result object with the information from the provided * LDAP exception. * * @param ldapException The LDAP exception to use to create the contents of * this search result. */ public SearchResult(final LDAPException ldapException) { this(ldapException.toLDAPResult()); }
/** * Creates a new bind result from the provided {@code LDAPException}. * * @param exception The {@code LDAPException} to use to create this bind * result. */ public BindResult(final LDAPException exception) { super(exception.toLDAPResult()); serverSASLCredentials = null; }
/** * Creates a new search result object with the information from the provided * LDAP exception. * * @param ldapException The LDAP exception to use to create the contents of * this search result. */ public SearchResult(final LDAPException ldapException) { this(ldapException.toLDAPResult()); }
/** * Creates a new compare result from the provided {@code LDAPException}. * * @param exception The {@code LDAPException} to use to create this compare * result. */ public CompareResult(final LDAPException exception) { super(exception.toLDAPResult()); }
/** * Creates a new bind result from the provided {@code LDAPException}. * * @param exception The {@code LDAPException} to use to create this bind * result. */ public BindResult(final LDAPException exception) { super(exception.toLDAPResult()); serverSASLCredentials = null; }
/** * Creates a new {@code LDAPResult} object from this exception. * * @return The {@code LDAPResult} object created from this exception. */ public LDAPResult toLDAPResult() { return ldapException.toLDAPResult(); }
/** * Extracts a password expired control from the provided exception. * * @param exception The exception from which to retrieve the password * expired control. * * @return The password expired control contained in the provided exception, * or {@code null} if the exception did not contain a password * expired control. * * @throws LDAPException If a problem is encountered while attempting to * decode the password expired control contained in * the provided exception. */ public static PasswordExpiredControl get(final LDAPException exception) throws LDAPException { return get(exception.toLDAPResult()); }
/** * Retrieves a list of strings that comprise a formatted representation of the * result encapsulated by the provided exception. * * @param ldapException The exception to use to obtain the result to format. * @param comment Indicates whether to prefix each line with an * octothorpe to indicate that it is a comment. * @param indent The number of spaces to indent each line. * @param maxWidth The maximum length of each line in characters, * including the comment prefix and indent. * * @return A list of strings that comprise a formatted representation of the * result encapsulated by the provided exception. */ public static List<String> formatResult(final LDAPException ldapException, final boolean comment, final int indent, final int maxWidth) { return formatResult(ldapException.toLDAPResult(), comment, indent, maxWidth); }
/** * Performs the appropriate processing for a result that failed with an * {@code LDAPException}. * * @param request The request that was processed. * @param le The exception caught during processing. */ void handleResult(final PasswordPolicyStateExtendedRequest request, final LDAPException le) { try { final PasswordPolicyStateExtendedResult result = new PasswordPolicyStateExtendedResult(new ExtendedResult(le)); handleResult(request, result); return; } catch (final Exception e) { Debug.debugException(e); } handleResult(createResultEntry(request, le.toLDAPResult()), true); }
/** * {@inheritDoc} */ @Override() public LDAPMessage processExtendedRequest(final int messageID, final ExtendedRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(extendedSemaphore, OperationType.EXTENDED); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new ExtendedResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processExtendedRequest(messageID, request, controls); } finally { releasePermit(extendedSemaphore); } }
/** * {@inheritDoc} */ @Override() public LDAPMessage processModifyDNRequest(final int messageID, final ModifyDNRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(modifyDNSemaphore, OperationType.MODIFY_DN); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new ModifyDNResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processModifyDNRequest(messageID, request, controls); } finally { releasePermit(modifyDNSemaphore); } }
/** * {@inheritDoc} */ @Override() public LDAPMessage processAddRequest(final int messageID, final AddRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(addSemaphore, OperationType.ADD); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new AddResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processAddRequest(messageID, request, controls); } finally { releasePermit(addSemaphore); } }
/** * {@inheritDoc} */ @Override() public LDAPMessage processBindRequest(final int messageID, final BindRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(bindSemaphore, OperationType.BIND); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new BindResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processBindRequest(messageID, request, controls); } finally { releasePermit(bindSemaphore); } }
/** * {@inheritDoc} */ @Override() public LDAPMessage processModifyRequest(final int messageID, final ModifyRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(modifySemaphore, OperationType.MODIFY); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new ModifyResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processModifyRequest(messageID, request, controls); } finally { releasePermit(modifySemaphore); } }
/** * {@inheritDoc} */ @Override() public LDAPMessage processCompareRequest(final int messageID, final CompareRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(compareSemaphore, OperationType.COMPARE); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new CompareResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processCompareRequest(messageID, request, controls); } finally { releasePermit(compareSemaphore); } }
/** * {@inheritDoc} */ @Override() public LDAPMessage processDeleteRequest(final int messageID, final DeleteRequestProtocolOp request, final List<Control> controls) { try { acquirePermit(deleteSemaphore, OperationType.DELETE); } catch (final LDAPException le) { Debug.debugException(le); return new LDAPMessage(messageID, new DeleteResponseProtocolOp(le.toLDAPResult())); } try { return downstreamRequestHandler.processDeleteRequest(messageID, request, controls); } finally { releasePermit(deleteSemaphore); } }