Search in sources :

Example 1 with CertificateAuditInfo

use of org.apache.airavata.credential.store.credential.impl.certificate.CertificateAuditInfo in project airavata by apache.

the class CredentialReaderImpl method getAuditInfo.

public CertificateAuditInfo getAuditInfo(String gatewayName, String tokenId) throws CredentialStoreException {
    Connection connection = getConnection();
    CertificateAuditInfo certificateAuditInfo;
    try {
        CertificateCredential certificateCredential = (CertificateCredential) this.credentialsDAO.getCredential(gatewayName, tokenId, connection);
        certificateAuditInfo = new CertificateAuditInfo();
        CommunityUser retrievedUser = certificateCredential.getCommunityUser();
        certificateAuditInfo.setCommunityUserName(retrievedUser.getUserName());
        certificateAuditInfo.setCredentialLifeTime(certificateCredential.getLifeTime());
        certificateAuditInfo.setCredentialsRequestedTime(certificateCredential.getCertificateRequestedTime());
        certificateAuditInfo.setGatewayName(gatewayName);
        certificateAuditInfo.setNotAfter(certificateCredential.getNotAfter());
        certificateAuditInfo.setNotBefore(certificateCredential.getNotBefore());
        certificateAuditInfo.setPortalUserName(certificateCredential.getPortalUserName());
    } finally {
        DBUtil.cleanup(connection);
    }
    return certificateAuditInfo;
}
Also used : CertificateCredential(org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential) CommunityUser(org.apache.airavata.credential.store.credential.CommunityUser) Connection(java.sql.Connection) CertificateAuditInfo(org.apache.airavata.credential.store.credential.impl.certificate.CertificateAuditInfo)

Aggregations

Connection (java.sql.Connection)1 CommunityUser (org.apache.airavata.credential.store.credential.CommunityUser)1 CertificateAuditInfo (org.apache.airavata.credential.store.credential.impl.certificate.CertificateAuditInfo)1 CertificateCredential (org.apache.airavata.credential.store.credential.impl.certificate.CertificateCredential)1