diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-08-11 05:34:59 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-08-15 12:07:34 -0500 |
commit | 108bd269ab0eb512c334939fabde68eeab5b0b67 (patch) | |
tree | 7c9bbb80c7de89fede78a59576241c42394f5032 /base/ca/functional | |
parent | f554dc2aa0478aa23f7e986b6779091f7d520bf5 (diff) | |
download | pki-108bd269ab0eb512c334939fabde68eeab5b0b67.tar.gz pki-108bd269ab0eb512c334939fabde68eeab5b0b67.tar.xz pki-108bd269ab0eb512c334939fabde68eeab5b0b67.zip |
Reorganized REST client classes.
The REST client classes have been moved into the
com.netscape.cms.client.<component> packages.
Ticket #215
Diffstat (limited to 'base/ca/functional')
-rw-r--r-- | base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java | 141 | ||||
-rw-r--r-- | base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java | 3 |
2 files changed, 2 insertions, 142 deletions
diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java deleted file mode 100644 index 24c53b137..000000000 --- a/base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java +++ /dev/null @@ -1,141 +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.test; - -import java.net.URISyntaxException; -import java.util.Collection; - -import com.netscape.certsrv.dbs.certdb.CertId; -import com.netscape.certsrv.request.RequestId; -import com.netscape.cms.client.cli.ClientConfig; -import com.netscape.cms.servlet.cert.CertResource; -import com.netscape.cms.servlet.cert.model.CertDataInfos; -import com.netscape.cms.servlet.cert.model.CertSearchRequest; -import com.netscape.cms.servlet.cert.model.CertData; -import com.netscape.cms.servlet.csadmin.PKIClient; -import com.netscape.cms.servlet.profile.ProfileResource; -import com.netscape.cms.servlet.profile.model.ProfileData; -import com.netscape.cms.servlet.profile.model.ProfileDataInfos; -import com.netscape.cms.servlet.request.CertRequestResource; -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; - -public class CAClient extends PKIClient { - - private CertResource certClient; - private CertRequestResource certRequestClient; - private ProfileResource profileClient; - - public CAClient(ClientConfig config) throws URISyntaxException { - super(config); - - certRequestClient = createProxy(CertRequestResource.class); - certClient = createProxy(CertResource.class); - profileClient = createProxy(ProfileResource.class); - } - - public Collection<CertRequestInfo> listRequests(String requestState, String requestType) { - CertRequestInfos infos = null; - Collection<CertRequestInfo> list = null; - infos = certRequestClient.listRequests( - requestState, requestType, new RequestId(0), 100, 100, 10); - list = infos.getRequests(); - - return list; - } - - public CertDataInfos listCerts(String status) { - return certClient.listCerts(status, 100, 10); - } - - public CertDataInfos searchCerts(CertSearchRequest data) { - return certClient.searchCerts(data, 100, 10); - } - - public ProfileDataInfos listProfiles() { - return profileClient.listProfiles(); - } - - public ProfileData getProfile(String id) { - - if (id == null) { - return null; - } - - return profileClient.retrieveProfile(id); - } - - public CertData getCertData(CertId id) { - - if (id == null) { - return null; - } - - return certClient.getCert(id); - - } - - public CertRequestInfos enrollCertificate(CertEnrollmentRequest data) { - if (data == null) { - return null; - } - - return certRequestClient.enrollCert(data); - } - - public CertRequestInfo getRequest(RequestId id) { - if (id == null) { - return null; - } - return certRequestClient.getRequestInfo(id); - } - - public CertReviewResponse reviewRequest(RequestId id) { - if (id == null) { - return null; - } - return certRequestClient.reviewRequest(id); - } - - public void approveRequest(RequestId id, CertReviewResponse data) { - certRequestClient.approveRequest(id, data); - } - - public void rejectRequest(RequestId id, CertReviewResponse data) { - certRequestClient.rejectRequest(id, data); - } - - public void cancelRequest(RequestId id, CertReviewResponse data) { - certRequestClient.cancelRequest(id, data); - } - - public void updateRequest(RequestId id, CertReviewResponse data) { - certRequestClient.updateRequest(id, data); - } - - public void validateRequest(RequestId id, CertReviewResponse data) { - certRequestClient.validateRequest(id, data); - } - - public void unassignRequest(RequestId id, CertReviewResponse data) { - certRequestClient.unassignRequest(id, data); - } - -} diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java index 8e67f5d5f..a230b468a 100644 --- a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java +++ b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java @@ -35,7 +35,8 @@ import org.mozilla.jss.util.Password; import com.netscape.certsrv.dbs.certdb.CertId; import com.netscape.certsrv.request.RequestId; -import com.netscape.cms.client.cli.ClientConfig; +import com.netscape.cms.client.ClientConfig; +import com.netscape.cms.client.ca.CAClient; import com.netscape.cms.servlet.cert.CertNotFoundException; import com.netscape.cms.servlet.cert.model.CertDataInfo; import com.netscape.cms.servlet.cert.model.CertDataInfos; |