diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-10-25 11:52:15 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-10-29 10:38:38 -0500 |
commit | c1aa8b2d05cb1873990d1a3e9cf007cca240f135 (patch) | |
tree | f12c76eaa1c385a79e40e7b38123360279c05fc0 /base/common/src/com/netscape/certsrv/request | |
parent | 748605a324266bb515a3d1124bc55deb3be4df71 (diff) | |
download | pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.tar.gz pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.tar.xz pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.zip |
Enabled authentication for key services.
The web.xml in KRA has been modified to enable the authentication
for key and key request services. Some tools have been added to
access the services via command-line.
Ticket #376
Diffstat (limited to 'base/common/src/com/netscape/certsrv/request')
-rw-r--r-- | base/common/src/com/netscape/certsrv/request/CMSRequestInfo.java | 36 | ||||
-rw-r--r-- | base/common/src/com/netscape/certsrv/request/CMSRequestInfos.java | 26 |
2 files changed, 58 insertions, 4 deletions
diff --git a/base/common/src/com/netscape/certsrv/request/CMSRequestInfo.java b/base/common/src/com/netscape/certsrv/request/CMSRequestInfo.java index 0be24fbb4..f7b34f0a2 100644 --- a/base/common/src/com/netscape/certsrv/request/CMSRequestInfo.java +++ b/base/common/src/com/netscape/certsrv/request/CMSRequestInfo.java @@ -85,4 +85,40 @@ public class CMSRequestInfo { this.requestURL = requestURL; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((requestStatus == null) ? 0 : requestStatus.hashCode()); + result = prime * result + ((requestType == null) ? 0 : requestType.hashCode()); + result = prime * result + ((requestURL == null) ? 0 : requestURL.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CMSRequestInfo other = (CMSRequestInfo) obj; + if (requestStatus == null) { + if (other.requestStatus != null) + return false; + } else if (!requestStatus.equals(other.requestStatus)) + return false; + if (requestType == null) { + if (other.requestType != null) + return false; + } else if (!requestType.equals(other.requestType)) + return false; + if (requestURL == null) { + if (other.requestURL != null) + return false; + } else if (!requestURL.equals(other.requestURL)) + return false; + return true; + } } diff --git a/base/common/src/com/netscape/certsrv/request/CMSRequestInfos.java b/base/common/src/com/netscape/certsrv/request/CMSRequestInfos.java index cb07caf71..7e9445dbc 100644 --- a/base/common/src/com/netscape/certsrv/request/CMSRequestInfos.java +++ b/base/common/src/com/netscape/certsrv/request/CMSRequestInfos.java @@ -17,6 +17,7 @@ //--- END COPYRIGHT BLOCK --- package com.netscape.certsrv.request; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -25,8 +26,8 @@ import com.netscape.certsrv.base.Link; //Convenience class to simply hold a Collection of CMSRequests and a List of Links. public class CMSRequestInfos { - protected Collection<CMSRequestInfo> requests; - protected List<Link> links; + protected Collection<CMSRequestInfo> requests = new ArrayList<CMSRequestInfo>(); + protected List<Link> links = new ArrayList<Link>(); /** * @return the requests @@ -39,7 +40,16 @@ public class CMSRequestInfos { * @param requests the requests to set */ public void setRequests(Collection<CMSRequestInfo> requests) { - this.requests = requests; + this.requests.clear(); + if (requests == null) return; + this.requests.addAll(requests); + } + + /** + * @param requests the requests to add + */ + public void addRequest(CMSRequestInfo request) { + requests.add(request); } /** @@ -53,7 +63,15 @@ public class CMSRequestInfos { * @param links the links to set */ public void setLinks(List<Link> links) { - this.links = links; + this.links.clear(); + if (links == null) return; + this.links.addAll(links); } + /** + * @param links the link to add + */ + public void addLink(Link link) { + links.add(link); + } } |