VerifyIndexPanel.java revision 8196da2152209c8c628611aeeb4adae32079921e
/*
* 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 legal-notices/CDDLv1_0.txt
* 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 legal-notices/CDDLv1_0.txt.
* 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 2014-2015 ForgeRock AS
*/
/**
* The panel that appears when the user wants to verify an index.
*/
{
private static final long serialVersionUID = 5252070109221657041L;
private JRadioButton verifyIndexContents;
private JRadioButton verifyKeyEntryIDs;
private JComboBox<?> keyEntryIDs;
private JLabel lNoBaseDNsFound;
/** Constructor of the panel. */
public VerifyIndexPanel()
{
super();
createLayout();
}
{
info.addIndexModifiedListener(this);
}
{
}
{
}
/** Creates the layout of the panel (but the contents are not populated here). */
private void createLayout()
{
{
{
}
});
lNoBaseDNsFound.setVisible(false);
verifyIndexContents = Utilities.createRadioButton(INFO_CTRL_PANEL_VERIFY_ENTRY_CONTEXT_ARE_INDEXES.get());
verifyIndexContents.setSelected(true);
JLabel explanation = Utilities.createInlineHelpLabel(INFO_CTRL_PANEL_REQUIRES_REBUILD_LEGEND.get());
verifyKeyEntryIDs.setSelected(true);
model = new DefaultComboBoxModel();
verifyIndexContents.setSelected(true);
listener = new ItemListener()
{
{
}
};
}
public LocalizableMessage getTitle()
{
}
public Component getPreferredFocusComponent()
{
return baseDNs;
}
{
}
{
{
public void run()
{
{
}
else
{
}
{
}
else
{
}
}
});
}
public void cancelClicked()
{
super.cancelClicked();
}
public void okClicked()
{
{
{
}
else
{
}
}
if (verifyIndexContents.isSelected())
{
{
}
}
else
{
{
}
}
{
new ProgressDialog(Utilities.createFrame(), Utilities.getParentDialog(this), getTitle(), getInfo());
{
}
{
progressDialog.setVisible(true);
}
}
{
}
}
{
}
private String getSelectedBaseDN()
{
}
private AbstractIndexDescriptor getSelectedIndex()
{
}
private void updateVerifyKeyEntriesComboBox()
{
{
{
{
if (index instanceof IndexDescriptor)
{
if (standardIndex.isDatabaseIndex())
{
}
else
{
}
}
else
{
}
}
}
}
}
{
{
{
}
}
}
/** The task in charge of verifying the index. */
protected class VerifyIndexTask extends IndexTask
{
/**
* The constructor of the task.
*
* @param info
* the control panel info.
* @param dlg
* the progress dialog that shows the progress of the task.
*/
{
this.baseDN = getSelectedBaseDN();
}
{
return Type.VERIFY_INDEXES;
}
public LocalizableMessage getTaskDescription()
{
}
public boolean canLaunch(Task taskToBeLaunched, Collection<LocalizableMessage> incompatibilityReasons)
{
boolean canLaunch = true;
{
// All the operations are incompatible if they apply to this backend.
{
canLaunch = false;
}
}
return canLaunch;
}
public void runTask()
{
try
{
}
catch (Throwable t)
{
lastException = t;
}
}
{
if (verifyIndexContents.isSelected())
{
{
}
}
else
{
}
return args;
}
{
if (index instanceof VLVIndexDescriptor)
{
}
}
protected String getCommandLinePath()
{
return getCommandLinePath("verify-index");
}
}
}