| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package com.forgerock.opendj.ldap.tools; |
| | | |
| | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.ConnectionFactory; |
| | | import org.forgerock.opendj.ldap.DereferenceAliasesPolicy; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void handleError(final ErrorResultException error) { |
| | | public void handleError(final LdapException error) { |
| | | super.handleError(error); |
| | | |
| | | if (error.getResult().getResultCode() == ResultCode.INVALID_CREDENTIALS) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Promise<?, ErrorResultException> performOperation(final Connection connection, |
| | | public Promise<?, LdapException> performOperation(final Connection connection, |
| | | final DataSource[] dataSources, final long startTime) { |
| | | if (dataSources != null) { |
| | | data = DataSource.generateData(dataSources, data); |
| | |
| | | } |
| | | } |
| | | |
| | | Promise<BindResult, ErrorResultException> returnedPromise; |
| | | Promise<BindResult, LdapException> returnedPromise; |
| | | if (filter != null && baseDN != null) { |
| | | if (sr == null) { |
| | | if (dataSources == null) { |
| | |
| | | } |
| | | |
| | | returnedPromise = connection.searchSingleEntryAsync(sr).thenAsync( |
| | | new AsyncFunction<SearchResultEntry, BindResult, ErrorResultException>() { |
| | | new AsyncFunction<SearchResultEntry, BindResult, LdapException>() { |
| | | @Override |
| | | public Promise<BindResult, ErrorResultException> apply(SearchResultEntry result) |
| | | throws ErrorResultException { |
| | | public Promise<BindResult, LdapException> apply(SearchResultEntry result) |
| | | throws LdapException { |
| | | searchWaitRecentTime.getAndAdd(System.nanoTime() - startTime); |
| | | if (data == null) { |
| | | data = new Object[1]; |
| | |
| | | new BindUpdateStatsResultHandler(startTime)); |
| | | } |
| | | |
| | | private Promise<BindResult, ErrorResultException> performBind(final Connection connection, |
| | | private Promise<BindResult, LdapException> performBind(final Connection connection, |
| | | final Object[] data) { |
| | | final boolean useInvalidPassword; |
| | | |