| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2012 ForgeRock AS. |
| | | * Portions copyright 2012-2013 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tasks; |
| | | import org.opends.messages.Message; |
| | |
| | | ArrayList<String> indexes = null; |
| | | private String tmpDirectory = null; |
| | | private RebuildMode rebuildMode = RebuildMode.USER_DEFINED; |
| | | boolean isClearDegradedState = false; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | |
| | | AttributeType typeBaseDN; |
| | | AttributeType typeIndex; |
| | | AttributeType typeTmpDirectory; |
| | | AttributeType clearDegradedState; |
| | | |
| | | typeBaseDN = |
| | | getAttributeType(ATTR_REBUILD_BASE_DN, true); |
| | |
| | | getAttributeType(ATTR_REBUILD_INDEX, true); |
| | | typeTmpDirectory = |
| | | getAttributeType(ATTR_REBUILD_TMP_DIRECTORY, true); |
| | | clearDegradedState = |
| | | getAttributeType(ATTR_REBUILD_INDEX_CLEARDEGRADEDSTATE, true); |
| | | |
| | | List<Attribute> attrList; |
| | | |
| | |
| | | indexes.clear(); |
| | | } |
| | | |
| | | attrList = taskEntry.getAttribute(clearDegradedState); |
| | | isClearDegradedState = Boolean.parseBoolean( |
| | | TaskUtils.getSingleValueString(attrList)); |
| | | |
| | | attrList = taskEntry.getAttribute(typeTmpDirectory); |
| | | tmpDirectory = TaskUtils.getSingleValueString(attrList); |
| | | |
| | |
| | | rebuildConfig.addRebuildIndex(index); |
| | | } |
| | | |
| | | // The degraded state is set(if present in args) |
| | | // during the initialization. |
| | | rebuildConfig.isClearDegradedState(isClearDegradedState); |
| | | |
| | | Backend backend = |
| | | DirectoryServer.getBackendWithBaseDN(rebuildConfig.getBaseDN()); |
| | |
| | | } |
| | | rebuildConfig.setTmpDirectory(tmpDirectory); |
| | | rebuildConfig.setRebuildMode(rebuildMode); |
| | | |
| | | TaskState returnCode = TaskState.COMPLETED_SUCCESSFULLY; |
| | | // Launch the rebuild process. |
| | | try |