BrowseGeneralMonitoringPanel.java revision 2dc073d0f37048372498e13ffe84455896bac945
/*
* 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 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* The pane that is displayed when the user clicks on 'General Monitoring'.
*
*/
public class BrowseGeneralMonitoringPanel extends StatusGenericPanel
{
private static final long serialVersionUID = 6462914563746678830L;
/**
* The panel containing the tree.
*/
private JScrollPane treeScroll;
private ServerDescriptor lastServer;
private String lastServerName;
private boolean ignoreSelectionEvents;
private LocalizableMessage NO_ELEMENT_SELECTED =
private LocalizableMessage MULTIPLE_ITEMS_SELECTED =
/**
* The enumeration used to define the different static nodes of the tree.
*
*/
protected enum NodeType
{
/**
* Root node.
*/
ROOT,
/**
* System information node.
*/
/**
* Java information node.
*/
/**
* Work queue node.
*/
/**
* Entry caches node.
*/
/**
* Database environment node.
*/
}
/**
* The panel displaying the informations about the selected node.
*/
protected GeneralMonitoringRightPanel entryPane;
/**
* Default constructor.
*
*/
public BrowseGeneralMonitoringPanel()
{
super();
createLayout();
}
/** {@inheritDoc} */
public boolean requiresBorder()
{
return false;
}
/** {@inheritDoc} */
public boolean requiresScroll()
{
return false;
}
/** {@inheritDoc} */
public boolean callConfigurationChangedInBackground()
{
return true;
}
/** {@inheritDoc} */
public void toBeDisplayed(boolean visible)
{
if (w instanceof GenericDialog)
{
}
else if (w instanceof GenericFrame)
{
}
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
private void createLayout()
{
}
/** {@inheritDoc} */
public LocalizableMessage getTitle()
{
return INFO_CTRL_PANEL_GENERAL_MONITORING_TITLE.get();
}
/** {@inheritDoc} */
public Component getPreferredFocusComponent()
{
return treePane;
}
/** {@inheritDoc} */
public void okClicked()
{
// No ok button
}
/** {@inheritDoc} */
{
}
/**
* Creates the browser right panel.
* @return the created browser right panel.
*/
{
return new GeneralMonitoringRightPanel();
}
private Component createSplitPane()
{
{
/** {@inheritDoc} */
{
if (!ignoreSelectionEvents)
{
ignoreSelectionEvents = true;
ignoreSelectionEvents = false;
}
}
});
repopulateTree(tree, true);
tree.setRootVisible(true);
return pane;
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
if (serverChanged(server))
{
lastServer = server;
{
public void run()
{
// Repopulate the tree to display a root node with server information
{
}
if (firstTimeCalled)
{
// Select the root
}
else
{
// Reselect
}
}
});
}
else
{
lastServer = server;
}
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)
{
}
}
});
}
/**
* Populates the tree. Should be called only once since the tree in this
* panel is static.
* @param tree the tree to be repopulated.
* @param forceScroll whether the scroll must be reset or not.
*/
{
ignoreSelectionEvents = true;
{
}
{
root =
true);
}
else
{
root =
true);
}
{
identifiers[i], false));
}
ignoreSelectionEvents = false;
}
/**
* Updates the right entry panel.
*
*/
private void updateEntryPane()
{
boolean canDisplayMonitorInformation = true;
{
return;
}
{
if (!server.isAuthenticated())
{
canDisplayMonitorInformation = false;
}
}
else
{
canDisplayMonitorInformation = false;
}
{
{
}
{
switch (type)
{
case ROOT:
break;
case SYSTEM_INFORMATION:
break;
case WORK_QUEUE:
break;
case ENTRY_CACHES:
break;
case DB_ENVIRONMENT:
break;
case JAVA_INFORMATION:
break;
default:
}
}
else
{
{
}
else
{
}
}
}
}
{
}
{
boolean changed = false;
if (lastServer != null)
{
// Just compare the elements interesting for this panel
changed =
if (!changed)
{
{
};
{
};
{
{
}
else
{
}
}
}
}
else
{
changed = true;
}
return changed;
}
{
NodeType[] identifiers = {
};
LocalizableMessage[] ocPaths = {
};
{
getClass().getClassLoader()));
}
};
{
{
}
return serverName;
}
/**
* Specific class used to render the nodes in the tree. It uses specific
* icons for the nodes.
*
*/
protected class GeneralMonitoringTreeCellRenderer extends TreeCellRenderer
{
private static final long serialVersionUID = -3390566664259441766L;
/** {@inheritDoc} */
boolean hasFocus)
{
return this;
}
{
if (value instanceof GeneralMonitoringTreeNode)
{
}
else
{
}
return icon;
}
}
/**
* Returns the labels of the nodes to be displayed.
* @return the labels of the nodes to be displayed.
*/
protected LocalizableMessage[] getNodeMessages()
{
return new LocalizableMessage[] {
};
}
/**
* Returns the node types to be displayed.
* @return the node types to be displayed.
*/
protected NodeType[] getNodeTypes()
{
return new NodeType[] {
};
}
}