summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java43
1 files changed, 20 insertions, 23 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
index c0949f66..d7198f6a 100644
--- a/pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
+++ b/pki/base/common/src/com/netscape/cmscore/dbs/RevocationInfoMapper.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.dbs;
-
import java.util.Date;
import java.util.Enumeration;
import java.util.Vector;
@@ -37,13 +36,12 @@ import com.netscape.certsrv.dbs.IDBAttrMapper;
import com.netscape.certsrv.dbs.IDBObj;
import com.netscape.cmscore.util.Debug;
-
/**
- * A class represents a mapper to serialize
- * revocation information into database.
+ * A class represents a mapper to serialize revocation information into
+ * database.
* <P>
- *
- * @author thomask
+ *
+ * @author thomask
* @version $Revision$, $Date$
*/
public class RevocationInfoMapper implements IDBAttrMapper {
@@ -63,9 +61,9 @@ public class RevocationInfoMapper implements IDBAttrMapper {
return mNames.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 {
// in format of <date>;<extensions>
String value = "";
@@ -82,22 +80,22 @@ public class RevocationInfoMapper implements IDBAttrMapper {
Extension ext = e.nextElement();
if (ext instanceof CRLReasonExtension) {
- RevocationReason reason =
- ((CRLReasonExtension) ext).getReason();
+ RevocationReason reason =
+ ((CRLReasonExtension) ext).getReason();
- value = value + ";CRLReasonExtension=" +
+ value = value + ";CRLReasonExtension=" +
Integer.toString(reason.toInt());
} else if (ext instanceof InvalidityDateExtension) {
- Date invalidityDate =
- ((InvalidityDateExtension) ext).getInvalidityDate();
+ Date invalidityDate =
+ ((InvalidityDateExtension) ext).getInvalidityDate();
- value = value + ";InvalidityDateExtension=" +
+ value = value + ";InvalidityDateExtension=" +
DateMapper.dateToDB(invalidityDate);
} else {
Debug.trace("XXX skipped extension");
}
}
- attrs.add(new LDAPAttribute(CertDBSchema.LDAP_ATTR_REVO_INFO,
+ attrs.add(new LDAPAttribute(CertDBSchema.LDAP_ATTR_REVO_INFO,
value));
} catch (Exception e) {
Debug.trace(e.toString());
@@ -106,8 +104,8 @@ public class RevocationInfoMapper implements IDBAttrMapper {
}
}
- public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs,
- String name, IDBObj parent) throws EBaseException {
+ public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs,
+ String name, IDBObj parent) throws EBaseException {
try {
LDAPAttribute attr = attrs.getAttribute(
CertDBSchema.LDAP_ATTR_REVO_INFO);
@@ -148,15 +146,14 @@ public class RevocationInfoMapper implements IDBAttrMapper {
String invalidityDateStr = str.substring(24);
Date invalidityDate = DateMapper.dateFromDB(invalidityDateStr);
InvalidityDateExtension ext =
- new InvalidityDateExtension(invalidityDate);
+ new InvalidityDateExtension(invalidityDate);
exts.set(InvalidityDateExtension.class.getSimpleName(), ext);
} else {
Debug.trace("XXX skipped extension");
}
- }
- while (i != -1);
- }
+ } while (i != -1);
+ }
RevocationInfo info = new RevocationInfo(d, exts);
parent.set(name, info);
@@ -168,7 +165,7 @@ public class RevocationInfoMapper implements IDBAttrMapper {
}
public String mapSearchFilter(String name, String op, String value)
- throws EBaseException {
+ throws EBaseException {
return CertDBSchema.LDAP_ATTR_REVO_INFO + op + value;
}
}