summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-03-01 19:58:34 -0600
committerEndi Sukma Dewata <edewata@redhat.com>2012-03-30 16:54:32 -0500
commit0b39b68e4e72cbcf0f4d28488d54ce06117efa9c (patch)
tree1a2cfc235f1f6a062e7c88c554a9f9bf82822f72 /base/common/src/com/netscape/certsrv
parent70fdf22f76494a84b6cbef10598ed897a48f0798 (diff)
downloadpki-0b39b68e4e72cbcf0f4d28488d54ce06117efa9c.tar.gz
pki-0b39b68e4e72cbcf0f4d28488d54ce06117efa9c.tar.xz
pki-0b39b68e4e72cbcf0f4d28488d54ce06117efa9c.zip
Added CMSException.
The CMSException was added to simplify error handling in REST services. The exception may include an error message and some other attributes. When the server throws a CMSException (or its subclass), the exception will be marshalled into XML and unmarshalled by the client, then thrown again as a new exception which can be caught by the application. Ticket #100
Diffstat (limited to 'base/common/src/com/netscape/certsrv')
-rw-r--r--base/common/src/com/netscape/certsrv/dbs/keydb/KeyId.java11
-rw-r--r--base/common/src/com/netscape/certsrv/request/RequestId.java11
2 files changed, 22 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/dbs/keydb/KeyId.java b/base/common/src/com/netscape/certsrv/dbs/keydb/KeyId.java
index f998bf97a..b8bb1870b 100644
--- a/base/common/src/com/netscape/certsrv/dbs/keydb/KeyId.java
+++ b/base/common/src/com/netscape/certsrv/dbs/keydb/KeyId.java
@@ -95,6 +95,17 @@ public class KeyId {
return value.toString();
}
+ /**
+ * Converts the KeyId into its hex string representation. The string
+ * form can be stored in a database (such as the LDAP directory)
+ *
+ * @return
+ * a string containing the hex (hex 16) value for the identifier.
+ */
+ public String toHexString() {
+ return "0x"+value.toString(16);
+ }
+
@Override
public int hashCode() {
final int prime = 31;
diff --git a/base/common/src/com/netscape/certsrv/request/RequestId.java b/base/common/src/com/netscape/certsrv/request/RequestId.java
index da61f2bc0..b643fa30d 100644
--- a/base/common/src/com/netscape/certsrv/request/RequestId.java
+++ b/base/common/src/com/netscape/certsrv/request/RequestId.java
@@ -94,6 +94,17 @@ public class RequestId {
return value.toString();
}
+ /**
+ * Converts the RequestId into its hex string representation. The string
+ * form can be stored in a database (such as the LDAP directory)
+ *
+ * @return
+ * a string containing the hex (base 16) value for the identifier.
+ */
+ public String toHexString() {
+ return "0x"+value.toString(16);
+ }
+
@Override
public int hashCode() {
final int prime = 31;