NewVLVIndexPanel.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
*/
/**
* Panel that appears when the user defines a new VLV index.
*/
class NewVLVIndexPanel extends AbstractVLVIndexPanel
{
private static final long serialVersionUID = 1554866540747530939L;
/**
* Constructor of the panel.
*
* @param backendName
* the backend where the index will be created.
* @param relativeComponent
* the component relative to which the dialog containing this panel
* will be centered.
*/
{
super(backendName, relativeComponent);
createBasicLayout(this, new GridBagConstraints(), false);
}
public LocalizableMessage getTitle()
{
return INFO_CTRL_PANEL_NEW_VLV_INDEX_TITLE.get();
}
public Component getPreferredFocusComponent()
{
return name;
}
{
if (updateLayout(desc))
{
}
}
/**
* Updates the contents of the panel with the provided backend.
*
* @param backend
* the backend where the index will be created.
*/
{
}
/** {@inheritDoc} */
public void okClicked()
{
{
{
}
{
dlg.setVisible(true);
getParentDialog(this).setVisible(false);
}
}
{
}
}
/** The task in charge of creating the VLV index. */
private class NewVLVIndexTask extends Task
{
private final SearchScope searchScope;
private final String filterValue;
private final String sortOrderStringValue;
private VLVIndexDescriptor newIndex;
/**
* The constructor of the task.
*
* @param info
* the control panel info.
* @param dlg
* the progress dialog that shows the progress of the task.
*/
{
backendSet = new HashSet<>();
sortOrder = getSortOrder();
searchScope = getScope();
}
{
}
{
return backendSet;
}
public LocalizableMessage getTaskDescription()
{
}
public boolean canLaunch(Task taskToBeLaunched, Collection<LocalizableMessage> incompatibilityReasons)
{
{
// All the operations are incompatible if they apply to this
// backend for safety. This is a short operation so the limitation
// has not a lot of impact.
{
return false;
}
}
return true;
}
private void updateConfiguration() throws OpenDsException
{
boolean configHandlerUpdated = false;
try
{
if (!isServerRunning())
{
configHandlerUpdated = true;
getInfo().stopPooling();
if (getInfo().mustDeregisterConfig())
{
}
getInfo().setMustDeregisterConfig(true);
}
else
{
{
public void run()
{
}
});
}
{
public void run()
{
INFO_CTRL_PANEL_CREATING_NEW_VLV_INDEX_PROGRESS.get(indexName), ColorAndFontConstants.progressFont));
}
});
if (isServerRunning())
{
}
else
{
}
{
public void run()
{
}
});
}
finally
{
if (configHandlerUpdated)
{
DirectoryServer.getInstance().initializeConfiguration(ConfigReader.configClassName, ConfigReader.configFile);
getInfo().startPooling();
}
}
}
{
final ManagementContext mCtx = LDAPManagementContext.createFromContext(JNDIDirContextAdaptor.adapt(ctx));
}
private void createBackendVLVIndexOnline(final PluggableBackendCfgClient backend) throws OpenDsException
{
final BackendVLVIndexCfgClient index =
}
protected String getCommandLinePath()
{
return null;
}
{
return new ArrayList<>();
}
private String getConfigCommandLineName()
{
if (isServerRunning())
{
return getCommandLinePath("dsconfig");
}
else
{
return null;
}
}
public void runTask()
{
try
{
{
{
newIndex = new VLVIndexDescriptor(
break;
}
}
}
catch (final Throwable t)
{
lastException = t;
}
}
public void postOperation()
{
{
}
}
{
return args;
}
}
}