| | |
| | | this.message = message; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage getMessageObject() { |
| | | return this.message; |
| | | } |
| | |
| | | this.args = new LinkedList<Argument>(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int compareTo(final ArgumentGroup o) { |
| | | // Groups with higher priority numbers appear before |
| | | // those with lower priority in the usage output |
| File was renamed from opendj-sdk/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthenticatedConnectionFactory.java |
| | |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | |
| | | package com.forgerock.opendj.ldap.tools; |
| | | package com.forgerock.opendj.cli; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.AbstractConnectionWrapper; |
| | |
| | | * the connection attempt will fail and an {@code ErrorResultException} will be |
| | | * thrown. |
| | | */ |
| | | final class AuthenticatedConnectionFactory implements ConnectionFactory { |
| | | public final class AuthenticatedConnectionFactory implements ConnectionFactory { |
| | | |
| | | /** |
| | | * An authenticated connection supports all operations except Bind |
| | | * operations. |
| | | */ |
| | | static final class AuthenticatedConnection extends AbstractConnectionWrapper<Connection> { |
| | | public static final class AuthenticatedConnection extends AbstractConnectionWrapper<Connection> { |
| | | |
| | | private final BindRequest request; |
| | | private volatile BindResult result; |
| | |
| | | * Bind operations are not supported by pre-authenticated connections. |
| | | * These methods will always throw {@code UnsupportedOperationException}. |
| | | */ |
| | | |
| | | /** {@inheritDoc} */ |
| | | public BindResult bind(BindRequest request) throws ErrorResultException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public BindResult bind(String name, char[] password) throws ErrorResultException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public FutureResult<BindResult> bindAsync(BindRequest request, |
| | | IntermediateResponseHandler intermediateResponseHandler, |
| | | ResultHandler<? super BindResult> resultHandler) { |
| | |
| | | * @return The Bind result which was returned from the server after |
| | | * authentication. |
| | | */ |
| | | BindResult getAuthenticatedBindResult() { |
| | | public BindResult getAuthenticatedBindResult() { |
| | | return result; |
| | | } |
| | | |
| | |
| | | * If this connection has already been closed, i.e. if |
| | | * {@code isClosed() == true}. |
| | | */ |
| | | FutureResult<BindResult> rebindAsync(final ResultHandler<? super BindResult> handler) { |
| | | public FutureResult<BindResult> rebindAsync(final ResultHandler<? super BindResult> handler) { |
| | | if (request == null) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | |
| | | |
| | | final ResultHandler<BindResult> handlerWrapper = new ResultHandler<BindResult>() { |
| | | |
| | | /** {@inheritDoc} */ |
| | | public void handleErrorResult(final ErrorResultException error) { |
| | | /* |
| | | * This connection is now unauthenticated so prevent further |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public void handleResult(final BindResult result) { |
| | | // Save the result. |
| | | AuthenticatedConnection.this.result = result; |
| | |
| | | return connection.bindAsync(request, null, handlerWrapper); |
| | | } |
| | | |
| | | /** |
| | | * Returns the string representation of this authenticated connection. |
| | | * |
| | | * @return The string representation of this authenticated connection factory. |
| | | */ |
| | | public String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append("AuthenticatedConnection("); |
| | |
| | | * @throws NullPointerException |
| | | * If {@code factory} or {@code request} was {@code null}. |
| | | */ |
| | | AuthenticatedConnectionFactory(final ConnectionFactory factory, final BindRequest request) { |
| | | public AuthenticatedConnectionFactory(final ConnectionFactory factory, final BindRequest request) { |
| | | Reject.ifNull(factory, request); |
| | | this.parentFactory = factory; |
| | | |
| | |
| | | parentFactory.close(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public Connection getConnection() throws ErrorResultException { |
| | | final Connection connection = parentFactory.getConnection(); |
| | | BindResult bindResult = null; |
| | |
| | | return new AuthenticatedConnection(connection, request, bindResult); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public FutureResult<Connection> getConnectionAsync( |
| | | final ResultHandler<? super Connection> handler) { |
| | | final FutureResultImpl future = new FutureResultImpl(request, handler); |
| | |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * Returns the string representation of this authenticated connection factory. |
| | | * |
| | | * @return The string representation of this authenticated connection factory. |
| | | */ |
| | | public String toString() { |
| | | final StringBuilder builder = new StringBuilder(); |
| | | builder.append("AuthenticatedConnectionFactory("); |
| | |
| | | .valueOf(false), null, description); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | final public void addValue(final String valueString) { |
| | | if (valueString != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | final public void setPresent(final boolean isPresent) { |
| | | addValue(String.valueOf(isPresent)); |
| | |
| | | import javax.net.ssl.X509TrustManager; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | import org.forgerock.opendj.ldap.ConnectionFactory; |
| | | import org.forgerock.opendj.ldap.KeyManagers; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | |
| | | /** |
| | | * A connection factory designed for use with command line tools. |
| | | */ |
| | | public class ConnectionFactoryProvider extends AbstractAuthenticatedConnectionFactory { |
| | | public class ConnectionFactoryProvider { |
| | | /** |
| | | * The Logger. |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the connection factory. |
| | | * Returns the host name. |
| | | * |
| | | * @return The host name value. |
| | | */ |
| | | public String getHostname() { |
| | | if (hostNameArg.isPresent()) { |
| | | return hostNameArg.getValue(); |
| | | } |
| | | return hostNameArg.getDefaultValue(); |
| | | } |
| | | |
| | | /** |
| | | * Get the port which has to be used for the command. |
| | | * |
| | | * @return The port specified by the command line argument, or the default value, if not specified. |
| | | */ |
| | | public int getPort() { |
| | | if (portArg.isPresent()) { |
| | | try { |
| | | return portArg.getIntValue(); |
| | | } catch (ArgumentException e) { |
| | | return Integer.valueOf(portArg.getDefaultValue()); |
| | | } |
| | | } |
| | | return Integer.valueOf(portArg.getDefaultValue()); |
| | | } |
| | | |
| | | /** |
| | | * Checks if any conflicting arguments are present, build the connection with |
| | | * selected arguments and returns the connection factory. |
| | | * |
| | | * @return The connection factory. |
| | | * @throws ArgumentException |
| | | * If an error occurs during the parsing of the arguments. |
| | | * If an error occurs during the parsing of the arguments. (conflicting |
| | | * arguments or if an error occurs during building SSL context). |
| | | */ |
| | | public ConnectionFactory getConnectionFactory() throws ArgumentException { |
| | | if (connFactory == null) { |
| | |
| | | authenticatedConnFactory = getConnectionFactory(); |
| | | final BindRequest bindRequest = getBindRequest(); |
| | | if (bindRequest != null) { |
| | | authenticatedConnFactory = newAuthenticatedConnectionFactory(authenticatedConnFactory, bindRequest); |
| | | authenticatedConnFactory = new AuthenticatedConnectionFactory(authenticatedConnFactory, bindRequest); |
| | | } |
| | | } |
| | | return authenticatedConnFactory; |
| | |
| | | |
| | | return option.substring(equalPos + 1, option.length()); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | this.callbacks = callbacks; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public MenuResult<T> invoke(ConsoleApplication app) throws ClientException { |
| | | List<T> values = new ArrayList<T>(); |
| | | for (MenuCallback<T> callback : callbacks) { |
| | |
| | | this.nMaxTries = nMaxTries; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public MenuResult<T> run() throws ClientException { |
| | | // The validation call-back which will be used to determine the |
| | | // action call-back. |
| | |
| | | this.result = result; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public MenuResult<T> invoke(ConsoleApplication app) throws ClientException { |
| | | return result; |
| | | } |
| | |
| | | * A trust manager which prompts the user for the length of time that they would |
| | | * like to trust a server certificate. |
| | | */ |
| | | final class PromptingTrustManager implements X509TrustManager { |
| | | public final class PromptingTrustManager implements X509TrustManager { |
| | | /** |
| | | * Enumeration description server certificate trust option. |
| | | */ |
| | |
| | | |
| | | private final ConsoleApplication app; |
| | | |
| | | PromptingTrustManager(final ConsoleApplication app, final String acceptedStorePath, |
| | | /** |
| | | * Creates a prompting trust manager based on these arguments. |
| | | * |
| | | * @param app |
| | | * The linked console application. |
| | | * @param acceptedStorePath |
| | | * The store path. |
| | | * @param sourceTrustManager |
| | | * The source of the trust manager. |
| | | * @throws KeyStoreException |
| | | * If no Provider supports a KeyStoreSpi implementation for the specified type. |
| | | * @throws IOException |
| | | * If there is an I/O or format problem with the keystore data, if a password is required but not given, |
| | | * or if the given password was incorrect. If the error is due to a wrong password, the cause of the |
| | | * IOException should be an UnrecoverableKeyException. |
| | | * @throws NoSuchAlgorithmException |
| | | * If no provider supports a trust manager factory spi implementation for the specified algorithm. |
| | | * @throws CertificateException |
| | | * If any of the certificates in the key store could not be loaded |
| | | */ |
| | | public PromptingTrustManager(final ConsoleApplication app, final String acceptedStorePath, |
| | | final X509TrustManager sourceTrustManager) throws KeyStoreException, IOException, |
| | | NoSuchAlgorithmException, CertificateException { |
| | | Reject.ifNull(app, acceptedStorePath); |
| | |
| | | this.onDiskTrustManager = x509tm; |
| | | } |
| | | |
| | | PromptingTrustManager(final ConsoleApplication app, final X509TrustManager sourceTrustManager) |
| | | /** |
| | | * Creates a prompting trust manager based on these arguments. |
| | | * |
| | | * @param app |
| | | * The linked console application. |
| | | * @param sourceTrustManager |
| | | * The source of the trust manager. |
| | | * @throws KeyStoreException |
| | | * If no Provider supports a KeyStoreSpi implementation for the specified type. |
| | | * @throws IOException |
| | | * If there is an I/O or format problem with the keystore data, if a password is required but not given, |
| | | * or if the given password was incorrect. If the error is due to a wrong password, the cause of the |
| | | * IOException should be an UnrecoverableKeyException. |
| | | * @throws NoSuchAlgorithmException |
| | | * If no provider supports a trust manager factory spi implementation for the specified algorithm. |
| | | * @throws CertificateException |
| | | * If any of the certificates in the key store could not be loaded |
| | | */ |
| | | public PromptingTrustManager(final ConsoleApplication app, final X509TrustManager sourceTrustManager) |
| | | throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { |
| | | this(app, DEFAULT_PATH, sourceTrustManager); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public void checkClientTrusted(final X509Certificate[] x509Certificates, final String s) |
| | | throws CertificateException { |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public void checkServerTrusted(final X509Certificate[] x509Certificates, final String s) |
| | | throws CertificateException { |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | public X509Certificate[] getAcceptedIssuers() { |
| | | if (nestedTrustManager != null) { |
| | | return nestedTrustManager.getAcceptedIssuers(); |
| | |
| | | // No implementation required. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addCell(String s) { |
| | | // Avoid printing tab separators for trailing empty cells. |
| | |
| | | column++; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addHeading(String s) { |
| | | if (displayHeadings) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void endHeader() { |
| | | if (displayHeadings) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void endRow() { |
| | | writer.println(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void endTable() { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void startHeader() { |
| | | column = 0; |
| | | requiredSeparators = 0; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void startRow() { |
| | | column = 0; |
| | |
| | | this.displayHeadings = displayHeadings; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TableSerializer getSerializer() { |
| | | return new Serializer(); |
| | |
| | | this.indentPadding = builder.toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addCell(String s) { |
| | | currentRow.add(s); |
| | | column++; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addColumn(int width) { |
| | | columnWidths.add(width); |
| | | totalColumns++; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addHeading(String s) { |
| | | if (displayHeadings) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void endHeader() { |
| | | if (displayHeadings) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void endRow() { |
| | | boolean isRemainingText; |
| | |
| | | } while (isRemainingText); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void endTable() { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void startHeader() { |
| | | determineColumnWidths(); |
| | |
| | | currentRow.clear(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void startRow() { |
| | | column = 0; |
| | |
| | | this.totalWidth = totalWidth; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected TableSerializer getSerializer() { |
| | | return new Serializer(); |
| | |
| | | import javax.net.ssl.SSLHandshakeException; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.RDN; |
| | | |
| | | /** |
| | | * This class provides utility functions for all the client side tools. |
| | |
| | | private Utils() { |
| | | // Do nothing. |
| | | } |
| | | |
| | | /** |
| | | * Returns {@code true} if the the provided string is a DN and {@code false} otherwise. |
| | | * |
| | | * @param dn |
| | | * the String we are analyzing. |
| | | * @return {@code true} if the the provided string is a DN and {@code false} otherwise. |
| | | */ |
| | | public static boolean isDN(String dn) { |
| | | try { |
| | | DN.valueOf(dn); |
| | | } catch (Exception ex) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * Returns the DN of the global administrator for a given UID. |
| | | * |
| | | * @param uid |
| | | * The UID to be used to generate the DN. |
| | | * @return The DN of the administrator for the given UID. |
| | | */ |
| | | private static String getAdministratorDN(String uid) { |
| | | return "cn=" + RDN.valueOf(uid) + ",cn=Administrators, cn=admin data"; |
| | | } |
| | | } |
| | |
| | | try { |
| | | setDefaultPerfToolProperties(); |
| | | |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | runner = new BindPerformanceRunner(argParser, this); |
| | | |
| | | propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | |
| | | import org.forgerock.opendj.ldap.controls.AssertionRequestControl; |
| | | import org.forgerock.opendj.ldap.controls.Control; |
| | | import org.forgerock.opendj.ldap.controls.ProxiedAuthV2RequestControl; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | | import org.forgerock.opendj.ldap.requests.CompareRequest; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.opendj.ldap.responses.Result; |
| | |
| | | BooleanArgument noPropertiesFileArgument; |
| | | |
| | | try { |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | |
| | | propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | | argParser.addArgument(propertiesFileArgument); |
| | |
| | | import org.forgerock.opendj.ldap.controls.PreReadResponseControl; |
| | | import org.forgerock.opendj.ldap.controls.ProxiedAuthV2RequestControl; |
| | | import org.forgerock.opendj.ldap.requests.AddRequest; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | | import org.forgerock.opendj.ldap.requests.DeleteRequest; |
| | | import org.forgerock.opendj.ldap.requests.ModifyDNRequest; |
| | | import org.forgerock.opendj.ldap.requests.ModifyRequest; |
| | |
| | | BooleanArgument noPropertiesFileArgument; |
| | | |
| | | try { |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | |
| | | propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | | argParser.addArgument(propertiesFileArgument); |
| | |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.controls.Control; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | | import org.forgerock.opendj.ldap.requests.PasswordModifyExtendedRequest; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.opendj.ldap.responses.PasswordModifyExtendedResult; |
| | |
| | | BooleanArgument noPropertiesFileArgument; |
| | | |
| | | try { |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | |
| | | propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | | argParser.addArgument(propertiesFileArgument); |
| | |
| | | import org.forgerock.opendj.ldap.controls.SimplePagedResultsControl; |
| | | import org.forgerock.opendj.ldap.controls.VirtualListViewRequestControl; |
| | | import org.forgerock.opendj.ldap.controls.VirtualListViewResponseControl; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.opendj.ldap.requests.SearchRequest; |
| | | import org.forgerock.opendj.ldap.responses.Result; |
| | |
| | | StringArgument assertionFilter; |
| | | IntegerArgument sizeLimit; |
| | | try { |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | final StringArgument propertiesFileArgument = |
| | | CommonArguments.getPropertiesFile(); |
| | | argParser.addArgument(propertiesFileArgument); |
| | |
| | | import org.forgerock.opendj.ldap.FutureResult; |
| | | import org.forgerock.opendj.ldap.ModificationType; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | | import org.forgerock.opendj.ldap.requests.ModifyRequest; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.opendj.ldap.responses.Result; |
| | |
| | | try { |
| | | Utils.setDefaultPerfToolProperties(); |
| | | |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | runner = new ModifyPerformanceRunner(argParser, this); |
| | | |
| | | propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.MultiColumnPrinter; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | import com.forgerock.opendj.ldap.tools.AuthenticatedConnectionFactory.AuthenticatedConnection; |
| | | import com.forgerock.opendj.cli.AuthenticatedConnectionFactory.AuthenticatedConnection; |
| | | import com.forgerock.opendj.util.StaticUtils; |
| | | |
| | | /** |
| | |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.SearchResultHandler; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | import org.forgerock.opendj.ldap.requests.BindRequest; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.opendj.ldap.requests.SearchRequest; |
| | | import org.forgerock.opendj.ldap.responses.Result; |
| | |
| | | try { |
| | | Utils.setDefaultPerfToolProperties(); |
| | | |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this) { |
| | | @Override |
| | | public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection, |
| | | final BindRequest request) throws ArgumentException { |
| | | return new AuthenticatedConnectionFactory(connection, request); |
| | | |
| | | } |
| | | }; |
| | | connectionFactoryProvider = new ConnectionFactoryProvider(argParser, this); |
| | | runner = new SearchPerformanceRunner(argParser, this); |
| | | |
| | | propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | |
| | | |
| | | import com.forgerock.opendj.cli.ConsoleApplication; |
| | | import com.forgerock.opendj.ldap.controls.AccountUsabilityRequestControl; |
| | | import com.forgerock.opendj.ldap.tools.AuthenticatedConnectionFactory.AuthenticatedConnection; |
| | | import com.forgerock.opendj.cli.AuthenticatedConnectionFactory.AuthenticatedConnection; |
| | | import com.forgerock.opendj.util.StaticUtils; |
| | | |
| | | /** |