diff options
author | Endi S. Dewata <edewata@redhat.com> | 2014-03-17 11:40:42 -0400 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-03-19 16:19:04 -0400 |
commit | fbd1b96a35946b7ebf36afea3f3a2a50dcbf193f (patch) | |
tree | a8de6caa0be49b39321c546e02b35b6710299f1f /base/common/src/com/netscape/certsrv/base | |
parent | 4c02156a7cc336afcb2cb46f77d98097eb83cda1 (diff) | |
download | pki-fbd1b96a35946b7ebf36afea3f3a2a50dcbf193f.tar.gz pki-fbd1b96a35946b7ebf36afea3f3a2a50dcbf193f.tar.xz pki-fbd1b96a35946b7ebf36afea3f3a2a50dcbf193f.zip |
Added search filter for TPS resources.
The TPS resources have been modified to accept a basic search filter
for find operation. For resources based on LDAP database, the filtering
is done using LDAP filter. For other resources, the filtering is done
using string comparison. For now the filter is will only be matched
against entry IDs. In the future the filter may be expanded to support
other entry attributes. The CLI has been updated accordingly.
The total attribute in DataCollection was changed from Integer into int
because the total size of the collection cannot be null.
The PKIException constructors have been consolidated into a single
actual constructor. The other constructors have been modified to
call the actual constructor with some default values.
Ticket #847
Diffstat (limited to 'base/common/src/com/netscape/certsrv/base')
-rw-r--r-- | base/common/src/com/netscape/certsrv/base/DataCollection.java | 6 | ||||
-rw-r--r-- | base/common/src/com/netscape/certsrv/base/PKIException.java | 33 |
2 files changed, 18 insertions, 21 deletions
diff --git a/base/common/src/com/netscape/certsrv/base/DataCollection.java b/base/common/src/com/netscape/certsrv/base/DataCollection.java index f5f46bcb8..ecbef0a6b 100644 --- a/base/common/src/com/netscape/certsrv/base/DataCollection.java +++ b/base/common/src/com/netscape/certsrv/base/DataCollection.java @@ -30,15 +30,15 @@ import org.jboss.resteasy.plugins.providers.atom.Link; */ public class DataCollection<E> { - Integer total; + int total; Collection<E> entries = new ArrayList<E>(); Collection<Link> links = new ArrayList<Link>(); - public Integer getTotal() { + public int getTotal() { return total; } - public void setTotal(Integer total) { + public void setTotal(int total) { this.total = total; } diff --git a/base/common/src/com/netscape/certsrv/base/PKIException.java b/base/common/src/com/netscape/certsrv/base/PKIException.java index f89c1b18c..ae557d465 100644 --- a/base/common/src/com/netscape/certsrv/base/PKIException.java +++ b/base/common/src/com/netscape/certsrv/base/PKIException.java @@ -31,44 +31,41 @@ public class PKIException extends RuntimeException { public int code; + public PKIException(int code, String message, Throwable cause) { + super(message, cause); + this.code = code; + } + public PKIException(Response.Status status) { - super(status.getReasonPhrase()); - code = status.getStatusCode(); + this(status, status.getReasonPhrase(), null); } public PKIException(String message) { - super(message); - code = Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(); + this(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), message, null); } public PKIException(int code, String message) { - super(message); - this.code = code; + this(code, message, null); } public PKIException(Response.Status status, String message) { - super(message); - code = status.getStatusCode(); + this(status.getStatusCode(), message, null); } - public PKIException(String message, Throwable cause) { - super(message, cause); - code = Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(); + public PKIException(Throwable cause) { + this(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), cause.getMessage(), cause); } - public PKIException(int code, String message, Throwable cause) { - super(message, cause); - this.code = code; + public PKIException(String message, Throwable cause) { + this(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), message, cause); } public PKIException(Response.Status status, String message, Throwable cause) { - super(message, cause); - code = status.getStatusCode(); + this(status.getStatusCode(), message, cause); } public PKIException(Data data) { - super(data.message); - code = data.code; + this(data.code, data.message, null); } public int getCode() { |