Fix CodeQL note-severity alerts: uncaught NumberFormatException in the examples (#831)
28 files modified
1 files added
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | |
| | | } |
| | | final String serverRootDir = args[0]; |
| | | final String newBaseDn = args[1]; |
| | | final int ldapPort = args.length > 2 ? Integer.parseInt(args[2]) : 1500; |
| | | final int ldapPort = args.length > 2 ? parsePort(args[2]) : 1500; |
| | | |
| | | EmbeddedDirectoryServer server = |
| | | manageEmbeddedDirectoryServer( |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Returns the port number held by the provided command line argument. |
| | | * <p> |
| | | * Like the other command line argument checks of this example, a value which is not a port |
| | | * number is reported on standard error and stops the example. |
| | | */ |
| | | private static int parsePort(final String arg) { |
| | | try { |
| | | return Integer.parseInt(arg); |
| | | } catch (final NumberFormatException e) { |
| | | System.err.println("Invalid port number: " + arg); |
| | | System.exit(1); |
| | | return -1; // Never reached: System.exit() does not return. |
| | | } |
| | | } |
| | | |
| | | private ConfigureServer() { |
| | | // Not used. |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | |
| | | final String serverRootDir = args[i++]; |
| | | final String baseDn = (args.length > i) ? args[i++] : "o=example"; |
| | | final String backendType = (args.length > i) ? args[i++] : "pdb"; |
| | | final int ldapPort = (args.length > i) ? Integer.parseInt(args[i++]) : 1500; |
| | | final int adminPort = (args.length > i) ? Integer.parseInt(args[i++]) : 4500; |
| | | final int jmxPort = (args.length > i) ? Integer.parseInt(args[i++]) : 1600; |
| | | final int ldapPort = (args.length > i) ? parsePort(args[i++]) : 1500; |
| | | final int adminPort = (args.length > i) ? parsePort(args[i++]) : 4500; |
| | | final int jmxPort = (args.length > i) ? parsePort(args[i++]) : 1600; |
| | | |
| | | performSetup(openDJArchive, serverRootDir, baseDn, backendType, ldapPort, adminPort, jmxPort); |
| | | } |
| | |
| | | .jmxPort(jmxPort)); |
| | | } |
| | | |
| | | /** |
| | | * Returns the port number held by the provided command line argument. |
| | | * <p> |
| | | * Like the other command line argument checks of this example, a value which is not a port |
| | | * number is reported on standard error and stops the example. |
| | | */ |
| | | private static int parsePort(final String arg) { |
| | | try { |
| | | return Integer.parseInt(arg); |
| | | } catch (final NumberFormatException e) { |
| | | System.err.println("Invalid port number: " + arg); |
| | | System.exit(1); |
| | | return -1; // Never reached: System.exit() does not return. |
| | | } |
| | | } |
| | | |
| | | private SetupServer() { |
| | | // Not used. |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Collection; |
| | | |
| | |
| | | System.exit(1); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | |
| | | final LDAPConnectionFactory factory = new LDAPConnectionFactory(host, port); |
| | | try (Connection connection = factory.getConnection()) { |
| New file |
| | |
| | | /* |
| | | * The contents of this file are subject to the terms of the Common Development and |
| | | * Distribution License (the License). You may not use this file except in compliance with the |
| | | * License. |
| | | * |
| | | * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the |
| | | * specific language governing permission and limitations under the License. |
| | | * |
| | | * When distributing Covered Software, include this CDDL Header Notice in each file and include |
| | | * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL |
| | | * Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | * information: "Portions copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | |
| | | /** Utility methods shared by the example client applications. */ |
| | | final class ExampleUtils { |
| | | |
| | | /** |
| | | * Returns the port number held by the provided command line argument. |
| | | * <p> |
| | | * Like the other command line argument checks of the examples, a value which is not a port |
| | | * number is reported on standard error and stops the example, rather than failing it with a |
| | | * {@code NumberFormatException} stack trace. |
| | | * |
| | | * @param arg |
| | | * The command line argument holding the port number. |
| | | * @return The port number held by the provided argument. |
| | | */ |
| | | static int parsePort(final String arg) { |
| | | try { |
| | | return Integer.parseInt(arg); |
| | | } catch (final NumberFormatException e) { |
| | | System.err.println("Invalid port number: " + arg); |
| | | System.exit(ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue()); |
| | | return -1; // Never reached: System.exit() does not return. |
| | | } |
| | | } |
| | | |
| | | private ExampleUtils() { |
| | | // Prevent instantiation. |
| | | } |
| | | } |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.util.Collection; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | System.exit(1); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | |
| | | final LDAPConnectionFactory factory = new LDAPConnectionFactory(host, port); |
| | | Connection connection = null; |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String userName = args[2]; |
| | | final String password = args[3]; |
| | | final String baseDN = args[4]; |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | } |
| | | |
| | | host = args[0]; |
| | | port = Integer.parseInt(args[1]); |
| | | port = parsePort(args[1]); |
| | | infoType = args[2]; |
| | | final String infoTypeLc = infoType.toLowerCase(); |
| | | if (!"all".equals(infoTypeLc) |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String userName = args[2]; |
| | | final String password = args[3]; |
| | | |
| | |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String userName = args[2]; |
| | | final char[] password = args[3].toCharArray(); |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Calendar; |
| | | import java.util.Set; |
| | |
| | | System.exit(1); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | |
| | | // --- JCite --- |
| | | final LDAPConnectionFactory factory = new LDAPConnectionFactory(host, port); |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2013-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | System.exit(1); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String mode = args[2]; |
| | | final String bindDN = args[3]; |
| | | final String bindPassword = args[4]; |
| | |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*; |
| | | import static org.forgerock.opendj.ldap.LDAPListener.*; |
| | | import static org.forgerock.opendj.ldap.requests.Requests.newSimpleBindRequest; |
| | |
| | | } |
| | | |
| | | final String localAddress = args[i++]; |
| | | final int localPort = Integer.parseInt(args[i++]); |
| | | final int localPort = parsePort(args[i++]); |
| | | |
| | | final String proxyDN = args[i++]; |
| | | final String proxyPassword = args[i++]; |
| | |
| | | |
| | | for (; i < args.length; i += 2) { |
| | | final String remoteAddress = args[i]; |
| | | final int remotePort = Integer.parseInt(args[i + 1]); |
| | | final int remotePort = parsePort(args[i + 1]); |
| | | |
| | | factories.add(Connections.newCachedConnectionPool(new LDAPConnectionFactory(remoteAddress, |
| | | remotePort, |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.DN; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String userName = args[2]; |
| | | final String password = args[3]; |
| | | |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.Connections.newCachedConnectionPool; |
| | | import static org.forgerock.opendj.ldap.LDAPListener.*; |
| | | import static org.forgerock.opendj.ldap.requests.Requests.newSimpleBindRequest; |
| | |
| | | } |
| | | |
| | | final String localAddress = args[0]; |
| | | final int localPort = Integer.parseInt(args[1]); |
| | | final int localPort = parsePort(args[1]); |
| | | final String proxyDN = args[2]; |
| | | final String proxyPassword = args[3]; |
| | | final String remoteAddress = args[4]; |
| | | final int remotePort = Integer.parseInt(args[5]); |
| | | final int remotePort = parsePort(args[5]); |
| | | |
| | | // Create connection factories. |
| | | final Options factoryOptions = Options.defaultOptions() |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | /** |
| | |
| | | */ |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_USE_STARTTLS; |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_CONTEXT; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_USE_STARTTLS; |
| | | |
| | | |
| | | import java.security.GeneralSecurityException; |
| | |
| | | } |
| | | |
| | | host = args[0]; |
| | | port = Integer.parseInt(args[1]); |
| | | port = parsePort(args[1]); |
| | | |
| | | if (args.length == 5) { |
| | | authzid = args[2]; |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String userName = args[2]; |
| | | final String password = args[3]; |
| | | final String baseDN = args[4]; |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2015-2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.concurrent.CountDownLatch; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | userName = args[2]; |
| | | password = args[3]; |
| | | baseDN = args[4]; |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.Console; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | System.exit(1); |
| | | } |
| | | String host = args[0]; |
| | | int port = Integer.parseInt(args[1]); |
| | | int port = parsePort(args[1]); |
| | | String baseDN = args[2]; |
| | | |
| | | // --- JCite --- |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.Filter; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | |
| | | System.exit(1); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String baseDn = args[2]; |
| | | |
| | | // Prompt for email address and password. |
| | |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.LDAPListener.*; |
| | | |
| | | import java.io.FileInputStream; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String localAddress = args[0]; |
| | | final int localPort = Integer.parseInt(args[1]); |
| | | final int localPort = parsePort(args[1]); |
| | | final String ldifFileName = args[2]; |
| | | final String keyStoreFileName = (args.length == 6) ? args[3] : null; |
| | | final String keyStorePassword = (args.length == 6) ? args[4] : null; |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | System.exit(1); |
| | | } |
| | | String host = args[0]; |
| | | int port = Integer.parseInt(args[1]); |
| | | int port = parsePort(args[1]); |
| | | |
| | | // User credentials of a "Directory Administrators" group member. |
| | | // Kirsten Vaughan is authorized to create, update, and delete |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.Entries; |
| | | import org.forgerock.opendj.ldap.Entry; |
| | |
| | | System.exit(1); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | |
| | | // User credentials of a "Directory Administrators" group member. |
| | | // Kirsten Vaughan is authorized to create, update, and delete entries. |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*; |
| | | |
| | | import java.io.File; |
| | |
| | | } |
| | | |
| | | host = args[0]; |
| | | port = Integer.parseInt(args[1]); |
| | | port = parsePort(args[1]); |
| | | bindDN = args[2]; |
| | | bindPassword = args[3]; |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_CONTEXT; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_USE_STARTTLS; |
| | | import static org.forgerock.opendj.ldap.TrustManagers.checkHostName; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_USE_STARTTLS; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.SSL_CONTEXT; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | |
| | | } |
| | | |
| | | host = args[0]; |
| | | port = Integer.parseInt(args[1]); |
| | | port = parsePort(args[1]); |
| | | bindDN = args[2]; |
| | | bindPassword = args[3]; |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import java.util.Collection; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | |
| | | printUsage(); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String groupDN = args[2]; |
| | | final String memberDN = args[3]; |
| | | final ModificationType modType = getModificationType(args[4]); |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2016 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | |
| | | printUsage(); |
| | | } |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String groupDn = args[2]; |
| | | final String memberDn = args[3]; |
| | | final ModificationType modType = getModificationType(args[4]); |
| | |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import org.forgerock.opendj.io.ASN1; |
| | | import org.forgerock.opendj.io.ASN1Writer; |
| | | import org.forgerock.opendj.ldap.ByteStringBuilder; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String hostName = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String userName = args[2]; |
| | | final String password = args[3]; |
| | | final String userDN = args[4]; |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.DN; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String bindDn = args[2]; |
| | | final String bindPassword = args[3]; |
| | | |
| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2026 3A Systems, LLC. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.examples; |
| | | |
| | | import static org.forgerock.opendj.examples.ExampleUtils.parsePort; |
| | | import static org.forgerock.util.Utils.closeSilently; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.ldap.Connection; |
| | | import org.forgerock.opendj.ldap.DN; |
| | |
| | | |
| | | // Parse command line arguments. |
| | | final String host = args[0]; |
| | | final int port = Integer.parseInt(args[1]); |
| | | final int port = parsePort(args[1]); |
| | | final String bindDn = args[2]; |
| | | final char[] bindPassword = args[3].toCharArray(); |
| | | |