ConnectionHandlerMonitoringPanel.java revision 998747bfaaa3c6b28bbfaf0e282e6c0ccbf46bc0
/*
* 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 2009-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* Class that displays the monitoring information of connection handlers.
*
*/
public class ConnectionHandlerMonitoringPanel extends StatusGenericPanel
{
private static final long serialVersionUID = -6462932160985559830L;
private GenericDialog operationViewDlg;
private JComboBox connectionHandlers;
private JTable connectionHandlersTable;
private JScrollPane connectionHandlersScroll;
private boolean firstRealDataSet;
private JCheckBoxMenuItem showAveragesMenu;
new LinkedHashSet<MonitoringAttributes>();
{
}
new LinkedHashSet<MonitoringAttributes>();
{
}
private LocalizableMessage ALL_CONNECTION_HANDLERS =
/**
* Default constructor.
*
*/
public ConnectionHandlerMonitoringPanel()
{
super();
createLayout();
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
private void createLayout()
{
connectionHandlers = new JComboBox(
{
{
{
}
}
});
// Add some fake data.
"Third Connection Handler", "Fourth Connection Handler",
"Fifth Connection Handler", "Connection Handler with a long name"};
new HashSet<ConnectionHandlerDescriptor>();
try
{
{
}
}
catch (Throwable t)
{
// Ignore
}
new DefaultTableCellRenderer());
}
/**
* {@inheritDoc}
*/
public LocalizableMessage getTitle()
{
}
/**
* {@inheritDoc}
*/
public JMenuBar getMenuBar()
{
{
menuBar =
}
return menuBar;
}
/**
* {@inheritDoc}
*/
{
{
{
int compare = 0;
{
}
else
{
}
return compare;
}
});
{
if (protocolHasMonitoring(ch))
{
}
}
// Add the administration connector
{
}
boolean displayErrorPane = false;
{
if (!server.isAuthenticated())
{
get());
displayErrorPane = true;
}
}
{
server.getHostname()));
displayErrorPane = true;
}
else
{
get());
displayErrorPane = true;
}
final boolean fDisplayErrorPane = displayErrorPane;
{
/**
* {@inheritDoc}
*/
public void run()
{
if (fDisplayErrorPane)
{
}
// TODO: complete update the other table
if (!firstRealDataSet)
{
firstRealDataSet = true;
}
}
});
}
/**
* {@inheritDoc}
*/
public Component getPreferredFocusComponent()
{
return connectionHandlers;
}
/**
* {@inheritDoc}
*/
public void okClicked()
{
// No ok button
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
public boolean requiresBorder()
{
return false;
}
/**
* {@inheritDoc}
*/
public boolean requiresScroll()
{
return false;
}
private void setChOperationsToDisplay(
boolean showAverages)
{
}
{
{
}
else
{
switch (ch.getProtocol())
{
case OTHER:
break;
default:
break;
}
}
}
/**
* Displays a dialog allowing the user to select which operations to display.
*
*/
private void operationViewClicked()
{
if (operationViewDlg == null)
{
Utilities.getParentDialog(this));
operationViewDlg.setModal(true);
}
operationViewDlg.setVisible(true);
if (!operationViewPanel.isCanceled())
{
}
}
/**
* Updates the contents of the tables depending on whether the averages
* must be displayed or not.
*
*/
private void showAverageClicked()
{
}
private void updateTableSizes()
{
}
boolean errorOccurred)
{
}
{
new HashSet<ConnectionHandlerDescriptor>();
{
if (o instanceof CategorizedComboBoxElement)
{
{
{
if (protocolHasMonitoring(ch))
{
}
}
}
else
{
{
{
break;
}
}
{
{
}
}
}
}
}
return cchs;
}
{
return false;
}
/**
* The specific menu bar of this panel.
*
*/
class ConnectionHandlerMonitoringMenuBar extends MainMenuBar
{
private static final long serialVersionUID = 505187831116443370L;
/**
* Constructor.
* @param info the control panel info.
*/
{
super(info);
}
/**
* {@inheritDoc}
*/
protected void addMenus()
{
add(createViewMenuBar());
add(createHelpMenuBar());
}
/**
* Creates the view menu bar.
* @return the view menu bar.
*/
protected JMenu createViewMenuBar()
{
{
{
}
});
showAveragesMenu.setSelected(false);
{
{
}
});
return menu;
}
}
}