From c1aa8b2d05cb1873990d1a3e9cf007cca240f135 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Thu, 25 Oct 2012 11:52:15 -0500 Subject: 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 --- .../netscape/certsrv/request/CMSRequestInfo.java | 36 ++++++++++++++++++++++ .../netscape/certsrv/request/CMSRequestInfos.java | 26 +++++++++++++--- 2 files changed, 58 insertions(+), 4 deletions(-) (limited to 'base/common/src/com/netscape/certsrv/request') 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 requests; - protected List links; + protected Collection requests = new ArrayList(); + protected List links = new ArrayList(); /** * @return the requests @@ -39,7 +40,16 @@ public class CMSRequestInfos { * @param requests the requests to set */ public void setRequests(Collection 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 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); + } } -- cgit