summaryrefslogtreecommitdiffstats
path: root/base/ca
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-07-19 01:51:50 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-07-30 11:21:45 -0500
commitc4636a5b56bd3e0f18fb3afd0b930729d58ce1f6 (patch)
tree57452b5a630dc4c3deda724f992180e7ba4cafeb /base/ca
parent70681bc83ccc25639da1b87940661b2649044629 (diff)
downloadpki-c4636a5b56bd3e0f18fb3afd0b930729d58ce1f6.tar.gz
pki-c4636a5b56bd3e0f18fb3afd0b930729d58ce1f6.tar.xz
pki-c4636a5b56bd3e0f18fb3afd0b930729d58ce1f6.zip
Added ClientConfig.
A new ClientConfig class has been added to encapsulate client configuration parameters. These parameters include server URI, certificate database, certificate nickname, and password. Ticket #107
Diffstat (limited to 'base/ca')
-rw-r--r--base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java14
-rw-r--r--base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java8
2 files changed, 13 insertions, 9 deletions
diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java
index ffd3330cf..24ce21277 100644
--- a/base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java
+++ b/base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java
@@ -20,10 +20,9 @@ package com.netscape.cms.servlet.test;
import java.net.URISyntaxException;
import java.util.Collection;
-import org.jboss.resteasy.client.ProxyFactory;
-
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.CertSearchData;
@@ -44,11 +43,12 @@ public class CARestClient extends CMSRestClient {
private CertRequestResource certRequestClient;
private ProfileResource profileClient;
- public CARestClient(String baseUri, String clientCertNick) throws URISyntaxException {
- super(baseUri, clientCertNick);
- certRequestClient = ProxyFactory.create(CertRequestResource.class, uri, executor, providerFactory);
- certClient = ProxyFactory.create(CertResource.class, uri, executor, providerFactory);
- profileClient = ProxyFactory.create(ProfileResource.class, uri, executor, providerFactory);
+ public CARestClient(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) {
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 807d014c4..8fa4b9bb4 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,6 +35,7 @@ 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.servlet.cert.CertNotFoundException;
import com.netscape.cms.servlet.cert.model.CertDataInfo;
import com.netscape.cms.servlet.cert.model.CertDataInfos;
@@ -147,10 +148,13 @@ public class CATest {
log("Exception in logging into token:" + e.toString());
}
- String baseUri = protocol + "://" + host + ":" + port + "/ca/pki";
CARestClient client;
try {
- client = new CARestClient(baseUri, clientCertNickname);
+ ClientConfig config = new ClientConfig();
+ config.setServerURI(protocol + "://" + host + ":" + port + "/ca");
+ config.setCertNickname(clientCertNickname);
+
+ client = new CARestClient(config);
} catch (Exception e) {
e.printStackTrace();
return;