| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | */ |
| | | package com.forgerock.opendj.ldap.tools; |
| | | |
| | |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | @Override |
| | | String[] getAdditionalColumns() { |
| | | invalidCredRecentCount.set(0); |
| | | if (extraColumn.length != 0) { |
| | | final long searchWaitTimeNs = searchWaitRecentTimeNs.getAndSet(0); |
| | | extraColumn[0] = getDivisionResult( |
| | |
| | | } |
| | | } |
| | | |
| | | private final class BindUpdateStatsResultHandler extends UpdateStatsResultHandler<BindResult> { |
| | | private BindUpdateStatsResultHandler(final long startTime) { |
| | | super(startTime); |
| | | } |
| | | |
| | | @Override |
| | | public void handleException(final LdapException exception) { |
| | | super.handleException(exception); |
| | | |
| | | if (exception.getResult().getResultCode() == ResultCode.INVALID_CREDENTIALS) { |
| | | invalidCredRecentCount.getAndIncrement(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private final class BindWorkerThread extends WorkerThread { |
| | | private SearchRequest sr; |
| | | private BindRequest br; |
| | |
| | | |
| | | incrementIterationCount(); |
| | | return returnedPromise.thenOnResult(new UpdateStatsResultHandler<BindResult>(startTime)) |
| | | .thenOnException(new BindUpdateStatsResultHandler(startTime)); |
| | | .thenOnException(new UpdateStatsResultHandler<BindResult>(startTime)); |
| | | } |
| | | |
| | | private Promise<BindResult, LdapException> performBind(final Connection connection, |
| | |
| | | } |
| | | |
| | | private final AtomicLong searchWaitRecentTimeNs = new AtomicLong(); |
| | | private final AtomicInteger invalidCredRecentCount = new AtomicInteger(); |
| | | private String filter; |
| | | private String baseDN; |
| | | private SearchScope scope; |