| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2012 ForgeRock AS. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | import org.opends.messages.Message; |
| | |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | |
| | | import org.opends.server.loggers.TextWriter; |
| | | import org.opends.server.loggers.ErrorLogger; |
| | | import org.opends.server.loggers.TextErrorLogPublisher; |
| | |
| | | private StringArgument tmpDirectory = null; |
| | | private BooleanArgument rebuildAll = null; |
| | | private BooleanArgument rebuildDegraded = null; |
| | | private BooleanArgument clearDegradedState = null; |
| | | |
| | | /** |
| | | * Processes the command-line arguments and invokes the rebuild process. |
| | |
| | | INFO_REBUILDINDEX_DESCRIPTION_REBUILD_DEGRADED.get()); |
| | | argParser.addArgument(rebuildDegraded); |
| | | |
| | | clearDegradedState = |
| | | new BooleanArgument("clearDegradedState", null, "clearDegradedState", |
| | | INFO_REBUILDINDEX_DESCRIPTION_CLEAR_DEGRADED_STATE.get()); |
| | | argParser.addArgument(clearDegradedState); |
| | | |
| | | tmpDirectory = |
| | | new StringArgument("tmpdirectory", null, "tmpdirectory", false, |
| | |
| | | } |
| | | else |
| | | { |
| | | if(clearDegradedState.isPresent()) { |
| | | rebuildConfig.isClearDegradedState(true); |
| | | } |
| | | rebuildConfig.setRebuildMode(RebuildMode.USER_DEFINED); |
| | | } |
| | | |
| | |
| | | attributes.add( |
| | | new LDAPAttribute(ATTR_REBUILD_INDEX, values)); |
| | | } |
| | | |
| | | if (clearDegradedState.getValue() != null && |
| | | !clearDegradedState.getValue().equals( |
| | | clearDegradedState.getDefaultValue())) { |
| | | values = new ArrayList<ByteString>(1); |
| | | values.add(ByteString.valueOf("true")); |
| | | attributes.add( |
| | | new LDAPAttribute(ATTR_REBUILD_INDEX_CLEARDEGRADEDSTATE, values)); |
| | | } |
| | | } |
| | | |
| | | /** |