use of org.jivesoftware.sparkimpl.certificates.CertificateController in project Spark by igniterealtime.
the class CertificateDialog method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == okButton) {
// controller should be passed to this class only if there is need to modification content of Keystore.
if (certControll != null) {
addCert = true;
if (certControll instanceof CertificateController && !certControll.isOnExceptionList(certModel) && exceptionBox.isSelected()) {
CertificateController crtCtrl = (CertificateController) certControll;
try {
crtCtrl.addCertificateAsExempted(certModel);
} catch (HeadlessException | InvalidNameException | KeyStoreException e1) {
Log.error(e1);
}
}
}
this.dispose();
} else if (e.getSource() == cancelButton) {
if (certControll != null) {
certControll.setAddToKeystore(false);
}
this.dispose();
} else if (e.getSource() == deleteButton) {
try {
certControll.deleteEntry(certModel.getAlias());
this.dispose();
} catch (KeyStoreException ex) {
Log.error("Couldn't delete the certificate", ex);
}
} else if (e.getSource() == exceptionBox) {
certControll.addOrRemoveFromExceptionList(exceptionBox.isSelected());
} else if (e.getSource() == checkValidity) {
checkValidity();
}
}
Aggregations