/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2012 ForgeRock AS
*/
/**
* The class that is used when a set of indexes must be rebuilt.
*
*/
{
new TreeSet<AbstractIndexDescriptor>();
/**
* The indexes that must not be specified in the command-line.
*/
{"id2children", "id2subtree"};
/**
* Constructor of the task.
* @param info the control panel information.
* @param dlg the progress dialog where the task progress will be displayed.
* @param baseDNs the baseDNs corresponding to the indexes.
* @param indexes the indexes.
*/
{
}
/**
* {@inheritDoc}
*/
{
return Type.REBUILD_INDEXES;
}
/**
* {@inheritDoc}
*/
{
{
}
else
{
// Assume is in a backend
}
}
/**
* {@inheritDoc}
*/
{
boolean canLaunch = true;
{
// All the operations are incompatible if they apply to this
// backend.
{
canLaunch = false;
}
}
return canLaunch;
}
/**
* {@inheritDoc}
*/
public void runTask()
{
try
{
{
{
public void run()
{
}
});
if (isLocal && !isServerRunning())
{
args);
}
else
{
}
if (returnCode != 0)
{
break;
}
}
if (returnCode != 0)
{
}
else
{
{
}
}
}
catch (Throwable t)
{
lastException = t;
}
}
/**
* {@inheritDoc}
*/
{
}
/**
* Returns the command line arguments required to rebuild the indexes
* in the specified base DN.
* @param baseDN the base DN.
* @return the command line arguments required to rebuild the indexes
* in the specified base DN.
*/
{
if (rebuildAll())
{
}
else
{
{
if (index instanceof VLVIndexDescriptor)
{
}
else
{
}
}
}
if (isLocal && isServerRunning())
{
}
return args;
}
/**
* {@inheritDoc}
*/
{
return null;
}
private boolean rebuildAll()
{
boolean rebuildAll = true;
{
}
{
new HashSet<AbstractIndexDescriptor>();
{
if (!ignoreIndex(index))
{
boolean found = false;
{
{
found = true;
break;
}
}
if (!found)
{
rebuildAll = false;
break;
}
}
}
}
return rebuildAll;
}
{
boolean ignoreIndex = false;
if (index instanceof IndexDescriptor)
{
{
{
ignoreIndex = true;
break;
}
}
}
return ignoreIndex;
}
}