Fix a bunch of warnings mentioned by the IDE (most of them related to the non-use of generics).
| | |
| | | import javax.swing.SwingUtilities; |
| | | import javax.swing.tree.TreeNode; |
| | | |
| | | import org.opends.admin.ads.ServerDescriptor; |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.guitools.controlpanel.ui.nodes.BasicNode; |
| | | import org.opends.messages.AdminToolMessages; |
| | |
| | | } |
| | | if (!checkSucceeded) |
| | | { |
| | | String hostPort = ServerDescriptor.getServerRepresentation(url.getHost(), |
| | | url.getPort()); |
| | | throw new SearchAbandonException( |
| | | State.FAILED, new ReferralLimitExceededException( |
| | | ERR_CTRL_PANEL_REFERRAL_LOOP.get(url.getRawBaseDN())), referral); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | * Abstract class used to describe the configuration of an index. |
| | | * |
| | | */ |
| | | public abstract class AbstractIndexDescriptor implements Comparable |
| | | public abstract class AbstractIndexDescriptor |
| | | implements Comparable<AbstractIndexDescriptor> |
| | | { |
| | | private String name; |
| | | private BackendDescriptor backend; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | public abstract class AbstractIndexTableModel extends SortableTableModel |
| | | implements Comparator<AbstractIndexDescriptor> |
| | | { |
| | | private static final long serialVersionUID = -5131878622200568636L; |
| | | private Set<AbstractIndexDescriptor> data = |
| | | new HashSet<AbstractIndexDescriptor>(); |
| | | private ArrayList<String[]> dataArray = |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | * used by the classes in the BackendTableModel class. |
| | | * |
| | | */ |
| | | public class BaseDNDescriptor implements Comparable |
| | | public class BaseDNDescriptor implements Comparable<BaseDNDescriptor> |
| | | { |
| | | /** |
| | | * An enumeration describing the type of base DN for a given backend. |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareTo(Object o) |
| | | public int compareTo(BaseDNDescriptor desc) |
| | | { |
| | | int returnValue = -1; |
| | | if (o instanceof BaseDNDescriptor) |
| | | returnValue = desc.getDn().compareTo(getDn()); |
| | | if (returnValue == 0) |
| | | { |
| | | BaseDNDescriptor desc = (BaseDNDescriptor)o; |
| | | returnValue = desc.getDn().compareTo(getDn()); |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = getType().compareTo(desc.getType()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | getBackend().getBackendID().compareTo( |
| | | desc.getBackend().getBackendID()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = compare(getEntries(), desc.getEntries()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = compare(getAgeOfOldestMissingChange(), |
| | | desc.getAgeOfOldestMissingChange()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = compare(getMissingChanges(), desc.getMissingChanges()); |
| | | } |
| | | returnValue = getType().compareTo(desc.getType()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | getBackend().getBackendID().compareTo( |
| | | desc.getBackend().getBackendID()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = compare(getEntries(), desc.getEntries()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = compare(getAgeOfOldestMissingChange(), |
| | | desc.getAgeOfOldestMissingChange()); |
| | | } |
| | | if (returnValue == 0) |
| | | { |
| | | returnValue = compare(getMissingChanges(), desc.getMissingChanges()); |
| | | } |
| | | return returnValue; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareTo(Object o) |
| | | public int compareTo(AbstractIndexDescriptor o) |
| | | { |
| | | int returnValue = -1; |
| | | if (o instanceof AbstractIndexDescriptor) |
| | | { |
| | | AbstractIndexDescriptor index = (AbstractIndexDescriptor)o; |
| | | returnValue = getName().compareTo(index.getName()); |
| | | } |
| | | return returnValue; |
| | | return getName().compareTo(o.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | | |
| | |
| | | public abstract class MonitoringTableModel<T, P> extends SortableTableModel |
| | | implements Comparator<P> |
| | | { |
| | | private static final long serialVersionUID = -3974562860632179025L; |
| | | private Set<P> data = new HashSet<P>(); |
| | | private ArrayList<String[]> dataArray = new ArrayList<String[]>(); |
| | | private ArrayList<P> dataSourceArray = new ArrayList<P>(); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | |
| | | if (areEqual) |
| | | { |
| | | Iterable[] iterables = {attr1.getExtraPropertyNames(), |
| | | Iterable<?>[] iterables = {attr1.getExtraPropertyNames(), |
| | | attr2.getExtraPropertyNames(), |
| | | attr1.getNormalizedNames(), attr2.getNormalizedNames(), |
| | | attr1.getUserDefinedNames(), attr2.getUserDefinedNames()}; |
| | |
| | | |
| | | if (areEqual) |
| | | { |
| | | Iterable[] iterables = { |
| | | Iterable<?>[] iterables = { |
| | | oc1.getExtraPropertyNames(), oc2.getExtraPropertyNames(), |
| | | oc1.getNormalizedNames(), oc2.getNormalizedNames(), |
| | | oc1.getUserDefinedNames(), oc2.getUserDefinedNames()}; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareTo(Object o) |
| | | public int compareTo(AbstractIndexDescriptor o) |
| | | { |
| | | int returnValue = -1; |
| | | if (o instanceof AbstractIndexDescriptor) |
| | | { |
| | | AbstractIndexDescriptor index = (AbstractIndexDescriptor)o; |
| | | returnValue = getName().compareTo(index.getName()); |
| | | } |
| | | return returnValue; |
| | | return getName().compareTo(o.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | */ |
| | | public abstract class AbstractBackendIndexesPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = 2702054131388877743L; |
| | | private String backendName; |
| | | /** |
| | | * The table model. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | public abstract class AbstractBrowseEntriesPanel extends StatusGenericPanel |
| | | implements BackendPopulatedListener |
| | | { |
| | | private static final long serialVersionUID = -6063927039968115236L; |
| | | private JComboBox baseDNs; |
| | | /** |
| | | * The combo box containing the different filter types. |
| | |
| | | |
| | | if (!node.isLeaf()) |
| | | { |
| | | Enumeration en = node.children(); |
| | | Enumeration<?> en = node.children(); |
| | | while (en.hasMoreElements()) |
| | | { |
| | | nEntries ++; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | |
| | | */ |
| | | public abstract class AbstractIndexPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = 4465529396749593707L; |
| | | /** |
| | | * Title panel. |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | */ |
| | | public abstract class AbstractNewEntryPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = 6894546787832469213L; |
| | | |
| | | /** |
| | | * The parent node that was selected when the user clicked on the new entry |
| | | * action. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | |
| | | import org.opends.server.util.ServerConstants; |
| | | |
| | | /** |
| | | * Abstract class used to refactor some code between the classes that are used |
| | | * Abstract class used to re-factor some code between the classes that are used |
| | | * to edit/create a VLV index. |
| | | * |
| | | */ |
| | | public abstract class AbstractVLVIndexPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = -82857384664911898L; |
| | | /** |
| | | * Title panel. |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | * @param syntax the attribute syntax that the panel must display. |
| | | * @param schema the schema. |
| | | */ |
| | | public void update(AttributeSyntax syntax, Schema schema) |
| | | public void update(AttributeSyntax<?> syntax, Schema schema) |
| | | { |
| | | String n = syntax.getSyntaxName(); |
| | | if (n == null) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | */ |
| | | public abstract class BackupListPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = -4804555239922795163L; |
| | | |
| | | /** |
| | | * The text field containing the parent directory. |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = |
| | | new HashMap<Object, ImageIcon>(); |
| | | private HashMap<Class, ImageIcon> hmImages = new HashMap<Class, ImageIcon>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = |
| | | new HashMap<Class<?>, ImageIcon>(); |
| | | { |
| | | Object[] nodes = {standardIndexes, vlvIndexes}; |
| | | String[] paths = {"ds-idx-folder.png", "ds-vlv-idx-folder.png"}; |
| | |
| | | hmCategoryImages.put(nodes[i], |
| | | Utilities.createImageIcon(IconPool.IMAGE_PATH+"/"+paths[i])); |
| | | } |
| | | Class[] classes = {IndexTreeNode.class, VLVIndexTreeNode.class}; |
| | | Class<?>[] classes = {IndexTreeNode.class, VLVIndexTreeNode.class}; |
| | | String[] ocPaths = {"ds-idx.png", "ds-vlv-idx.png"}; |
| | | for (int i=0; i<classes.length; i++) |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | |
| | | */ |
| | | public abstract class GeneralMonitoringPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = 2840755228290832143L; |
| | | |
| | | /** |
| | | * The empty border shared by all the panels. |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | |
| | | public abstract class GenericMenuBar extends JMenuBar |
| | | { |
| | | private static final long serialVersionUID = -7289801307628271507L; |
| | | |
| | | private ControlPanelInfo info; |
| | | |
| | | /** |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | */ |
| | | public abstract class InclusionExclusionPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = -3826176895778069011L; |
| | | /** |
| | | * The DNs to exclude. |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | titlePanel.setDetails(Message.raw(n)); |
| | | name.setText(n); |
| | | oid.setText(matchingRule.getOID()); |
| | | AttributeSyntax s = null; |
| | | AttributeSyntax<?> s = null; |
| | | String syntaxOID = matchingRule.getSyntaxOID(); |
| | | for (AttributeSyntax candidate : schema.getSyntaxes().values()) |
| | | for (AttributeSyntax<?> candidate : schema.getSyntaxes().values()) |
| | | { |
| | | if (candidate.getOID().equals(syntaxOID)) |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | |
| | | JPanel checkBoxPanel = new JPanel(new GridBagLayout()); |
| | | checkBoxPanel.setOpaque(false); |
| | | JScrollPane scroll = Utilities.createBorderLessScrollBar(checkBoxPanel); |
| | | ScrollPaneBorderListener scrollListener = |
| | | ScrollPaneBorderListener.createFullBorderListener(scroll); |
| | | ScrollPaneBorderListener.createFullBorderListener(scroll); |
| | | |
| | | checkboxes = new JCheckBox[monitoringAttributes.size()]; |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | import org.opends.server.types.Schema; |
| | | |
| | | /** |
| | | * Abstract class used to refactor some code among the panels that display the |
| | | * Abstract class used to re-factor some code among the panels that display the |
| | | * contents of a schema element. |
| | | * |
| | | */ |
| | | public abstract class SchemaElementPanel extends StatusGenericPanel |
| | | { |
| | | private static final long serialVersionUID = -8556383593966382604L; |
| | | |
| | | private Set<SchemaElementSelectionListener> listeners = |
| | | new HashSet<SchemaElementSelectionListener>(); |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.nodes; |
| | |
| | | */ |
| | | public abstract class AbstractIndexTreeNode extends DefaultMutableTreeNode |
| | | { |
| | | private static final long serialVersionUID = 8055748310817873273L; |
| | | private String name; |
| | | /** |
| | | * Constructor. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.nodes; |
| | |
| | | public class AttributeSyntaxTreeNode extends SchemaElementTreeNode |
| | | { |
| | | private static final long serialVersionUID = 2439971368723239776L; |
| | | private AttributeSyntax syntax; |
| | | private AttributeSyntax<?> syntax; |
| | | |
| | | /** |
| | | * Constructor of the node. |
| | | * @param name the name of the node. |
| | | * @param syntax the attribute syntax. |
| | | */ |
| | | public AttributeSyntaxTreeNode(String name, AttributeSyntax syntax) |
| | | public AttributeSyntaxTreeNode(String name, AttributeSyntax<?> syntax) |
| | | { |
| | | super(name, syntax); |
| | | this.syntax = syntax; |
| | |
| | | * Returns the attribute syntax represented by this node. |
| | | * @return the attribute syntax represented by this node. |
| | | */ |
| | | public AttributeSyntax getAttributeSyntax() |
| | | public AttributeSyntax<?> getAttributeSyntax() |
| | | { |
| | | return syntax; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui.nodes; |
| | |
| | | */ |
| | | public abstract class SchemaElementTreeNode extends DefaultMutableTreeNode |
| | | { |
| | | private static final long serialVersionUID = 5832209952457633471L; |
| | | private String name; |
| | | private Object schemaElement; |
| | | |
| | |
| | | public Component getListCellRendererComponent(JList list, Object value, |
| | | int index, boolean isSelected, boolean cellHasFocus) |
| | | { |
| | | if (value instanceof AttributeSyntax) |
| | | if (value instanceof AttributeSyntax<?>) |
| | | { |
| | | String syntaxName = ((AttributeSyntax)value).getSyntaxName(); |
| | | String syntaxName = ((AttributeSyntax<?>)value).getSyntaxName(); |
| | | if (syntaxName == null) |
| | | { |
| | | value = ((AttributeSyntax)value).getOID(); |
| | | value = ((AttributeSyntax<?>)value).getOID(); |
| | | } |
| | | else |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.util; |
| | |
| | | import org.opends.server.types.CanceledOperationException; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryEnvironmentConfig; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.IndexType; |
| | |
| | | serverRoot = rootFile.getAbsolutePath(); |
| | | |
| | | File instanceRootFile = |
| | | DirectoryServer.getEnvironmentConfig(). |
| | | getInstanceRootFromServerRoot(rootFile); |
| | | DirectoryEnvironmentConfig.getInstanceRootFromServerRoot(rootFile); |
| | | instanceRoot = instanceRootFile.getAbsolutePath(); |
| | | } |
| | | catch (InitializationException ie) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.util; |
| | |
| | | new ArrayList<AttributeType>(); |
| | | private final ArrayList<MatchingRule> matchingRulesToKeep = |
| | | new ArrayList<MatchingRule>(); |
| | | private final ArrayList<AttributeSyntax> syntaxesToKeep = |
| | | new ArrayList<AttributeSyntax>(); |
| | | private final ArrayList<AttributeSyntax<?>> syntaxesToKeep = |
| | | new ArrayList<AttributeSyntax<?>>(); |
| | | |
| | | /** |
| | | * Constructor. |
| | |
| | | { |
| | | matchingRulesToKeep.add(mr); |
| | | } |
| | | for (AttributeSyntax syntax : sc.getSyntaxes().values()) |
| | | for (AttributeSyntax<?> syntax : sc.getSyntaxes().values()) |
| | | { |
| | | syntaxesToKeep.add(syntax); |
| | | } |
| | |
| | | { |
| | | schema.registerMatchingRule(mr, true); |
| | | } |
| | | for (AttributeSyntax syntax : syntaxesToKeep) |
| | | for (AttributeSyntax<?> syntax : syntaxesToKeep) |
| | | { |
| | | schema.registerSyntax(syntax, true); |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller; |
| | |
| | | import org.opends.messages.ToolMessages; |
| | | |
| | | import java.io.File; |
| | | import java.util.logging.Logger; |
| | | import org.opends.quicksetup.CliApplication; |
| | | import org.opends.quicksetup.Launcher; |
| | | import org.opends.quicksetup.Installation; |
| | |
| | | /** Suffix for log files. */ |
| | | static public final String LOG_FILE_SUFFIX = ".log"; |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(UninstallLauncher.class.getName()); |
| | | |
| | | /** |
| | | * The main method which is called by the uninstall command lines. |
| | | * |
| | |
| | | uud.setUpdateRemoteReplication(false); |
| | | |
| | | Set<String> dbs = new HashSet<String>(); |
| | | Set s = (Set) qs.getFieldValue(FieldName.EXTERNAL_DB_DIRECTORIES); |
| | | Set<?> s = (Set<?>) qs.getFieldValue(FieldName.EXTERNAL_DB_DIRECTORIES); |
| | | for (Object v : s) { |
| | | dbs.add((String) v); |
| | | } |
| | | |
| | | Set<String> logs = new HashSet<String>(); |
| | | s = (Set) qs.getFieldValue(FieldName.EXTERNAL_LOG_FILES); |
| | | s = (Set<?>) qs.getFieldValue(FieldName.EXTERNAL_LOG_FILES); |
| | | for (Object v : s) { |
| | | logs.add((String) v); |
| | | } |
| | |
| | | */ |
| | | public boolean finishClicked(final WizardStep cStep, final QuickSetup qs) { |
| | | if (cStep == Step.CONFIRM_UNINSTALL) { |
| | | BackgroundTask worker = new BackgroundTask() { |
| | | public Object processBackgroundTask() throws UserDataException { |
| | | BackgroundTask<UninstallData> worker = |
| | | new BackgroundTask<UninstallData>() { |
| | | public UninstallData processBackgroundTask() throws UserDataException { |
| | | try { |
| | | updateUserUninstallDataForConfirmUninstallPanel(qs); |
| | | return new UninstallData(Installation.getLocal()); |
| | |
| | | } |
| | | } |
| | | |
| | | public void backgroundTaskCompleted(Object returnValue, |
| | | public void backgroundTaskCompleted(UninstallData returnValue, |
| | | Throwable throwable) { |
| | | qs.getDialog().workerFinished(); |
| | | if (throwable != null) { |
| | |
| | | INFO_ERROR_TITLE.get()); |
| | | } |
| | | } else { |
| | | conf = (UninstallData)returnValue; |
| | | conf = returnValue; |
| | | if (conf.isADS() && conf.isReplicationServer()) |
| | | { |
| | | if (conf.isServerRunning()) |
| | |
| | | conf.getReplicationServerPort()); |
| | | getUninstallUserData().setReferencedHostName(loginDialog.getHostName()); |
| | | |
| | | BackgroundTask worker = new BackgroundTask() |
| | | BackgroundTask<TopologyCache> worker = new BackgroundTask<TopologyCache>() |
| | | { |
| | | public Object processBackgroundTask() throws Throwable |
| | | public TopologyCache processBackgroundTask() throws Throwable |
| | | { |
| | | LOG.log(Level.INFO, "Loading Topology Cache in askForAuthentication"); |
| | | ADSContext adsContext = new ADSContext(ctx); |
| | |
| | | cache.reloadTopology(); |
| | | return cache; |
| | | } |
| | | public void backgroundTaskCompleted(Object returnValue, |
| | | public void backgroundTaskCompleted(TopologyCache returnValue, |
| | | Throwable throwable) { |
| | | qs.getDialog().workerFinished(); |
| | | if (throwable != null) |
| | |
| | | } |
| | | else |
| | | { |
| | | TopologyCache cache = (TopologyCache)returnValue; |
| | | TopologyCache cache = returnValue; |
| | | handleTopologyCache(qs, cache); |
| | | } |
| | | } |
| | |
| | | { |
| | | LOG.log(Level.INFO, "Accepting certificate presented by host "+host); |
| | | getTrustManager().acceptCertificate(chain, authType, host); |
| | | BackgroundTask worker = new BackgroundTask() |
| | | BackgroundTask<TopologyCache> worker = |
| | | new BackgroundTask<TopologyCache>() |
| | | { |
| | | public Object processBackgroundTask() throws Throwable |
| | | public TopologyCache processBackgroundTask() throws Throwable |
| | | { |
| | | LOG.log(Level.INFO, "Reloading topology"); |
| | | cache.getFilter().setSearchMonitoringInformation(false); |
| | | cache.reloadTopology(); |
| | | return cache; |
| | | } |
| | | public void backgroundTaskCompleted(Object returnValue, |
| | | public void backgroundTaskCompleted(TopologyCache returnValue, |
| | | Throwable throwable) { |
| | | qs.getDialog().workerFinished(); |
| | | if (throwable != null) |
| | |
| | | ServerDescriptor.ServerProperty.IS_REPLICATION_SERVER); |
| | | if (Boolean.TRUE.equals(v)) |
| | | { |
| | | Set replicationServers = (Set<?>)server.getServerProperties().get( |
| | | Set<?> replicationServers = (Set<?>)server.getServerProperties().get( |
| | | ServerDescriptor.ServerProperty.EXTERNAL_REPLICATION_SERVERS); |
| | | if (replicationServers != null) |
| | | { |
| | |
| | | { |
| | | property = ServerDescriptor.ServerProperty.LDAP_PORT; |
| | | } |
| | | ArrayList ports = (ArrayList)server.getServerProperties().get(property); |
| | | ArrayList<?> ports = |
| | | (ArrayList<?>)server.getServerProperties().get(property); |
| | | if (ports != null) |
| | | { |
| | | isServerToUninstall = ports.contains(port); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller.ui; |
| | |
| | | |
| | | private static final long serialVersionUID = 81730510134697056L; |
| | | |
| | | private CurrentInstallStatus installStatus; |
| | | private Set<String> outsideDbs; |
| | | private Set<String> outsideLogs; |
| | | |
| | |
| | | CurrentInstallStatus installStatus) |
| | | { |
| | | super(application); |
| | | this.installStatus = installStatus; |
| | | } |
| | | |
| | | /** |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller.ui; |
| | |
| | | */ |
| | | private void okClicked() |
| | | { |
| | | BackgroundTask worker = new BackgroundTask() |
| | | BackgroundTask<Boolean> worker = new BackgroundTask<Boolean>() |
| | | { |
| | | public Object processBackgroundTask() throws NamingException, |
| | | public Boolean processBackgroundTask() throws NamingException, |
| | | ApplicationException |
| | | { |
| | | Boolean isServerRunning = Boolean.TRUE; |
| | |
| | | return isServerRunning; |
| | | } |
| | | |
| | | public void backgroundTaskCompleted(Object returnValue, |
| | | public void backgroundTaskCompleted(Boolean returnValue, |
| | | Throwable throwable) |
| | | { |
| | | if (throwable != null) |
| | |
| | | String appClassName = |
| | | System.getProperty("org.opends.quicksetup.Application.class"); |
| | | if (appClassName != null) { |
| | | Class appClass = null; |
| | | Class<?> appClass = null; |
| | | try { |
| | | appClass = Class.forName(appClassName); |
| | | app = (GuiApplication) appClass.newInstance(); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | |
| | | * Represents information about the current build that is |
| | | * publicly obtainable by invoking start-ds -F. |
| | | */ |
| | | public class BuildInformation implements Comparable { |
| | | public class BuildInformation implements Comparable<BuildInformation> { |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(BuildInformation.class.getName()); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int compareTo(Object o) { |
| | | BuildInformation bi = (BuildInformation) o; |
| | | public int compareTo(BuildInformation bi) { |
| | | if (getMajorVersion().equals(bi.getMajorVersion())) { |
| | | if (getMinorVersion().equals(bi.getMinorVersion())) { |
| | | if (getPointVersion().equals(bi.getPointVersion())) { |
| | |
| | | public boolean equals(Object o) { |
| | | return this == o || |
| | | !(o == null || getClass() != o.getClass()) && |
| | | compareTo(o) == 0; |
| | | compareTo((BuildInformation)o) == 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | return hc; |
| | | } |
| | | |
| | | static private void checkNotNull(Map values, String... props) |
| | | static private void checkNotNull(Map<?, ?> values, String... props) |
| | | throws ApplicationException { |
| | | for (String prop : props) { |
| | | if (null == values.get(prop)) { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String createUnorderedList(List list) { |
| | | public String createUnorderedList(List<?> list) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (list != null) { |
| | | for (Object o : list) { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | |
| | | import java.io.IOException; |
| | | import java.util.Set; |
| | | import java.util.HashSet; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * Represents the contents of an OpenDS configuration file. |
| | | */ |
| | | public class Configuration { |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(Configuration.class.getName()); |
| | | |
| | | private String contents = null; |
| | | private String lowerCaseContents = null; |
| | | private Installation install = null; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the error that was generated during creation. |
| | | * @return the error that was generated during creation. |
| | | */ |
| | | public Exception getCreationError() |
| | | { |
| | | return creationError; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String toString() { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup; |
| | |
| | | * @param list to format |
| | | * @return String representing the list |
| | | */ |
| | | String createUnorderedList(List list); |
| | | String createUnorderedList(List<?> list); |
| | | |
| | | /** |
| | | * Promt the user for a string. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installandupgrader; |
| | |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.Set; |
| | | import java.util.logging.Logger; |
| | | |
| | | import org.opends.quicksetup.ButtonName; |
| | | import org.opends.quicksetup.Constants; |
| | |
| | | */ |
| | | public class InstallAndUpgrader extends GuiApplication |
| | | { |
| | | static private final Logger LOG = |
| | | Logger.getLogger(InstallAndUpgrader.class.getName()); |
| | | private GuiApplication installer; |
| | | private GuiApplication upgrader; |
| | | private InstallAndUpgradeUserData userData; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.installer; |
| | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | |
| | | import java.io.File; |
| | | import java.util.logging.Logger; |
| | | |
| | | import org.opends.quicksetup.Constants; |
| | | import org.opends.quicksetup.ReturnCode; |
| | |
| | | * based setup much be launched. |
| | | */ |
| | | public class SetupLauncher extends Launcher { |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(SetupLauncher.class.getName()); |
| | | |
| | | /** |
| | | * The main method which is called by the setup command lines. |
| | | * |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | |
| | | switch (type) |
| | | { |
| | | case REPLICATE_WITH_EXISTING_SUFFIXES: |
| | | Set s = (Set)args[0]; |
| | | Set<?> s = (Set<?>)args[0]; |
| | | availableSuffixes = new LinkedHashSet<SuffixDescriptor>(); |
| | | for (Object o: s) |
| | | { |
| | | availableSuffixes.add((SuffixDescriptor)o); |
| | | } |
| | | s = (Set)args[1]; |
| | | s = (Set<?>)args[1]; |
| | | suffixesToReplicate = new LinkedHashSet<SuffixDescriptor>(); |
| | | for (Object o: s) |
| | | { |
| | |
| | | // If there is something put it. |
| | | if ((args != null) && (args.length > 0)) |
| | | { |
| | | s = (Set)args[0]; |
| | | s = (Set<?>)args[0]; |
| | | availableSuffixes = new LinkedHashSet<SuffixDescriptor>(); |
| | | for (Object o: s) |
| | | { |
| | | availableSuffixes.add((SuffixDescriptor)o); |
| | | } |
| | | s = (Set)args[1]; |
| | | s = (Set<?>)args[1]; |
| | | suffixesToReplicate = new LinkedHashSet<SuffixDescriptor>(); |
| | | for (Object o: s) |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | |
| | | private void shutDownClicked() |
| | | { |
| | | isCancelled = false; |
| | | BackgroundTask worker = new BackgroundTask() |
| | | BackgroundTask<Boolean> worker = new BackgroundTask<Boolean>() |
| | | { |
| | | public Object processBackgroundTask() throws NamingException |
| | | public Boolean processBackgroundTask() throws NamingException |
| | | { |
| | | Boolean isServerRunning = Boolean.TRUE; |
| | | try |
| | |
| | | return isServerRunning; |
| | | } |
| | | |
| | | public void backgroundTaskCompleted(Object returnValue, |
| | | public void backgroundTaskCompleted(Boolean returnValue, |
| | | Throwable throwable) |
| | | { |
| | | if (throwable != null) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | |
| | | // platforms. |
| | | try |
| | | { |
| | | Class cl = Class.forName("org.opends.quicksetup.CliUserInteraction"); |
| | | Class<?> cl = |
| | | Class.forName("org.opends.quicksetup.CliUserInteraction"); |
| | | ui = (UserInteraction) cl.newInstance(); |
| | | } |
| | | catch (Throwable t) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public String createUnorderedList(List list) { |
| | | public String createUnorderedList(List<?> list) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (list != null) { |
| | | sb.append(Constants.HTML_UNORDERED_LIST_OPEN); |
| | |
| | | * This is a class used when the user clicks on next and that extends |
| | | * BackgroundTask. |
| | | */ |
| | | private class NextClickedBackgroundTask extends BackgroundTask |
| | | private class NextClickedBackgroundTask extends BackgroundTask<Object> |
| | | { |
| | | private WizardStep cStep; |
| | | public NextClickedBackgroundTask(WizardStep cStep) |
| | |
| | | application.acceptCertificateForException(ce, |
| | | answer == CertificateDialog.ReturnType.ACCEPTED_PERMANENTLY); |
| | | application.nextClicked(cStep, QuickSetup.this); |
| | | BackgroundTask worker = new NextClickedBackgroundTask(cStep); |
| | | BackgroundTask<Object> worker = |
| | | new NextClickedBackgroundTask(cStep); |
| | | getDialog().workerStarted(); |
| | | worker.startBackgroundTask(); |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.ui; |
| | |
| | | */ |
| | | public abstract class ReviewPanel extends QuickSetupStepPanel { |
| | | |
| | | private static final long serialVersionUID = 509534079919269557L; |
| | | |
| | | /** |
| | | * Creates an instance. |
| | | * @param application GuiApplication this panel represents |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | private File getCustomSchemaDiffFile() throws IOException { |
| | | return new File(backupDir, "schema.custom.diff"); |
| | | } |
| | | |
| | | private File getCustomADSDiffFile() throws IOException { |
| | | return new File(backupDir, "admin-backend.custom.diff"); |
| | | } |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.StringArgument; |
| | | |
| | | import java.util.logging.Logger; |
| | | import java.io.File; |
| | | import org.opends.server.util.DynamicConstants; |
| | | |
| | |
| | | /** Prefix for log files. */ |
| | | static public final String LOG_FILE_PREFIX = "opends-upgrade-"; |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(UpgradeLauncher.class.getName()); |
| | | |
| | | /** Short form of the option for specifying the installation package file. */ |
| | | static public final Character FILE_OPTION_SHORT = 'f'; |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.StringArgument; |
| | | |
| | | import java.util.logging.Logger; |
| | | import java.io.File; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class UpgradeSvr4Launcher extends UpgradeLauncher { |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(UpgradeSvr4Launcher.class.getName()); |
| | | |
| | | /** |
| | | * The main method which is called by the setup command lines. |
| | | * |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | import org.opends.quicksetup.UserDataException; |
| | | import org.opends.server.util.cli.ConsoleApplication; |
| | | |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * Assists Upgrader utility in CLI drudgery. |
| | | */ |
| | | public class UpgraderCliHelper extends ConsoleApplication { |
| | | |
| | | static private final Logger LOG = |
| | | Logger.getLogger(UpgraderCliHelper.class.getName()); |
| | | |
| | | /** Launcher for this CLI invocation. */ |
| | | protected UpgradeLauncher launcher; |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | * @param list to format |
| | | * @return String representing the list |
| | | */ |
| | | protected String createUnorderedList(List list) { |
| | | protected String createUnorderedList(List<?> list) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (list != null) { |
| | | for (Object o : list) { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.server.tools.status; |
| | |
| | | return Message.raw( |
| | | StaticUtils.wrapText(text, getCommandLineMaxLineWidth())); |
| | | } |
| | | |
| | | private static void printTimeSince(String msg, long initTime) |
| | | { |
| | | System.out.println(msg+" : "+(System.currentTimeMillis() - initTime)); |
| | | } |
| | | } |