Search in sources :

Example 1 with SimpleTimeCounter

use of com.emc.storageos.vasa.util.internal.SimpleTimeCounter in project coprhd-controller by CoprHD.

the class ContextManagerImpl method unregisterVASACertificate.

/**
 * vasaService interface
 */
@Override
public void unregisterVASACertificate(String existingCertificate) throws InvalidCertificate, InvalidSession, StorageFault {
    final String methodName = "unregisterVASACertificate(): ";
    log.debug(methodName + "Entry with input existingCertificate[" + (existingCertificate != null ? "***" : null) + "]");
    try {
        /*
             * Need to have a valid SSL session, but VASA session not required
             */
        _sslUtil.checkHttpRequest(true, true);
        X509Certificate x509Cert = (X509Certificate) _sslUtil.buildCertificate(existingCertificate);
        SimpleTimeCounter counter = new SimpleTimeCounter("unregisterVASACertificate");
        unregisterCertificate(x509Cert);
        counter.stop();
    } catch (InvalidSession is) {
        // thrown by unregisterCertificate()
        log.error(methodName + "invalid session", is);
        throw is;
    } catch (InvalidCertificate ic) {
        // thrown by sslUtil.buildCertificate()
        // thrown by unregisterCertificate()
        log.error(methodName + "invalid certificate", ic);
        throw ic;
    } catch (StorageFault sf) {
        log.error(methodName + "storage fault occured ", sf);
        throw sf;
    } catch (Exception e) {
        log.error(methodName + "unknown exception", e);
        throw FaultUtil.StorageFault("runtime ", e);
    }
    log.debug(methodName + "Exit");
}
Also used : SimpleTimeCounter(com.emc.storageos.vasa.util.internal.SimpleTimeCounter) InvalidCertificate(com.vmware.vim.vasa._1_0.InvalidCertificate) StorageFault(com.vmware.vim.vasa._1_0.StorageFault) X509Certificate(java.security.cert.X509Certificate) InvalidSession(com.vmware.vim.vasa._1_0.InvalidSession) CertificateNotYetValidException(java.security.cert.CertificateNotYetValidException) CertificateExpiredException(java.security.cert.CertificateExpiredException)

Aggregations

SimpleTimeCounter (com.emc.storageos.vasa.util.internal.SimpleTimeCounter)1 InvalidCertificate (com.vmware.vim.vasa._1_0.InvalidCertificate)1 InvalidSession (com.vmware.vim.vasa._1_0.InvalidSession)1 StorageFault (com.vmware.vim.vasa._1_0.StorageFault)1 CertificateExpiredException (java.security.cert.CertificateExpiredException)1 CertificateNotYetValidException (java.security.cert.CertificateNotYetValidException)1 X509Certificate (java.security.cert.X509Certificate)1