summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/cms/servlet/request
diff options
context:
space:
mode:
Diffstat (limited to 'base/common/src/com/netscape/cms/servlet/request')
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/CMSRequestDAO.java6
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/CertRequestResource.java118
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/CertRequestService.java14
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/KeyRequestResource.java92
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java12
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/RequestNotFoundException.java46
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfo.java91
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfos.java59
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CertEnrollmentRequest.java321
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfo.java84
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfos.java89
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CertRetrievalRequest.java78
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/CertReviewResponse.java252
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/KeyArchivalRequest.java123
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/KeyRecoveryRequest.java155
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfo.java60
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfos.java89
-rw-r--r--base/common/src/com/netscape/cms/servlet/request/model/ProfileRetrievalRequest.java67
18 files changed, 18 insertions, 1738 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/request/CMSRequestDAO.java b/base/common/src/com/netscape/cms/servlet/request/CMSRequestDAO.java
index 5d1df774d..f7c9f7aae 100644
--- a/base/common/src/com/netscape/cms/servlet/request/CMSRequestDAO.java
+++ b/base/common/src/com/netscape/cms/servlet/request/CMSRequestDAO.java
@@ -28,14 +28,14 @@ import javax.ws.rs.core.UriInfo;
import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.authority.IAuthority;
import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.Link;
+import com.netscape.certsrv.request.CMSRequestInfo;
+import com.netscape.certsrv.request.CMSRequestInfos;
import com.netscape.certsrv.request.IRequest;
import com.netscape.certsrv.request.IRequestList;
import com.netscape.certsrv.request.IRequestQueue;
import com.netscape.certsrv.request.IRequestVirtualList;
import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.servlet.base.model.Link;
-import com.netscape.cms.servlet.request.model.CMSRequestInfo;
-import com.netscape.cms.servlet.request.model.CMSRequestInfos;
/**
* @author alee
diff --git a/base/common/src/com/netscape/cms/servlet/request/CertRequestResource.java b/base/common/src/com/netscape/cms/servlet/request/CertRequestResource.java
deleted file mode 100644
index 8a6d1b182..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/CertRequestResource.java
+++ /dev/null
@@ -1,118 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2007 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.request;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.servlet.request.model.CertReviewResponse;
-import com.netscape.cms.servlet.request.model.CertRequestInfo;
-import com.netscape.cms.servlet.request.model.CertRequestInfos;
-import com.netscape.cms.servlet.request.model.CertEnrollmentRequest;
-
-@Path("")
-public interface CertRequestResource {
-
- public static final int DEFAULT_START = 0;
- public static final int DEFAULT_PAGESIZE = 20;
- public static final int DEFAULT_MAXRESULTS = 100;
- public static final int DEFAULT_MAXTIME = 10;
-
- /**
- * Used to generate list of cert requests based on the search parameters
- */
- @GET
- @Path("agent/certrequests")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public CertRequestInfos listRequests(@QueryParam("requestState") String requestState,
- @QueryParam("requestType") String requestType,
- @DefaultValue("" + DEFAULT_START) @QueryParam("start") RequestId start,
- @DefaultValue("" + DEFAULT_PAGESIZE) @QueryParam("pageSize") int pageSize,
- @DefaultValue("" + DEFAULT_MAXRESULTS) @QueryParam("maxResults") int maxResults,
- @DefaultValue("" + DEFAULT_MAXTIME) @QueryParam("maxTime") int maxTime);
-
- /**
- * Used to retrieve cert request info for a specific request
- */
- @GET
- @Path("certrequests/{id}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public CertRequestInfo getRequestInfo(@PathParam("id") RequestId id);
-
- @GET
- @Path("agent/certrequests/{id}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public CertReviewResponse reviewRequest(@PathParam("id") RequestId id);
-
- // Enrollment - used to test integration with a browser
- @POST
- @Path("certrequests")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
- public CertRequestInfos enrollCert(MultivaluedMap<String, String> form);
-
- @POST
- @Path("certrequests")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public CertRequestInfos enrollCert(CertEnrollmentRequest data);
-
- @POST
- @Path("agent/certrequests/{id}/approve")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void approveRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-
- @POST
- @Path("agent/certrequests/{id}/reject")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void rejectRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-
- @POST
- @Path("agent/certrequests/{id}/cancel")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void cancelRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-
- @POST
- @Path("agent/certrequests/{id}/update")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void updateRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-
- @POST
- @Path("agent/certrequests/{id}/validate")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void validateRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-
- @POST
- @Path("agent/certrequests/{id}/unassign")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void unassignRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-
- @POST
- @Path("agent/certrequests/{id}/assign")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public void assignRequest(@PathParam("id") RequestId id, CertReviewResponse data);
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/CertRequestService.java b/base/common/src/com/netscape/cms/servlet/request/CertRequestService.java
index 174b6d7fb..a8099003f 100644
--- a/base/common/src/com/netscape/cms/servlet/request/CertRequestService.java
+++ b/base/common/src/com/netscape/cms/servlet/request/CertRequestService.java
@@ -26,20 +26,22 @@ import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.authentication.EAuthException;
import com.netscape.certsrv.authorization.EAuthzException;
import com.netscape.certsrv.base.BadRequestDataException;
+import com.netscape.certsrv.base.BadRequestException;
import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.PKIException;
+import com.netscape.certsrv.cert.CertEnrollmentRequest;
+import com.netscape.certsrv.cert.CertRequestInfo;
+import com.netscape.certsrv.cert.CertRequestInfos;
+import com.netscape.certsrv.cert.CertRequestResource;
+import com.netscape.certsrv.cert.CertReviewResponse;
import com.netscape.certsrv.profile.EDeferException;
import com.netscape.certsrv.profile.EProfileException;
import com.netscape.certsrv.profile.ERejectException;
import com.netscape.certsrv.property.EPropertyException;
import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.servlet.base.BadRequestException;
-import com.netscape.cms.servlet.base.PKIException;
+import com.netscape.certsrv.request.RequestNotFoundException;
import com.netscape.cms.servlet.base.PKIService;
import com.netscape.cms.servlet.cert.CertRequestDAO;
-import com.netscape.cms.servlet.request.model.CertEnrollmentRequest;
-import com.netscape.cms.servlet.request.model.CertRequestInfo;
-import com.netscape.cms.servlet.request.model.CertRequestInfos;
-import com.netscape.cms.servlet.request.model.CertReviewResponse;
import com.netscape.cmsutil.ldap.LDAPUtil;
/**
diff --git a/base/common/src/com/netscape/cms/servlet/request/KeyRequestResource.java b/base/common/src/com/netscape/cms/servlet/request/KeyRequestResource.java
deleted file mode 100644
index d583d9580..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/KeyRequestResource.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.netscape.cms.servlet.request;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.servlet.request.model.KeyArchivalRequest;
-import com.netscape.cms.servlet.request.model.KeyRequestInfo;
-import com.netscape.cms.servlet.request.model.KeyRequestInfos;
-import com.netscape.cms.servlet.request.model.KeyRecoveryRequest;
-
-@Path("agent/keyrequests")
-public interface KeyRequestResource {
-
- public final String SYMMETRIC_KEY_TYPE = "symmetricKey";
- public final String PASS_PHRASE_TYPE = "passPhrase";
- public final String ASYMMETRIC_KEY_TYPE = "asymmetricKey";
-
- public static final int DEFAULT_START = 0;
- public static final int DEFAULT_PAGESIZE = 20;
- public static final int DEFAULT_MAXRESULTS = 100;
- public static final int DEFAULT_MAXTIME = 10;
-
- /**
- * Used to generate list of key requests based on the search parameters
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public KeyRequestInfos listRequests(@QueryParam("requestState") String requestState,
- @QueryParam("requestType") String requestType,
- @QueryParam("clientID") String clientID,
- @DefaultValue(""+DEFAULT_START) @QueryParam("start") RequestId start,
- @DefaultValue(""+DEFAULT_PAGESIZE) @QueryParam("pageSize") int pageSize,
- @DefaultValue(""+DEFAULT_MAXRESULTS) @QueryParam("maxResults") int maxResults,
- @DefaultValue(""+DEFAULT_MAXTIME) @QueryParam("maxTime") int maxTime);
-
-
- /**
- * Used to retrieve key request info for a specific request
- */
- @GET
- @Path("{id}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public KeyRequestInfo getRequestInfo(@PathParam("id") RequestId id);
-
- // Archiving - used to test integration with a browser
- @POST
- @Path("archive")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_FORM_URLENCODED})
- public KeyRequestInfo archiveKey(MultivaluedMap<String, String> form);
-
- @POST
- @Path("archive")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public KeyRequestInfo archiveKey(KeyArchivalRequest data);
-
- //Recovery - used to test integration with a browser
- @POST
- @Path("recover")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_FORM_URLENCODED})
- public KeyRequestInfo recoverKey(MultivaluedMap<String, String> form);
-
- @POST
- @Path("recover")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- public KeyRequestInfo recoverKey(KeyRecoveryRequest data);
-
- @POST
- @Path("{id}/approve")
- public void approveRequest(@PathParam("id") RequestId id);
-
- @POST
- @Path("{id}/reject")
- public void rejectRequest(@PathParam("id") RequestId id);
-
- @POST
- @Path("{id}/cancel")
- public void cancelRequest(@PathParam("id") RequestId id);
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java b/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
index 188bcb23c..775c0ed28 100644
--- a/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
+++ b/base/common/src/com/netscape/cms/servlet/request/KeyRequestService.java
@@ -24,14 +24,16 @@ import javax.ws.rs.core.Response;
import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.PKIException;
+import com.netscape.certsrv.key.KeyArchivalRequest;
+import com.netscape.certsrv.key.KeyRecoveryRequest;
+import com.netscape.certsrv.key.KeyRequestInfo;
+import com.netscape.certsrv.key.KeyRequestInfos;
+import com.netscape.certsrv.key.KeyRequestResource;
import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.servlet.base.PKIException;
+import com.netscape.certsrv.request.RequestNotFoundException;
import com.netscape.cms.servlet.base.PKIService;
import com.netscape.cms.servlet.key.KeyRequestDAO;
-import com.netscape.cms.servlet.request.model.KeyArchivalRequest;
-import com.netscape.cms.servlet.request.model.KeyRequestInfo;
-import com.netscape.cms.servlet.request.model.KeyRequestInfos;
-import com.netscape.cms.servlet.request.model.KeyRecoveryRequest;
import com.netscape.cmsutil.ldap.LDAPUtil;
/**
diff --git a/base/common/src/com/netscape/cms/servlet/request/RequestNotFoundException.java b/base/common/src/com/netscape/cms/servlet/request/RequestNotFoundException.java
deleted file mode 100644
index 6bef885f9..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/RequestNotFoundException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.netscape.cms.servlet.request;
-
-import javax.ws.rs.core.Response;
-
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.servlet.base.PKIException;
-
-public class RequestNotFoundException extends PKIException {
-
- private static final long serialVersionUID = -4784839378360933483L;
-
- public RequestId requestId;
-
- public RequestNotFoundException(RequestId requestId) {
- this(requestId, "Request ID "+requestId.toHexString()+" not found");
- }
-
- public RequestNotFoundException(RequestId requestId, String message) {
- super(Response.Status.NOT_FOUND, message);
- this.requestId = requestId;
- }
-
- public RequestNotFoundException(RequestId requestId, String message, Throwable cause) {
- super(Response.Status.NOT_FOUND, message, cause);
- this.requestId = requestId;
- }
-
- public RequestNotFoundException(Data data) {
- super(data);
- requestId = new RequestId(data.getAttribute("requestId"));
- }
-
- public Data getData() {
- Data data = super.getData();
- data.setAttribute("requestId", requestId.toString());
- return data;
- }
-
- public RequestId getRequestId() {
- return requestId;
- }
-
- public void setRequestId(RequestId requestId) {
- this.requestId = requestId;
- }
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfo.java b/base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfo.java
deleted file mode 100644
index f06334f6b..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfo.java
+++ /dev/null
@@ -1,91 +0,0 @@
-//--- BEGIN COPYRIGHT BLOCK ---
-//This program is free software; you can redistribute it and/or modify
-//it under the terms of the GNU General Public License as published by
-//the Free Software Foundation; version 2 of the License.
-//
-//This program is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-//GNU General Public License for more details.
-//
-//You should have received a copy of the GNU General Public License along
-//with this program; if not, write to the Free Software Foundation, Inc.,
-//51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-//(C) 2012 Red Hat, Inc.
-//All rights reserved.
-//--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.request.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.certsrv.request.RequestStatus;
-import com.netscape.certsrv.request.RequestStatusAdapter;
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CMSRequestInfo {
-
- @XmlElement
- protected String requestType;
-
- @XmlElement
- @XmlJavaTypeAdapter(RequestStatusAdapter.class)
- protected RequestStatus requestStatus;
-
- @XmlElement
- protected String requestURL;
-
- /**
- * @return the requestType
- */
- public String getRequestType() {
- return requestType;
- }
-
- /**
- * @param requestType the requestType to set
- */
- public void setRequestType(String requestType) {
- this.requestType = requestType;
- }
-
- /**
- * @return the requestStatus
- */
- public RequestStatus getRequestStatus() {
- return requestStatus;
- }
-
- /**
- * @param requestStatus the requestStatus to set
- */
- public void setRequestStatus(RequestStatus requestStatus) {
- this.requestStatus = requestStatus;
- }
-
- /**
- * @return the requestURL
- */
- public String getRequestURL() {
- return requestURL;
- }
-
- /**
- * @return the request ID in the requestURL
- */
- public RequestId getRequestId() {
- String id = requestURL.substring(requestURL.lastIndexOf("/") + 1);
- return new RequestId(id);
- }
-
- /**
- * @param requestURL the requestURL to set
- */
- public void setRequestURL(String requestURL) {
- this.requestURL = requestURL;
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfos.java b/base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfos.java
deleted file mode 100644
index 63b2e56b1..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CMSRequestInfos.java
+++ /dev/null
@@ -1,59 +0,0 @@
-//--- BEGIN COPYRIGHT BLOCK ---
-//This program is free software; you can redistribute it and/or modify
-//it under the terms of the GNU General Public License as published by
-//the Free Software Foundation; version 2 of the License.
-//
-//This program is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-//GNU General Public License for more details.
-//
-//You should have received a copy of the GNU General Public License along
-//with this program; if not, write to the Free Software Foundation, Inc.,
-//51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-//(C) 2011 Red Hat, Inc.
-//All rights reserved.
-//--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.request.model;
-
-import java.util.Collection;
-import java.util.List;
-
-import com.netscape.cms.servlet.base.model.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;
-
- /**
- * @return the requests
- */
- public Collection<CMSRequestInfo> getRequests() {
- return requests;
- }
-
- /**
- * @param requests the requests to set
- */
- public void setRequests(Collection<CMSRequestInfo> requests) {
- this.requests = requests;
- }
-
- /**
- * @return the links
- */
- public List<Link> getLinks() {
- return links;
- }
-
- /**
- * @param links the links to set
- */
- public void setLinks(List<Link> links) {
- this.links = links;
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CertEnrollmentRequest.java b/base/common/src/com/netscape/cms/servlet/request/model/CertEnrollmentRequest.java
deleted file mode 100644
index a249d657d..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CertEnrollmentRequest.java
+++ /dev/null
@@ -1,321 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-/**
- *
- */
-package com.netscape.cms.servlet.request.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.netscape.cms.servlet.profile.model.ProfileInput;
-import com.netscape.cms.servlet.profile.model.ProfileOutput;
-
-/**
- * @author jmagne
- *
- */
-
-@XmlRootElement(name = "CertEnrollmentRequest")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CertEnrollmentRequest {
-
- private static final String PROFILE_ID = "profileId";
- private static final String RENEWAL = "renewal";
- private static final String SERIAL_NUM = "serial_num";
-
- @XmlElement
- protected String profileId;
-
- @XmlElement
- protected boolean isRenewal;
-
- @XmlElement
- protected String serialNum; // used for one type of renewal
-
- @XmlElement
- protected String remoteHost;
-
- @XmlElement
- protected String remoteAddr;
-
- @XmlElement(name = "Input")
- protected List<ProfileInput> inputs = new ArrayList<ProfileInput>();
-
- @XmlElement(name = "Output")
- protected List<ProfileOutput> outputs = new ArrayList<ProfileOutput>();
-
- public CertEnrollmentRequest() {
- // required for jaxb
- }
-
- public CertEnrollmentRequest(MultivaluedMap<String, String> form) {
- profileId = form.getFirst(PROFILE_ID);
- String renewalStr = form.getFirst(RENEWAL);
- serialNum = form.getFirst(SERIAL_NUM);
- isRenewal = new Boolean(renewalStr);
- }
-
- /**
- * @return the profileId
- */
- public String getProfileId() {
- return profileId;
- }
-
- /**
- * @param profileId the profileId to set
- */
-
- public void setProfileId(String profileId) {
- this.profileId = profileId;
- }
-
- /**
- * @return renewal
- */
-
- public boolean getIsRenewal() {
- return isRenewal;
- }
-
- public void addInput(ProfileInput input) {
- ProfileInput curInput = getInput(input.getInputId());
- if (curInput != null) {
- getInputs().remove(curInput);
- }
- getInputs().add(input);
- }
-
- public void deleteInput(ProfileInput input) {
- ProfileInput curInput = getInput(input.getInputId());
- if (curInput != null) {
- getInputs().remove(curInput);
- }
- }
-
- public ProfileInput createInput(String name) {
-
- ProfileInput oldInput = getInput(name);
-
- if (oldInput != null)
- return oldInput;
-
- ProfileInput newInput = new ProfileInput();
- newInput.setInputId(name);
-
- getInputs().add(newInput);
-
- return newInput;
- }
-
- public ProfileInput getInput(String name) {
-
- ProfileInput input = null;
-
- Iterator<ProfileInput> it = getInputs().iterator();
-
- ProfileInput curInput = null;
- while (it.hasNext()) {
- curInput = it.next();
- if (curInput != null && curInput.getInputId().equals(name))
- break;
- }
-
- return input;
- }
-
- public void addOutput(ProfileOutput output) {
- ProfileOutput curOutput = getOutput(output.getOutputId());
- if (curOutput != null) {
- getOutputs().remove(curOutput);
- }
- getOutputs().add(output);
- }
-
- public void deleteOutput(ProfileOutput output) {
- ProfileOutput curOutput = getOutput(output.getOutputId());
- if (curOutput != null) {
- getInputs().remove(curOutput);
- }
- }
-
- public ProfileOutput getOutput(String name) {
- ProfileOutput output = null;
- ProfileOutput curOutput = null;
-
- Iterator<ProfileOutput> it = getOutputs().iterator();
- while (it.hasNext()) {
- curOutput = it.next();
- if (curOutput != null && curOutput.getOutputId().equals(name))
- break;
- }
-
- return output;
- }
-
- /**
- * @param renewal the renewal to set
- */
- public void setIsRenewal(boolean isRenewal) {
- this.isRenewal = isRenewal;
- }
-
- public HashMap<String, String> toParams() {
- HashMap<String, String> ret = new HashMap<String, String>();
- ret.put("isRenewal", Boolean.valueOf(isRenewal).toString());
- if (profileId != null) ret.put(PROFILE_ID, profileId);
- if (serialNum != null) ret.put(SERIAL_NUM, serialNum);
- if (remoteHost != null) ret.put("remoteHost", remoteHost);
- if (remoteAddr != null) ret.put("remoteAddr", remoteAddr);
-
- for (ProfileInput input: inputs) {
- Map<String, String> attrs = input.getAttributes();
- for (Map.Entry<String, String> entry: attrs.entrySet()) {
- ret.put(entry.getKey(), entry.getValue());
- }
- }
-
- return ret;
- }
-
- public static void main(String args[]) throws Exception {
- CertEnrollmentRequest data = new CertEnrollmentRequest();
- data.setProfileId("caUserCert");
- data.setIsRenewal(false);
-
- //Simulate a "caUserCert" Profile enrollment
-
- ProfileInput certReq = data.createInput("KeyGenInput");
- certReq.setInputAttr("cert_request_type", "crmf");
- certReq.setInputAttr(
- "cert_request",
- "MIIBozCCAZ8wggEFAgQBMQp8MIHHgAECpQ4wDDEKMAgGA1UEAxMBeKaBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2NgaPHp0jiohcP4M+ufrJOZEqH8GV+liu5JLbT8nWpkfhC+8EUBqT6g+n3qroSxIcNVGNdcsBEqs1utvpItzyslAbpdyat3WwQep1dWMzo6RHrPDuIoxNA0Yka1n3qEX4U//08cLQtUv2bYglYgN/hOCNQemLV6vZWAv0n7zelkCAwEAAakQMA4GA1UdDwEB/wQEAwIF4DAzMBUGCSsGAQUFBwUBAQwIcmVnVG9rZW4wGgYJKwYBBQUHBQECDA1hdXRoZW50aWNhdG9yoYGTMA0GCSqGSIb3DQEBBQUAA4GBAJ1VOQcaSEhdHa94s8kifVbSZ2WZeYE5//qxL6wVlEst20vq4ybj13CetnbN3+WT49Zkwp7Fg+6lALKgSk47suTg3EbbQDm+8yOrC0nc/q4PTRoHl0alMmUxIhirYc1t3xoCMqJewmjX1bNP8lpVIZAYFZo4eZCpZaiSkM5BeHhz");
-
- ProfileInput subjectName = data.createInput("SubjectNameInput");
- subjectName.setInputAttr("sn_uid", "jmagne");
- subjectName.setInputAttr("sn_e", "jmagne@redhat.com");
- subjectName.setInputAttr("sn_c", "US");
- subjectName.setInputAttr("sn_ou", "Development");
- subjectName.setInputAttr("sn_ou1", "IPA");
- subjectName.setInputAttr("sn_ou2", "Dogtag");
- subjectName.setInputAttr("sn_ou3", "CA");
- subjectName.setInputAttr("sn_cn", "Common");
- subjectName.setInputAttr("sn_o", "RedHat");
-
- ProfileInput submitter = data.createInput("SubmitterInfoInput");
- submitter.setInputAttr("requestor_name", "admin");
- submitter.setInputAttr("requestor_email", "admin@redhat.com");
- submitter.setInputAttr("requestor_phone", "650-555-5555");
-
- try {
- JAXBContext context = JAXBContext.newInstance(CertEnrollmentRequest.class);
- Marshaller marshaller = context.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
-
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
-
- marshaller.marshal(data, stream);
-
- System.out.println("Originally marshalled enrollment object. \n");
-
- System.out.println(stream.toString());
-
- //Try to unmarshall
-
- Unmarshaller unmarshaller = context.createUnmarshaller();
-
- ByteArrayInputStream bais = new ByteArrayInputStream(stream.toByteArray());
- Object unmarshalled = unmarshaller.unmarshal(bais);
-
- //Try re-marshalling, unmarshalled object to compare
-
- stream.reset();
-
- marshaller.marshal(unmarshalled, stream);
-
- System.out.println("Remarshalled unmarshalled enrollment object. \n");
-
- System.out.println(stream.toString());
-
- } catch (JAXBException e) {
- System.out.println(e.toString());
- }
- }
-
- public String getSerialNum() {
- return serialNum;
- }
-
- public void setSerialNum(String serialNum) {
- this.serialNum = serialNum;
- }
-
- public List<ProfileInput> getInputs() {
- return inputs;
- }
-
- public void setInputs(List<ProfileInput> inputs) {
- this.inputs = inputs;
- }
-
- public String getRemoteAddr() {
- return remoteAddr;
- }
-
- public void setRemoteAddr(String remoteAddr) {
- this.remoteAddr = remoteAddr;
- }
-
- public String getRemoteHost() {
- return remoteHost;
- }
-
- public void setRemoteHost(String remoteHost) {
- this.remoteHost = remoteHost;
- }
-
- public List<ProfileOutput> getOutputs() {
- return outputs;
- }
-
- public void setOutputs(List<ProfileOutput> outputs) {
- this.outputs = outputs;
- }
-
- public void setRenewal(boolean isRenewal) {
- this.isRenewal = isRenewal;
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfo.java b/base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfo.java
deleted file mode 100644
index 0754fe547..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-package com.netscape.cms.servlet.request.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.netscape.certsrv.dbs.certdb.CertId;
-
-@XmlRootElement(name = "CertRequestInfo")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CertRequestInfo extends CMSRequestInfo {
-
- public static final String REQ_COMPLETE = "complete";
-
- @XmlElement
- protected String certURL;
-
- @XmlElement
- protected String certRequestType;
-
- public CertRequestInfo() {
- // required to be here for JAXB (defaults)
- }
-
- /**
- * @param certRequestType to set
- */
-
- public void setCertRequestType(String certRequestType) {
- this.certRequestType = certRequestType;
- }
-
- /**
- * @return the certRequestType
- */
-
- public String getCertRequestType() {
- return certRequestType;
- }
-
- /**
- * @set the certURL
- */
- public void setCertURL(String certURL) {
- this.certURL = certURL;
- }
-
- /**
- * @return the certURL
- */
- public String getCertURL() {
- return certURL;
- }
-
- /**
- * @return the certId
- */
-
- public CertId getCertId() {
- if (certURL == null) return null;
- String id = certURL.substring(certURL.lastIndexOf("/") + 1);
- return new CertId(id);
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfos.java b/base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfos.java
deleted file mode 100644
index a4c39a33e..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CertRequestInfos.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.request.model;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import com.netscape.cms.servlet.base.model.Link;
-
-@XmlRootElement(name = "CertRequestInfos")
-public class CertRequestInfos {
- protected Collection<CertRequestInfo> requests;
- protected List<Link> links;
-
- /**
- * @return the requests
- */
- @XmlElementRef
- public Collection<CertRequestInfo> getRequests() {
- return requests;
- }
-
- /**
- * @param requests the requests to set
- */
- public void setRequests(Collection<CertRequestInfo> requests) {
- this.requests = requests;
- }
-
- /**
- * @return the links
- */
- @XmlElementRef
- public List<Link> getLinks() {
- return links;
- }
-
- /**
- * @param links the links to set
- */
- public void setLinks(List<Link> links) {
- this.links = links;
- }
-
- @XmlTransient
- public String getNext() {
- if (links == null) {
- return null;
- }
- for (Link link : links) {
- if ("next".equals(link.getRelationship())) {
- return link.getHref();
- }
- }
- return null;
- }
-
- @XmlTransient
- public String getPrevious() {
- if (links == null) {
- return null;
- }
- for (Link link : links) {
- if ("previous".equals(link.getRelationship())) {
- return link.getHref();
- }
- }
- return null;
- }
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CertRetrievalRequest.java b/base/common/src/com/netscape/cms/servlet/request/model/CertRetrievalRequest.java
deleted file mode 100644
index 9b8caacd9..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CertRetrievalRequest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-/**
- *
- */
-package com.netscape.cms.servlet.request.model;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import com.netscape.certsrv.dbs.certdb.CertId;
-import com.netscape.certsrv.dbs.certdb.CertIdAdapter;
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.certsrv.request.RequestIdAdapter;
-
-/**
- * @author alee
- *
- */
-@XmlRootElement(name = "CertRetrievalRequest")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CertRetrievalRequest {
-
- private static final String CERT_ID = "certId";
-
- @XmlElement
- @XmlJavaTypeAdapter(CertIdAdapter.class)
- protected CertId certId;
-
- @XmlElement
- @XmlJavaTypeAdapter(RequestIdAdapter.class)
- protected RequestId requestId;
-
- public CertRetrievalRequest() {
- // required for JAXB (defaults)
- }
-
- public CertRetrievalRequest(MultivaluedMap<String, String> form) {
- if (form.containsKey(CERT_ID)) {
- certId = new CertId(form.getFirst(CERT_ID));
- }
- }
-
- /**
- * @return the CertId
- */
- public CertId getCertId() {
- return certId;
- }
-
- /**
- * @param CertId the CertId to set
- */
- public void setCertId(CertId certId) {
- this.certId = certId;
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/CertReviewResponse.java b/base/common/src/com/netscape/cms/servlet/request/model/CertReviewResponse.java
deleted file mode 100644
index 3bec6bada..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/CertReviewResponse.java
+++ /dev/null
@@ -1,252 +0,0 @@
-//--- BEGIN COPYRIGHT BLOCK ---
-//This program is free software; you can redistribute it and/or modify
-//it under the terms of the GNU General Public License as published by
-//the Free Software Foundation; version 2 of the License.
-//
-//This program is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-//GNU General Public License for more details.
-//
-//You should have received a copy of the GNU General Public License along
-//with this program; if not, write to the Free Software Foundation, Inc.,
-//51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-//(C) 2012 Red Hat, Inc.
-//All rights reserved.
-//--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.request.model;
-
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.certsrv.request.RequestIdAdapter;
-import com.netscape.cms.servlet.profile.model.PolicyDefault;
-import com.netscape.cms.servlet.profile.model.ProfileAttribute;
-import com.netscape.cms.servlet.profile.model.ProfilePolicy;
-import com.netscape.cms.servlet.profile.model.ProfilePolicySet;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CertReviewResponse extends CertEnrollmentRequest {
-
- @XmlElement(name="ProfilePolicySet")
- protected List<ProfilePolicySet> policySets = new ArrayList<ProfilePolicySet>();
-
- protected String nonce;
-
- @XmlElement
- @XmlJavaTypeAdapter(RequestIdAdapter.class)
- protected RequestId requestId;
-
- protected String requestType;
-
- protected String requestStatus;
-
- protected String requestOwner;
-
- protected String requestCreationTime;
-
- protected String requestModificationTime;
-
- protected String requestNotes;
-
- protected String profileApprovedBy;
-
- protected String profileSetId;
-
- protected String profileIsVisible;
-
- protected String profileName;
-
- protected String profileDescription;
-
- protected String profileRemoteHost;
-
- protected String profileRemoteAddr;
-
- public String getNonce() {
- return nonce;
- }
-
- public void setNonce(String nonce) {
- this.nonce = nonce;
- }
-
- public RequestId getRequestId() {
- return requestId;
- }
-
- public void setRequestId(RequestId requestId) {
- this.requestId = requestId;
- }
-
- public String getRequestType() {
- return requestType;
- }
-
- public void setRequestType(String requestType) {
- this.requestType = requestType;
- }
-
- public String getRequestStatus() {
- return requestStatus;
- }
-
- public void setRequestStatus(String requestStatus) {
- this.requestStatus = requestStatus;
- }
-
- public String getRequestOwner() {
- return requestOwner;
- }
-
- public void setRequestOwner(String requestOwner) {
- this.requestOwner = requestOwner;
- }
-
- public String getRequestCreationTime() {
- return requestCreationTime;
- }
-
- public void setRequestCreationTime(String requestCreationTime) {
- this.requestCreationTime = requestCreationTime;
- }
-
- public String getRequestModificationTime() {
- return requestModificationTime;
- }
-
- public void setRequestModificationTime(String requestModificationTime) {
- this.requestModificationTime = requestModificationTime;
- }
-
- public String getRequestNotes() {
- return requestNotes;
- }
-
- public void setRequestNotes(String requestNotes) {
- this.requestNotes = requestNotes;
- }
-
- public String getProfileApprovedBy() {
- return profileApprovedBy;
- }
-
- public void setProfileApprovedBy(String profileApprovedBy) {
- this.profileApprovedBy = profileApprovedBy;
- }
-
- public String getProfileSetId() {
- return profileSetId;
- }
-
- public void setProfileSetId(String profileSetId) {
- this.profileSetId = profileSetId;
- }
-
- public String getProfileIsVisible() {
- return profileIsVisible;
- }
-
- public void setProfileIsVisible(String profileIsVisible) {
- this.profileIsVisible = profileIsVisible;
- }
-
- public String getProfileName() {
- return profileName;
- }
-
- public void setProfileName(String profileName) {
- this.profileName = profileName;
- }
-
- public String getProfileDescription() {
- return profileDescription;
- }
-
- public void setProfileDescription(String profileDescription) {
- this.profileDescription = profileDescription;
- }
-
- public String getProfileRemoteHost() {
- return profileRemoteHost;
- }
-
- public void setProfileRemoteHost(String profileRemoteHost) {
- this.profileRemoteHost = profileRemoteHost;
- }
-
- public String getProfileRemoteAddr() {
- return profileRemoteAddr;
- }
-
- public void setProfileRemoteAddr(String profileRemoteAddr) {
- this.profileRemoteAddr = profileRemoteAddr;
- }
-
- public String toString() {
- try {
- JAXBContext context = JAXBContext.newInstance(CertReviewResponse.class);
- Marshaller marshaller = context.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
-
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
-
- marshaller.marshal(this, stream);
- return stream.toString();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public List<ProfilePolicySet> getPolicySets() {
- return policySets;
- }
-
- public void setPolicySets(List<ProfilePolicySet> policySets) {
- this.policySets = policySets;
- }
-
- public void addProfilePolicySet(ProfilePolicySet policySet) {
- policySets.add(policySet);
- }
-
- public void removeProfilePolicySet(ProfilePolicySet policySet) {
- policySets.remove(policySet);
- }
-
- @Override
- public HashMap<String,String> toParams() {
- HashMap<String,String> ret = super.toParams();
-
- if (requestId != null) ret.put("requestId", requestId.toString());
- if (requestNotes != null) ret.put("requestNotes", requestNotes);
- if (nonce != null) ret.put("nonces", nonce);
- if (requestType != null) ret.put("requestType", requestType);
-
- for (ProfilePolicySet policySet: policySets) {
- for (ProfilePolicy policy: policySet.getPolicies()) {
- PolicyDefault def = policy.getDef();
- List<ProfileAttribute> attrs = def.getAttributes();
- for (ProfileAttribute attr: attrs) {
- ret.put(attr.getName(), attr.getValue());
- }
- }
- }
- return ret;
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/KeyArchivalRequest.java b/base/common/src/com/netscape/cms/servlet/request/model/KeyArchivalRequest.java
deleted file mode 100644
index 9cd544ff8..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/KeyArchivalRequest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-/**
- *
- */
-package com.netscape.cms.servlet.request.model;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author alee
- *
- */
-@XmlRootElement(name="KeyArchivalRequest")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class KeyArchivalRequest {
-
- private static final String CLIENT_ID = "clientID";
- private static final String TRANS_WRAPPED_SESSION_KEY = "transWrappedSessionKey";
- private static final String DATA_TYPE = "dataType";
- private static final String WRAPPED_PRIVATE_DATA = "wrappedPrivateData";
-
- @XmlElement
- protected String clientId;
-
- @XmlElement
- protected String transWrappedSessionKey;
-
- @XmlElement
- protected String dataType;
-
- @XmlElement
- protected String wrappedPrivateData;
-
- public KeyArchivalRequest() {
- // required for JAXB (defaults)
- }
-
- public KeyArchivalRequest(MultivaluedMap<String, String> form) {
- clientId = form.getFirst(CLIENT_ID);
- transWrappedSessionKey = form.getFirst(TRANS_WRAPPED_SESSION_KEY);
- dataType = form.getFirst(DATA_TYPE);
- wrappedPrivateData = form.getFirst(WRAPPED_PRIVATE_DATA);
- }
-
- /**
- * @return the clientId
- */
- public String getClientId() {
- return clientId;
- }
-
- /**
- * @param clientId the clientId to set
- */
- public void setClientId(String clientId) {
- this.clientId = clientId;
- }
-
- /**
- * @return the transWrappedSessionKey
- */
- public String getTransWrappedSessionKey() {
- return transWrappedSessionKey;
- }
-
- /**
- * @param transWrappedSessionKey the transWrappedSessionKey to set
- */
- public void setTransWrappedSessionKey(String transWrappedSessionKey) {
- this.transWrappedSessionKey = transWrappedSessionKey;
- }
-
- /**
- * @return the dataType
- */
- public String getDataType() {
- return dataType;
- }
-
- /**
- * @param dataType the dataType to set
- */
- public void setDataType(String dataType) {
- this.dataType = dataType;
- }
-
- /**
- * @return the wrappedPrivateData
- */
- public String getWrappedPrivateData() {
- return wrappedPrivateData;
- }
-
- /**
- * @param wrappedPrivateData the wrappedPrivateData to set
- */
- public void setWrappedPrivateData(String wrappedPrivateData) {
- this.wrappedPrivateData = wrappedPrivateData;
- }
-
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/KeyRecoveryRequest.java b/base/common/src/com/netscape/cms/servlet/request/model/KeyRecoveryRequest.java
deleted file mode 100644
index 3cb17d283..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/KeyRecoveryRequest.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-/**
- *
- */
-package com.netscape.cms.servlet.request.model;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import com.netscape.certsrv.dbs.keydb.KeyId;
-import com.netscape.certsrv.dbs.keydb.KeyIdAdapter;
-import com.netscape.certsrv.request.RequestId;
-import com.netscape.certsrv.request.RequestIdAdapter;
-
-/**
- * @author alee
- *
- */
-@XmlRootElement(name="KeyRecoveryRequest")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class KeyRecoveryRequest {
-
- private static final String KEY_ID = "keyId";
- private static final String REQUEST_ID = "requestId";
- private static final String TRANS_WRAPPED_SESSION_KEY = "transWrappedSessionKey";
- private static final String SESSION_WRAPPED_PASSPHRASE = "sessionWrappedPassphrase";
- private static final String NONCE_DATA = "nonceData";
-
- @XmlElement
- @XmlJavaTypeAdapter(KeyIdAdapter.class)
- protected KeyId keyId;
-
- @XmlElement
- @XmlJavaTypeAdapter(RequestIdAdapter.class)
- protected RequestId requestId;
-
- @XmlElement
- protected String transWrappedSessionKey;
-
- @XmlElement
- protected String sessionWrappedPassphrase;
-
- @XmlElement
- protected String nonceData;
-
- public KeyRecoveryRequest() {
- // required for JAXB (defaults)
- }
-
- public KeyRecoveryRequest(MultivaluedMap<String, String> form) {
- if (form.containsKey(KEY_ID)) {
- keyId = new KeyId(form.getFirst(KEY_ID));
- }
- if (form.containsKey(REQUEST_ID)) {
- requestId = new RequestId(form.getFirst(REQUEST_ID));
- }
- transWrappedSessionKey = form.getFirst(TRANS_WRAPPED_SESSION_KEY);
- sessionWrappedPassphrase = form.getFirst(SESSION_WRAPPED_PASSPHRASE);
- nonceData = form.getFirst(NONCE_DATA);
- }
-
- /**
- * @return the keyId
- */
- public KeyId getKeyId() {
- return keyId;
- }
-
- /**
- * @param keyId the keyId to set
- */
- public void setKeyId(KeyId keyId) {
- this.keyId = keyId;
- }
-
- /**
- * @return the requestId
- */
- public RequestId getRequestId() {
- return requestId;
- }
-
- /**
- * @param requestId the requestId to set
- */
- public void setRequestId(RequestId requestId) {
- this.requestId = requestId;
- }
-
- /**
- * @return the transWrappedSessionKey
- */
- public String getTransWrappedSessionKey() {
- return transWrappedSessionKey;
- }
-
- /**
- * @param transWrappedSessionKey the transWrappedSessionKey to set
- */
- public void setTransWrappedSessionKey(String transWrappedSessionKey) {
- this.transWrappedSessionKey = transWrappedSessionKey;
- }
-
- /**
- * @return the sessionWrappedPassphrase
- */
- public String getSessionWrappedPassphrase() {
- return sessionWrappedPassphrase;
- }
-
- /**
- * @param sessionWrappedPassphrase the sessionWrappedPassphrase to set
- */
- public void setSessionWrappedPassphrase(String sessionWrappedPassphrase) {
- this.sessionWrappedPassphrase = sessionWrappedPassphrase;
- }
-
- /**
- * @return nonceData
- */
-
- public String getNonceData() {
- return nonceData;
- }
-
- /**
- * @param nonceData the nonceData to set
- */
-
- public void setNonceData(String nonceData) {
- this.nonceData = nonceData;
- }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfo.java b/base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfo.java
deleted file mode 100644
index 91d5f8210..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-package com.netscape.cms.servlet.request.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.netscape.certsrv.dbs.keydb.KeyId;
-
-@XmlRootElement(name = "SecurityDataRequestInfo")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class KeyRequestInfo extends CMSRequestInfo {
-
- @XmlElement
- protected String keyURL;
-
- public KeyRequestInfo() {
- // required to be here for JAXB (defaults)
- }
-
- /**
- * @return the keyURL
- */
- public String getKeyURL() {
- return keyURL;
- }
-
- /**
- * @return the key ID in the keyURL
- */
- public KeyId getKeyId() {
- String id = keyURL.substring(keyURL.lastIndexOf("/") + 1);
- return new KeyId(id);
- }
-
- /**
- * @param keyURL the keyURL to set
- */
- public void setKeyURL(String keyURL) {
- this.keyURL = keyURL;
- }
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfos.java b/base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfos.java
deleted file mode 100644
index dc1b6a5e4..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/KeyRequestInfos.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.request.model;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import com.netscape.cms.servlet.base.model.Link;
-
-@XmlRootElement(name = "SecurityDataRequestInfos")
-public class KeyRequestInfos {
- protected Collection<KeyRequestInfo> requests;
- protected List<Link> links;
-
- /**
- * @return the requests
- */
- @XmlElementRef
- public Collection<KeyRequestInfo> getRequests() {
- return requests;
- }
-
- /**
- * @param requests the requests to set
- */
- public void setRequests(Collection<KeyRequestInfo> requests) {
- this.requests = requests;
- }
-
- /**
- * @return the links
- */
- @XmlElementRef
- public List<Link> getLinks() {
- return links;
- }
-
- /**
- * @param links the links to set
- */
- public void setLinks(List<Link> links) {
- this.links = links;
- }
-
- @XmlTransient
- public String getNext() {
- if (links == null) {
- return null;
- }
- for (Link link : links) {
- if ("next".equals(link.getRelationship())) {
- return link.getHref();
- }
- }
- return null;
- }
-
- @XmlTransient
- public String getPrevious() {
- if (links == null) {
- return null;
- }
- for (Link link : links) {
- if ("previous".equals(link.getRelationship())) {
- return link.getHref();
- }
- }
- return null;
- }
-}
diff --git a/base/common/src/com/netscape/cms/servlet/request/model/ProfileRetrievalRequest.java b/base/common/src/com/netscape/cms/servlet/request/model/ProfileRetrievalRequest.java
deleted file mode 100644
index 8670605fc..000000000
--- a/base/common/src/com/netscape/cms/servlet/request/model/ProfileRetrievalRequest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2011 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-
-/**
- *
- */
-package com.netscape.cms.servlet.request.model;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author alee
- *
- */
-@XmlRootElement(name = "ProfileRetrievalRequest")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class ProfileRetrievalRequest {
-
- private static final String PROFILE_ID = "profileId";
-
- @XmlElement
- protected String profileId;
-
- public ProfileRetrievalRequest() {
- // required for JAXB (defaults)
- }
-
- public ProfileRetrievalRequest(MultivaluedMap<String, String> form) {
- if (form.containsKey(PROFILE_ID)) {
- profileId = form.getFirst(PROFILE_ID);
- }
- }
-
- /**
- * @return the ProfileId
- */
- public String getProfileId() {
- return profileId;
- }
-
- /**
- * @param ProfileId the ProfileId to set
- */
- public void setProfileId(String profileId) {
- this.profileId = profileId;
- }
-
-} \ No newline at end of file