diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java b/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java index 97847ee1e..d547a4459 100644 --- a/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java +++ b/pki/base/common/src/com/netscape/cmscore/dbs/DateMapper.java @@ -17,6 +17,7 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cmscore.dbs; + import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; @@ -30,10 +31,12 @@ import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.IDBAttrMapper; import com.netscape.certsrv.dbs.IDBObj; + /** - * A class represents ann attribute mapper that maps a Java Date object into - * LDAP attribute, and vice versa. - * + * A class represents ann attribute mapper that maps + * a Java Date object into LDAP attribute, + * and vice versa. + * * @author thomask * @version $Revision$, $Date$ */ @@ -41,8 +44,8 @@ public class DateMapper implements IDBAttrMapper { private String mLdapName = null; private Vector v = new Vector(); - private static SimpleDateFormat formatter = new SimpleDateFormat( - "yyyyMMddHHmmss'Z'"); + private static SimpleDateFormat formatter = new + SimpleDateFormat("yyyyMMddHHmmss'Z'"); /** * Constructs date mapper. @@ -62,29 +65,32 @@ public class DateMapper implements IDBAttrMapper { /** * Maps object to ldap attribute set. */ - public void mapObjectToLDAPAttributeSet(IDBObj parent, String name, - Object obj, LDAPAttributeSet attrs) throws EBaseException { - attrs.add(new LDAPAttribute(mLdapName, dateToDB((Date) obj))); + public void mapObjectToLDAPAttributeSet(IDBObj parent, + String name, Object obj, LDAPAttributeSet attrs) + throws EBaseException { + attrs.add(new LDAPAttribute(mLdapName, + dateToDB((Date) obj))); } /** - * Maps LDAP attributes into object, and put the object into 'parent'. + * Maps LDAP attributes into object, and put the object + * into 'parent'. */ public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, - String name, IDBObj parent) throws EBaseException { + String name, IDBObj parent) throws EBaseException { LDAPAttribute attr = attrs.getAttribute(mLdapName); if (attr == null) return; - parent.set(name, dateFromDB((String) attr.getStringValues() - .nextElement())); + parent.set(name, dateFromDB((String) + attr.getStringValues().nextElement())); } /** * Maps search filters into LDAP search filter. */ - public String mapSearchFilter(String name, String op, String value) - throws EBaseException { + public String mapSearchFilter(String name, String op, + String value) throws EBaseException { String val = null; try { |