| | |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.admin.ads.util.ConnectionUtils.*; |
| | | import static org.opends.admin.ads.util.PreferredConnection.Type.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | import static com.forgerock.opendj.cli.ArgumentConstants.*; |
| | | import static com.forgerock.opendj.cli.Utils.*; |
| | | |
| | |
| | | import org.opends.admin.ads.util.ApplicationTrustManager; |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.admin.ads.util.ConnectionWrapper; |
| | | import org.opends.admin.ads.util.PreferredConnection.Type; |
| | | import org.opends.guitools.controlpanel.datamodel.ConnectionProtocolPolicy; |
| | | import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; |
| | | import org.opends.quicksetup.Application; |
| | |
| | | import org.opends.quicksetup.util.ServerController; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.admin.client.cli.SecureConnectionCliArgs; |
| | | import org.opends.server.types.HostPort; |
| | | import org.opends.server.util.StaticUtils; |
| | | import org.opends.server.util.cli.LDAPConnectionConsoleInteraction; |
| | | |
| | |
| | | private ControlPanelInfo info; |
| | | |
| | | private boolean forceNonInteractive; |
| | | private boolean useSSL = true; |
| | | private boolean useStartTLS; |
| | | private Type connectionType = LDAPS; |
| | | |
| | | /** Default constructor. */ |
| | | public UninstallCliHelper() |
| | |
| | | * If there is an error processing data in non-interactive mode and |
| | | * an error must be thrown (not in force on error mode). |
| | | */ |
| | | public UninstallUserData createUserData(UninstallerArgumentParser args, |
| | | String[] rawArguments) |
| | | throws UserDataException, ClientException |
| | | public UninstallUserData createUserData(UninstallerArgumentParser args, String[] rawArguments) |
| | | throws UserDataException, ClientException |
| | | { |
| | | parser = args; |
| | | UninstallUserData userData = new UninstallUserData(); |
| | |
| | | |
| | | logger.info(LocalizableMessage.raw("Updating user data with remote servers.")); |
| | | |
| | | InitialLdapContext ctx = null; |
| | | ConnectionWrapper conn = null; |
| | | try |
| | | { |
| | | info.setTrustManager(userData.getTrustManager()); |
| | |
| | | { |
| | | logger.error(LocalizableMessage.raw("Error parsing url: "+adminConnectorUrl)); |
| | | } |
| | | ctx = createAdministrativeContext(host, port, useSSL, useStartTLS, dn, |
| | | pwd, getConnectTimeout(), userData.getTrustManager()); |
| | | ConnectionWrapper connWrapper = new ConnectionWrapper(ctx, getConnectTimeout(), userData.getTrustManager()); |
| | | conn = new ConnectionWrapper(new HostPort(host, port), connectionType, dn, pwd, |
| | | getConnectTimeout(), userData.getTrustManager()); |
| | | |
| | | ADSContext adsContext = new ADSContext(connWrapper); |
| | | ADSContext adsContext = new ADSContext(conn); |
| | | if (interactive && userData.getTrustManager() == null) |
| | | { |
| | | // This is required when the user did connect to the server using SSL |
| | |
| | | } |
| | | finally |
| | | { |
| | | StaticUtils.close(ctx); |
| | | StaticUtils.close(conn); |
| | | } |
| | | if (exceptionOccurred) |
| | | { |