/**
* {@inheritDoc}
*/
public void configurationChanged(ConfigurationChangeEvent ev)
{
final ServerDescriptor server = ev.getNewDescriptor();
LinkedHashSet<Object> newElements = new LinkedHashSet<Object>();
newElements.add(new CategorizedComboBoxElement(ALL_CONNECTION_HANDLERS,
CategorizedComboBoxElement.Type.REGULAR));
Set<ConnectionHandlerDescriptor> chs = server.getConnectionHandlers();
SortedSet<ConnectionHandlerDescriptor> sortedChs =
new TreeSet<ConnectionHandlerDescriptor>(
new Comparator<ConnectionHandlerDescriptor>()
{
public int compare(ConnectionHandlerDescriptor desc1,
ConnectionHandlerDescriptor desc2)
{
int compare = 0;
if (desc1.getAddresses().equals(desc2.getAddresses()))
{
Integer port1 = new Integer(desc1.getPort());
Integer port2 = new Integer(desc2.getPort());
compare = port1.compareTo(port2);
}
else
{
compare = getConnectionHandlerLabel(desc1).compareTo(
getConnectionHandlerLabel(desc2));
}
return compare;
}
});
for (ConnectionHandlerDescriptor ch : chs)
{
if (protocolHasMonitoring(ch))
{
sortedChs.add(ch);
}
}
// Add the administration connector
sortedChs.add(server.getAdminConnector());
newElements.add(COMBO_SEPARATOR);
for (ConnectionHandlerDescriptor ch : sortedChs)
{
String connectionHandlerLabel = getConnectionHandlerLabel(ch);
newElements.add(new CategorizedComboBoxElement(
connectionHandlerLabel, CategorizedComboBoxElement.Type.REGULAR));
}
updateComboBoxModel(newElements,
(DefaultComboBoxModel)connectionHandlers.getModel());
boolean displayErrorPane = false;
Message errorTitle = Message.EMPTY;
Message errorDetails = Message.EMPTY;
ServerDescriptor.ServerStatus status = server.getStatus();
if (status == ServerDescriptor.ServerStatus.STARTED)
{
if (!server.isAuthenticated())
{
MessageBuilder mb = new MessageBuilder();
mb.append(
INFO_CTRL_PANEL_AUTH_REQUIRED_TO_SEE_TRAFFIC_MONITORING_SUMMARY.
get());
mb.append("<br><br>"+getAuthenticateHTML());
errorDetails = mb.toMessage();
errorTitle = INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_SUMMARY.get();
displayErrorPane = true;
}
}
else if (status == ServerDescriptor.ServerStatus.NOT_CONNECTED_TO_REMOTE)
{
MessageBuilder mb = new MessageBuilder();
mb.append(INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(
server.getHostname()));
mb.append("<br><br>"+getAuthenticateHTML());
errorDetails = mb.toMessage();
errorTitle = INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_SUMMARY.get();
displayErrorPane = true;
}