diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java index 7eda230d5..510da3c54 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/CertRecordMapper.java @@ -17,6 +17,7 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cmscore.dbs; + import java.math.BigInteger; import java.util.Enumeration; import java.util.Vector; @@ -33,11 +34,13 @@ import com.netscape.certsrv.dbs.certdb.ICertRecord; import com.netscape.certsrv.dbs.certdb.ICertificateRepository; import com.netscape.cmscore.util.Debug; + /** - * A class represents a mapper to serialize certificate record into database. + * A class represents a mapper to serialize + * certificate record into database. * <P> - * - * @author thomask + * + * @author thomask * @version $Revision$, $Date$ */ public class CertRecordMapper implements IDBAttrMapper { @@ -55,42 +58,44 @@ public class CertRecordMapper implements IDBAttrMapper { return v.elements(); } - public void mapObjectToLDAPAttributeSet(IDBObj parent, String name, - Object obj, LDAPAttributeSet attrs) throws EBaseException { + public void mapObjectToLDAPAttributeSet(IDBObj parent, String name, + Object obj, LDAPAttributeSet attrs) + throws EBaseException { try { CertRecord rec = (CertRecord) obj; - attrs.add(new LDAPAttribute(CertDBSchema.LDAP_ATTR_CERT_RECORD_ID, + attrs.add(new LDAPAttribute( + CertDBSchema.LDAP_ATTR_CERT_RECORD_ID, rec.getSerialNumber().toString())); } catch (Exception e) { Debug.trace(e.toString()); - throw new EDBException(CMS.getUserMessage( - "CMS_DBS_SERIALIZE_FAILED", name)); + throw new EDBException( + CMS.getUserMessage("CMS_DBS_SERIALIZE_FAILED", name)); } } - public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, - String name, IDBObj parent) throws EBaseException { - try { - LDAPAttribute attr = attrs - .getAttribute(CertDBSchema.LDAP_ATTR_CERT_RECORD_ID); + public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, + String name, IDBObj parent) throws EBaseException { + try { + LDAPAttribute attr = attrs.getAttribute( + CertDBSchema.LDAP_ATTR_CERT_RECORD_ID); if (attr == null) return; String serialno = (String) attr.getStringValues().nextElement(); - ICertRecord rec = mDB - .readCertificateRecord(new BigInteger(serialno)); + ICertRecord rec = mDB.readCertificateRecord( + new BigInteger(serialno)); parent.set(name, rec); } catch (Exception e) { Debug.trace(e.toString()); - throw new EDBException(CMS.getUserMessage( - "CMS_DBS_DESERIALIZE_FAILED", name)); + throw new EDBException( + CMS.getUserMessage("CMS_DBS_DESERIALIZE_FAILED", name)); } } public String mapSearchFilter(String name, String op, String value) - throws EBaseException { + throws EBaseException { return name + op + value; } } |