| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools.tasks; |
| | | |
| | |
| | | { |
| | | checkHeaderDisplay(); |
| | | |
| | | MenuBuilder<FailedDependencyAction> builder = |
| | | new MenuBuilder<FailedDependencyAction>(app); |
| | | MenuBuilder<FailedDependencyAction> builder = new MenuBuilder<>(app); |
| | | builder.setPrompt(INFO_TASK_FAILED_DEPENDENCY_ACTION_PROMPT.get()); |
| | | builder.addCancelOption(false); |
| | | for (FailedDependencyAction choice : FailedDependencyAction.values()) |
| | |
| | | { |
| | | throw new ClientException(ReturnCode.ERROR_UNEXPECTED, LocalizableMessage.EMPTY); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void runDependency() throws ClientException |
| | |
| | | if (hasDependencies) |
| | | { |
| | | printAvailableDependencyTaskMessage(); |
| | | HashSet<String> dependencies = new HashSet<String>(); |
| | | HashSet<String> dependencies = new HashSet<>(); |
| | | while (true) |
| | | { |
| | | String dependencyID = |
| | |
| | | { |
| | | checkHeaderDisplay(); |
| | | |
| | | List<String> addresses = new ArrayList<String>(); |
| | | List<String> addresses = new ArrayList<>(); |
| | | boolean hasNotification = |
| | | app.confirmAction(hasNotificationPrompt, false); |
| | | if (hasNotification) |
| | | { |
| | | HashSet<String> set = new HashSet<String>(); |
| | | HashSet<String> set = new HashSet<>(); |
| | | while (true) |
| | | { |
| | | String address = |
| | | app.readLineOfInput(emailAddressPrompt); |
| | | if (address != null && !address.isEmpty()) |
| | | String address = app.readLineOfInput(emailAddressPrompt); |
| | | if (address == null || address.isEmpty()) |
| | | { |
| | | if (!StaticUtils.isEmailAddress(address)) { |
| | | app.println(ERR_INVALID_EMAIL_ADDRESS.get(address)); |
| | | } |
| | | else |
| | | { |
| | | set.add(address); |
| | | } |
| | | break; |
| | | } |
| | | if (!StaticUtils.isEmailAddress(address)) { |
| | | app.println(ERR_INVALID_EMAIL_ADDRESS.get(address)); |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | set.add(address); |
| | | } |
| | | } |
| | | addresses.addAll(set); |
| | |
| | | { |
| | | checkHeaderDisplay(); |
| | | |
| | | MenuBuilder<ScheduleOption> builder = new MenuBuilder<ScheduleOption>(app); |
| | | MenuBuilder<ScheduleOption> builder = new MenuBuilder<>(app); |
| | | builder.setPrompt(INFO_TASK_SCHEDULE_PROMPT.get(taskName)); |
| | | builder.addCancelOption(false); |
| | | for (ScheduleOption choice : ScheduleOption.values()) |