ConnectionHandlerTableModel.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 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2015 ForgeRock AS
*/
/**
* The table model used by the table that displays the connection handlers.
*
*/
public class ConnectionHandlerTableModel extends SortableTableModel
implements Comparator<ConnectionHandlerDescriptor>
{
private static final long serialVersionUID = -1121308303480078376L;
new HashSet<ConnectionHandlerDescriptor>();
private String[] COLUMN_NAMES;
private int sortColumn;
private boolean sortAscending = true;
/**
* Constructor for this table model.
*/
public ConnectionHandlerTableModel()
{
this(true);
}
/**
* Constructor for this table model.
* @param wrapHeader whether to wrap the headers or not.
* monitoring information or not.
*/
public ConnectionHandlerTableModel(boolean wrapHeader)
{
if (wrapHeader)
{
COLUMN_NAMES = new String[] {
};
}
else
{
COLUMN_NAMES = new String[] {
};
}
}
/**
* Sets the data for this table model.
* @param newData the data for this table model.
*/
{
{
}
}
/**
* Updates the table model contents and sorts its contents depending on the
* sort options set by the user.
*/
public void forceResort()
{
}
/**
* Comparable implementation.
* @param desc1 the first listener descriptor to compare.
* @param desc2 the second listener descriptor to compare.
* @return 1 if according to the sorting options set by the user the first
* listener descriptor must be put before the second descriptor, 0 if they
* are equivalent in terms of sorting and -1 if the second descriptor must
* be put before the first descriptor.
*/
{
int result = 0;
if (sortColumn == 0)
{
{
}
else
{
}
if (result == 0)
{
}
if (result == 0)
{
}
}
else if (sortColumn == 1)
{
if (result == 0)
{
}
if (result == 0)
{
}
}
else
{
if (result == 0)
{
}
if (result == 0)
{
}
}
if (!sortAscending)
{
}
return result;
}
/**
* {@inheritDoc}
*/
public int getColumnCount()
{
return 3;
}
/**
* {@inheritDoc}
*/
public int getRowCount()
{
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
return COLUMN_NAMES[col];
}
/**
* Returns whether the sort is ascending or descending.
* @return <CODE>true</CODE> if the sort is ascending and <CODE>false</CODE>
* otherwise.
*/
public boolean isSortAscending()
{
return sortAscending;
}
/**
* Sets whether to sort ascending of descending.
* @param sortAscending whether to sort ascending or descending.
*/
public void setSortAscending(boolean sortAscending)
{
this.sortAscending = sortAscending;
}
/**
* Returns the column index used to sort.
* @return the column index used to sort.
*/
public int getSortColumn()
{
return sortColumn;
}
/**
* Sets the column index used to sort.
* @param sortColumn column index used to sort..
*/
public void setSortColumn(int sortColumn)
{
this.sortColumn = sortColumn;
}
{
{
{
}
else
{
}
}
else
{
boolean added = false;
{
if (added)
{
}
added = true;
{
}
}
}
return returnValue;
}
{
switch (desc.getProtocol())
{
case OTHER:
break;
default:
break;
}
return returnValue;
}
private void updateDataArray()
{
new TreeSet<ConnectionHandlerDescriptor>(this);
{
{
case ENABLED:
break;
case DISABLED:
break;
case UNKNOWN:
break;
default:
}
}
}
}