summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/key/KeyClient.java
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2013-04-23 11:37:03 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2013-04-25 23:17:31 -0400
commit7a89bc5ac029066e4ec6d35d1cc953f046a9d36f (patch)
tree0568e637df7c1ce57b5c0512bc7c356aa5e0dab6 /base/common/src/com/netscape/certsrv/key/KeyClient.java
parent7ca438db07efb122bc93efd0471be7a2be34b663 (diff)
downloadpki-7a89bc5ac029066e4ec6d35d1cc953f046a9d36f.tar.gz
pki-7a89bc5ac029066e4ec6d35d1cc953f046a9d36f.tar.xz
pki-7a89bc5ac029066e4ec6d35d1cc953f046a9d36f.zip
Refactored code to import CA certificate.
The code to import CA certificate has been moved from PKIConnection into PKIClient to allow reuse. The Client classes have been modified such that it uses a shared PKIClient object instead of PKIConnection. The return codes in CertFindCLI has been fixed to be more consistent with other commands. Ticket #491
Diffstat (limited to 'base/common/src/com/netscape/certsrv/key/KeyClient.java')
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyClient.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/base/common/src/com/netscape/certsrv/key/KeyClient.java b/base/common/src/com/netscape/certsrv/key/KeyClient.java
index ce2946c1e..7deef0472 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyClient.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyClient.java
@@ -21,30 +21,29 @@ import java.net.URISyntaxException;
import com.netscape.certsrv.client.ClientConfig;
import com.netscape.certsrv.client.PKIClient;
-import com.netscape.certsrv.client.PKIConnection;
import com.netscape.certsrv.request.RequestId;
/**
* @author Endi S. Dewata
*/
-public class KeyClient extends PKIClient {
+public class KeyClient {
+ public PKIClient client;
public KeyResource keyClient;
public KeyRequestResource keyRequestClient;
- public KeyClient(PKIConnection connection) throws URISyntaxException {
- super(connection);
- init();
+ public KeyClient(ClientConfig config) throws URISyntaxException {
+ this(new PKIClient(config));
}
- public KeyClient(ClientConfig config) throws URISyntaxException {
- super(config);
+ public KeyClient(PKIClient client) throws URISyntaxException {
+ this.client = client;
init();
}
public void init() throws URISyntaxException {
- keyClient = createProxy(KeyResource.class);
- keyRequestClient = createProxy(KeyRequestResource.class);
+ keyClient = client.createProxy(KeyResource.class);
+ keyRequestClient = client.createProxy(KeyRequestResource.class);
}
public KeyDataInfos findKeys(String clientID, String status, Integer maxSize, Integer maxTime) {