StatusPanel.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 2008-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* basic configuration (base DNs, connection listeners) and that allows to start
* and stop the server.
*
*/
class StatusPanel extends StatusGenericPanel
{
private static final long serialVersionUID = -6493442314639004717L;
/** The place holder where we display errors. */
private JEditorPane serverStatus;
private JEditorPane hostName;
private JEditorPane administrativeUsers;
private JEditorPane installPath;
private JEditorPane instancePath;
private JEditorPane opendsVersion;
private SelectableLabelWithHelpIcon javaVersion;
private JEditorPane adminConnector;
private JEditorPane dbTableEmpty;
private JEditorPane connectionHandlerTableEmpty;
private JLabel lInstancePath;
private JButton stopButton;
private JButton startButton;
private JButton restartButton;
private JTable noReplicatedBaseDNsTable;
private JTable replicationBaseDNsTable;
private JTable connectionHandlersTable;
/**
* Default constructor.
*
*/
public StatusPanel()
{
super();
inScrollPanel.setOpaque(false);
// To compensate titled border.
}
/** {@inheritDoc} */
public Component getPreferredFocusComponent()
{
if (startButton.isVisible())
{
return startButton;
}
else
{
return stopButton;
}
}
/** {@inheritDoc} */
public boolean requiresBorder()
{
return false;
}
private void recalculateSizes()
{
}
/** {@inheritDoc} */
public LocalizableMessage getTitle()
{
return INFO_CTRL_PANEL_STATUS_PANEL_TITLE.get();
}
/** {@inheritDoc} */
{
{
}
else
{
{
/** {@inheritDoc} */
public void run()
{
}
});
}
}
/** {@inheritDoc} */
public void okClicked()
{
}
/**
* Updates the contents of the panel with the provided ServerDescriptor.
* @param desc the ServerDescriptor.
*/
{
{
}
else
{
}
if (exceptions.isEmpty())
{
boolean errorPaneVisible = false;
{
if (!desc.isAuthenticated())
{
errorPaneVisible = true;
get());
}
}
{
errorPaneVisible = true;
desc.getHostname()));
}
{
}
}
else
{
{
}
{
{
}
}
{
if (!desc.isAuthenticated())
{
}
}
{
}
{
errorPane.setVisible(true);
}
}
if (!isRunning)
{
if (isLocal)
{
}
else
{
}
}
else if (!isAuthenticated)
{
}
else
{
if (nConnections >= 0)
{
}
else
{
}
}
{
try
{
}
catch (Throwable t)
{
throw new RuntimeException("Unexpected error: "+t, t);
}
}
{
}
else
{
}
if (!isRunning)
{
if (isLocal)
{
}
else
{
}
}
else if (!isAuthenticated)
{
}
else
{
{
}
else
{
}
}
{
if (!backend.isConfigBackend())
{
}
}
oneReplicated && hasBaseDNs);
!oneReplicated && hasBaseDNs);
desc.isAuthenticated());
desc.isAuthenticated());
}
{
{
{
return true;
}
}
return false;
}
{
{
}
else
{
}
}
{
}
/**
* Creates the server status subsection panel.
* @return the server status subsection panel.
*/
private JPanel createServerStatusPanel()
{
p.setOpaque(false);
statusPanel.setOpaque(false);
//l.setFocusable(true);
stopButton.setOpaque(false);
{
/** {@inheritDoc} */
{
stopServer();
}
});
startButton.setOpaque(false);
{
/** {@inheritDoc} */
{
startServer();
}
});
restartButton.setOpaque(false);
{
/** {@inheritDoc} */
{
}
});
int maxButtonHeight = 0;
l.setFocusable(true);
restartButton.setVisible(false);
stopButton.setVisible(false);
return p;
}
/**
* Creates the server details subsection panel.
* @return the server details subsection panel.
*/
private JPanel createServerDetailsPanel()
{
p.setOpaque(false);
JLabel[] leftLabels =
{
};
{
};
{
if (i != 0)
{
}
}
return p;
}
/**
* Creates the server listeners subsection panel.
* @return the server listeners subsection panel.
*/
private JPanel createListenersPanel()
{
p.setOpaque(false);
new CustomCellRenderer());
return p;
}
/**
* Creates the server backends subsection panel.
* @return the server backends subsection panel.
*/
private JPanel createBackendsPanel()
{
p.setOpaque(false);
dbTableModelWithReplication = new BaseDNTableModel(true);
dbTableModelWithoutReplication = new BaseDNTableModel(false);
renderer);
noReplicatedBaseDNsTable.setVisible(false);
renderer);
l.getText());
l.getText());
dbTableEmpty.setVisible(false);
return p;
}
/**
* Returns an string representation of the administration connector.
* @param adminConnector the administration connector.
* @return an string representation of the administration connector.
*/
private static String getAdminConnectorStringValue(
{
if (adminConnector != null)
{
}
else
{
}
}
{
{
case STARTED:
break;
case STOPPED:
break;
case STARTING:
break;
case STOPPING:
break;
case NOT_CONNECTED_TO_REMOTE:
break;
case UNKNOWN:
break;
default:
}
}
{
}
}