AbstractIndexPanel.java revision 688633f95faa52515b090ff00440b1eebdaad7d9
/*
* 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-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* Abstract class used to refactor some code between the classes that are used
*/
abstract class AbstractIndexPanel extends StatusGenericPanel
{
private static final long serialVersionUID = 4465529396749593707L;
/** Custom attributes message. */
/** Standard attributes message. */
static final LocalizableMessage STANDARD_ATTRIBUTES = INFO_CTRL_PANEL_STANDARD_ATTRIBUTES_LABEL.get();
/** Minimum value for entry limit. */
static final int MIN_ENTRY_LIMIT =
/** Maximum value for entry limit. */
static final int MAX_ENTRY_LIMIT =
/** LocalizableMessage to be displayed to indicate that an index is not configurable. */
static final LocalizableMessage NON_CONFIGURABLE_INDEX = INFO_CTRL_PANEL_NON_CONFIGURABLE_INDEX_LABEL.get();
/** LocalizableMessage to be displayed to indicate that an index has been modified. */
/** Default value for entry limit. */
static final int DEFAULT_ENTRY_LIMIT = 4000;
/** Attributes combo box. */
/** Name of the index label. */
/** Backends label. */
/** Read-only backend name label. */
/** Panel containing all the index types. */
/** Approximate index type check box. */
/** Equality index type check box. */
/** Ordering index type check box. */
/** Presence index type check box. */
/** Substring index type check box. */
/** Array of checkboxes. */
/** Array of index types that matches the array of checkboxes (types). */
final IndexTypeDescriptor[] configTypes = { IndexTypeDescriptor.APPROXIMATE, IndexTypeDescriptor.EQUALITY,
/** Label containing some warning information (such as the fact that the index cannot be edited). */
/**
* Repopulates the contents of the panel with the provided attribute type. It
* will check the checkboxes for which the attribute has a matching rule.
*
* @param attr
* the attribute.
*/
{
{
{
}
{
}
{
}
{
}
}
}
/**
* Creates the basic layout of the panel.
*
* @param c
* the container of the layout.
* @param gbc
* the grid bag constraints to be used.
* @param nameReadOnly
* whether the panel is read-only or not.
*/
{
addErrorPane(c, gbc);
if (nameReadOnly)
{
p.setOpaque(false);
}
if (!nameReadOnly)
{
}
else
{
}
p.setOpaque(false);
typesPanel.setOpaque(false);
gbc2 = new GridBagConstraints();
{
}
}
/**
* Returns a sorted set of index types (that matches what the user selected on
* the check boxes).
*
* @return a sorted set of indexes (that matches what the user selected on the
* check boxes).
*/
{
{
if (types[i].isSelected())
{
}
}
return indexTypes;
}
/**
* Returns a list of error message with the problems encountered in the data
* provided by the user.
*
* @return a list of error message with the problems encountered in the data
* provided by the user.
*/
{
try
{
if (n < MIN_ENTRY_LIMIT || MAX_ENTRY_LIMIT < n)
{
}
}
catch (Throwable t)
{
}
{
}
return errors;
}
{
}
void modifyIndexOffline(final String backendName, final String attributeName, final IndexDescriptor indexToModify,
{
}
throws OpenDsException
{
try
{
if (backend instanceof LocalDBBackendCfgClient)
{
}
else
{
}
}
catch (final Exception e)
{
}
}
final IndexDescriptor indexToModify, final String attributeName, final Set<IndexTypeDescriptor> indexTypes,
final int indexEntryLimit) throws Exception
{
{
}
{
}
}
private void updateLocalDBIndexOffline(final LocalDBBackendCfgClient backend, final IndexDescriptor indexToModify,
throws Exception
{
{
}
{
}
}
}