From a25705a6fff3525b26a855d03f0c117bfadc1979 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 23 May 2012 14:14:38 -0500 Subject: Added cert revocation REST service. The cert revocation REST service is based on DoRevoke and DoUnrevoke servlets. It provides an interface to manage certificate revocation. Ticket #161 --- base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java | 7 ++++--- base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'base/common/src/com/netscape/certsrv/dbs') diff --git a/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java b/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java index cfafff064..f6e46cad5 100644 --- a/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java +++ b/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java @@ -19,19 +19,20 @@ package com.netscape.certsrv.dbs.certdb; import javax.xml.bind.annotation.adapters.XmlAdapter; +import org.apache.commons.lang.StringUtils; + /** * The CertIdAdapter class provides custom marshaling for CertId. * * @author Endi S. Dewata - * @version $Revision$ $Date$ */ public class CertIdAdapter extends XmlAdapter { public CertId unmarshal(String value) throws Exception { - return new CertId(value); + return StringUtils.isEmpty(value) ? null : new CertId(value); } public String marshal(CertId value) throws Exception { - return value.toString(); + return value == null ? null : value.toHexString(); } } diff --git a/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java b/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java index 3232999fd..0f0c43c82 100644 --- a/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java +++ b/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java @@ -19,19 +19,20 @@ package com.netscape.certsrv.dbs.keydb; import javax.xml.bind.annotation.adapters.XmlAdapter; +import org.apache.commons.lang.StringUtils; + /** * The KeyIdAdapter class provides custom marshaling for KeyId. * * @author Endi S. Dewata - * @version $Revision$ $Date$ */ public class KeyIdAdapter extends XmlAdapter { public KeyId unmarshal(String value) throws Exception { - return new KeyId(value); + return StringUtils.isEmpty(value) ? null : new KeyId(value); } public String marshal(KeyId value) throws Exception { - return value.toString(); + return value == null ? null : value.toString(); } } -- cgit