| | |
| | | * |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | * Portions Copyright 2012 profiq s.r.o. |
| | | */ |
| | | package org.opends.server.tools.dsreplication; |
| | |
| | | Collection<String> availableSuffixes, Arg0 noSuffixAvailableMsg, |
| | | Arg0 noSuffixSelectedMsg, Arg1<Object> confirmationMsgPromt) |
| | | { |
| | | while (suffixes.isEmpty()) |
| | | if (containsOnlySchemaOrAdminSuffix(availableSuffixes)) |
| | | { |
| | | if (containsSchemaOrAdminSuffix(availableSuffixes)) |
| | | { |
| | | // In interactive mode we do not propose to manage the |
| | | // administration suffix. |
| | | // In interactive mode we do not propose to manage the administration suffix. |
| | | println(); |
| | | println(noSuffixAvailableMsg.get()); |
| | | break; |
| | | return; |
| | | } |
| | | |
| | | while (suffixes.isEmpty()) |
| | | { |
| | | println(); |
| | | println(noSuffixSelectedMsg.get()); |
| | | boolean confirmationLimitReached = askConfirmations(confirmationMsgPromt, availableSuffixes, suffixes); |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean containsSchemaOrAdminSuffix(Collection<String> suffixes) |
| | | private boolean containsOnlySchemaOrAdminSuffix(Collection<String> suffixes) |
| | | { |
| | | for (String suffix : suffixes) |
| | | { |
| | | if (isSchemaOrAdminSuffix(suffix)) |
| | | if (!isSchemaOrAdminSuffix(suffix)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private boolean isSchemaOrAdminSuffix(String suffix) |
| | | { |
| | |
| | | { |
| | | while (suffixes.isEmpty()) |
| | | { |
| | | if (containsSchemaOrAdminSuffix(availableSuffixes)) |
| | | if (containsOnlySchemaOrAdminSuffix(availableSuffixes)) |
| | | { |
| | | // In interactive mode we do not propose to manage the |
| | | // administration suffix. |
| | | // In interactive mode we do not propose to manage the administration suffix. |
| | | if (displayErrors) |
| | | { |
| | | println(); |
| | |
| | | while (suffixes.isEmpty()) |
| | | { |
| | | println(); |
| | | if (containsSchemaOrAdminSuffix(availableSuffixes)) |
| | | if (containsOnlySchemaOrAdminSuffix(availableSuffixes)) |
| | | { |
| | | // In interactive mode we do not propose to manage the administration suffix. |
| | | if (argParser.isInitializeAllReplicationSubcommand()) |