| | |
| | | protected void configureServer() throws ApplicationException { |
| | | notifyListeners(getFormattedWithPoints(INFO_PROGRESS_CONFIGURING.get())); |
| | | |
| | | writeOpenDSJavaHome(); |
| | | |
| | | if (Utils.isWebStart()) |
| | | { |
| | | setInstallation(new Installation(getUserData().getServerLocation())); |
| | | } |
| | | |
| | | checkAbort(); |
| | | |
| | | ArrayList<String> argList = new ArrayList<String>(); |
| | | argList.add("-C"); |
| | | argList.add(getConfigurationClassName()); |
| | |
| | | } |
| | | LOG.log(Level.INFO, "configure DS cmd: "+cmd); |
| | | final InstallerHelper helper = new InstallerHelper(); |
| | | setNotifyListeners(false); |
| | | InvokeThread thread = new InvokeThread() |
| | | { |
| | | public void run() |
| | |
| | | ReturnCode.CONFIGURATION_ERROR, |
| | | getThrowableMsg(INFO_ERROR_CONFIGURING.get(), t), t); |
| | | } |
| | | finally |
| | | { |
| | | setNotifyListeners(true); |
| | | } |
| | | isOver = true; |
| | | } |
| | | public void abort() |
| | |
| | | } |
| | | }; |
| | | invokeLongOperation(thread); |
| | | |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | checkAbort(); |
| | | |
| | | try |
| | |
| | | SecurityOptions.CertificateType certType = sec.getCertificateType(); |
| | | if (certType != SecurityOptions.CertificateType.NO_CERTIFICATE) |
| | | { |
| | | notifyListeners(getLineBreak()); |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_UPDATING_CERTIFICATES.get())); |
| | | } |
| | |
| | | } |
| | | if (certType != SecurityOptions.CertificateType.NO_CERTIFICATE) |
| | | { |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } |
| | | catch (Throwable t) |
| | |
| | | final String[] args = new String[argList.size()]; |
| | | argList.toArray(args); |
| | | |
| | | getApplicationOutputStream().setNotifyListeners(false); |
| | | getApplicationErrorStream().setNotifyListeners(false); |
| | | setNotifyListeners(false); |
| | | |
| | | InvokeThread thread = new InvokeThread() |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | getApplicationOutputStream().setNotifyListeners(true); |
| | | getApplicationErrorStream().setNotifyListeners(true); |
| | | setNotifyListeners(true); |
| | | } |
| | | isOver = true; |
| | | } |
| | |
| | | } |
| | | }; |
| | | invokeLongOperation(thread); |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | |
| | | /** |
| | |
| | | MessageBuilder mb = new MessageBuilder(); |
| | | if (ldifPaths.size() > 1) |
| | | { |
| | | mb.append(getFormattedProgress(INFO_PROGRESS_IMPORTING_LDIFS.get( |
| | | if (isVerbose()) |
| | | { |
| | | mb.append(getFormattedProgress(INFO_PROGRESS_IMPORTING_LDIFS.get( |
| | | getStringFromCollection(ldifPaths, ", ")))); |
| | | mb.append(getLineBreak()); |
| | | } |
| | | else |
| | | { |
| | | mb.append(getFormattedWithPoints( |
| | | INFO_PROGRESS_IMPORTING_LDIFS_NON_VERBOSE.get( |
| | | getStringFromCollection(ldifPaths, ", ")))); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | mb.append(getFormattedProgress(INFO_PROGRESS_IMPORTING_LDIF.get( |
| | | if (isVerbose()) |
| | | { |
| | | mb.append(getFormattedProgress(INFO_PROGRESS_IMPORTING_LDIF.get( |
| | | ldifPaths.getFirst()))); |
| | | mb.append(getLineBreak()); |
| | | } |
| | | else |
| | | { |
| | | mb.append(getFormattedWithPoints( |
| | | INFO_PROGRESS_IMPORTING_LDIF_NON_VERBOSE.get( |
| | | ldifPaths.getFirst()))); |
| | | } |
| | | } |
| | | mb.append(getLineBreak()); |
| | | notifyListeners(mb.toMessage()); |
| | | |
| | | if (!isVerbose()) |
| | | { |
| | | setNotifyListeners(false); |
| | | } |
| | | |
| | | ArrayList<String> argList = new ArrayList<String>(); |
| | | argList.add("-C"); |
| | | argList.add(getConfigurationClassName()); |
| | |
| | | ReturnCode.CONFIGURATION_ERROR, |
| | | getThrowableMsg(INFO_ERROR_IMPORTING_LDIF.get(), t), t); |
| | | } |
| | | finally |
| | | { |
| | | if (!isVerbose()) |
| | | { |
| | | setNotifyListeners(true); |
| | | } |
| | | } |
| | | isOver = true; |
| | | } |
| | | public void abort() |
| | |
| | | } |
| | | }; |
| | | invokeLongOperation(thread); |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | LinkedList<File> templatePaths = createTemplateFiles(); |
| | | int nEntries = getUserData().getNewSuffixOptions().getNumberEntries(); |
| | | MessageBuilder mb = new MessageBuilder(); |
| | | mb.append(getFormattedProgress( |
| | | if (isVerbose()) |
| | | { |
| | | mb.append(getFormattedProgress( |
| | | INFO_PROGRESS_IMPORT_AUTOMATICALLY_GENERATED.get( |
| | | String.valueOf(nEntries)))); |
| | | mb.append(getLineBreak()); |
| | | mb.append(getLineBreak()); |
| | | } |
| | | else |
| | | { |
| | | mb.append(getFormattedWithPoints( |
| | | INFO_PROGRESS_IMPORT_AUTOMATICALLY_GENERATED_NON_VERBOSE.get( |
| | | String.valueOf(nEntries)))); |
| | | } |
| | | notifyListeners(mb.toMessage()); |
| | | |
| | | for (File templatePath : templatePaths) |
| | | { |
| | | if (!isVerbose()) |
| | | { |
| | | setNotifyListeners(false); |
| | | } |
| | | |
| | | final ArrayList<String> argList = new ArrayList<String>(); |
| | | argList.add("-C"); |
| | | argList.add(getConfigurationClassName()); |
| | |
| | | listToString(argList, " "), t.getLocalizedMessage()), t), |
| | | t); |
| | | } |
| | | finally |
| | | { |
| | | if (!isVerbose()) |
| | | { |
| | | setNotifyListeners(true); |
| | | } |
| | | } |
| | | isOver = true; |
| | | } |
| | | public void abort() |
| | |
| | | } |
| | | }; |
| | | invokeLongOperation(thread); |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | String ldapUrl = getLdapUrl(auth); |
| | | String dn = auth.getDn(); |
| | | String pwd = auth.getPwd(); |
| | | notifyListeners(getFormattedWithPoints( |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_UNCONFIGURING_ADS_ON_REMOTE.get(getHostDisplay(auth)))); |
| | | } |
| | | try |
| | | { |
| | | if (auth.useSecureConnection()) |
| | |
| | | getUserData())); |
| | | } |
| | | } |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | { |
| | | } |
| | | } |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | checkAbort(); |
| | | |
| | | if (getUserData().getReplicationOptions().getType() |
| | |
| | | catch (Throwable t) |
| | | { |
| | | } |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | checkAbort(); |
| | | } |
| | | } |
| | |
| | | { |
| | | case CREATE_BASE_ENTRY: |
| | | currentProgressStep = InstallProgressStep.CREATING_BASE_ENTRY; |
| | | notifyListeners(getTaskSeparator()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | createBaseEntry(); |
| | | break; |
| | | case IMPORT_FROM_LDIF_FILE: |
| | | currentProgressStep = InstallProgressStep.IMPORTING_LDIF; |
| | | notifyListeners(getTaskSeparator()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | importLDIF(); |
| | | break; |
| | | case IMPORT_AUTOMATICALLY_GENERATED_DATA: |
| | | currentProgressStep = |
| | | InstallProgressStep.IMPORTING_AUTOMATICALLY_GENERATED; |
| | | notifyListeners(getTaskSeparator()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | importAutomaticallyGenerated(); |
| | | break; |
| | | } |
| | |
| | | initial ADS there and register the server with itself. */ |
| | | if (! adsContext.hasAdminData()) |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_CREATING_ADS_ON_REMOTE.get(getHostDisplay(auth)))); |
| | | } |
| | | |
| | | adsContext.createAdminData(null); |
| | | ServerDescriptor server |
| | |
| | | server.updateAdsPropertiesWithServerProperties(); |
| | | adsContext.registerServer(server.getAdsProperties()); |
| | | createdRemoteAds = true; |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | checkAbort(); |
| | | } |
| | | } |
| | | |
| | | /* Act on local server depending on if using remote or local ADS */ |
| | | notifyListeners(getFormattedWithPoints(INFO_PROGRESS_CREATING_ADS.get())); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners( |
| | | getFormattedWithPoints(INFO_PROGRESS_CREATING_ADS.get())); |
| | | } |
| | | localCtx = createLocalContext(); |
| | | // if (isRemoteServer) |
| | | // { |
| | |
| | | ServerDescriptor.seedAdsTrustStore(localCtx, |
| | | adsContext.getTrustedCertificates()); |
| | | } |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | checkAbort(); |
| | | |
| | | /* Add global administrator if the user specified one. */ |
| | |
| | | { |
| | | try |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_CREATING_ADMINISTRATOR.get())); |
| | | } |
| | | adsContext.createAdministrator(getAdministratorProperties( |
| | | getUserData())); |
| | | if (isRemoteServer && !createdRemoteAds) createdAdministrator = true; |
| | | notifyListeners(getFormattedDone()); |
| | | notifyListeners(getLineBreak()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | checkAbort(); |
| | | } |
| | | catch (ADSContextException ade) |