| | |
| | |
|
| | | /**
|
| | | * Table model of a list of user certificate models.
|
| | | * |
| | | *
|
| | | * @author James Moger
|
| | | * |
| | | *
|
| | | */
|
| | | public class CertificatesTableModel extends AbstractTableModel {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | UserCertificateModel ucm;
|
| | | |
| | |
|
| | | enum Columns {
|
| | | SerialNumber, Status, Reason, Issued, Expires;
|
| | |
|
| | |
| | |
|
| | | /**
|
| | | * Returns <code>Object.class</code> regardless of <code>columnIndex</code>.
|
| | | * |
| | | *
|
| | | * @param columnIndex
|
| | | * the column being queried
|
| | | * @return the Object.class
|
| | | */
|
| | | @Override
|
| | | public Class<?> getColumnClass(int columnIndex) {
|
| | | Columns col = Columns.values()[columnIndex];
|
| | | switch (col) {
|
| | |
| | | if (ucm.getStatus(cert).equals(CertificateStatus.revoked)) {
|
| | | RevocationReason r = ucm.getRevocationReason(cert.getSerialNumber());
|
| | | return Translation.get("gb." + r.name());
|
| | | } |
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | public X509Certificate get(int modelRow) {
|
| | | return ucm.certs.get(modelRow);
|
| | | }
|
| | | |
| | |
|
| | | public void setUserCertificateModel(UserCertificateModel ucm) {
|
| | | this.ucm = ucm;
|
| | | if (ucm == null) {
|