From 7a89bc5ac029066e4ec6d35d1cc953f046a9d36f Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Tue, 23 Apr 2013 11:37:03 -0400 Subject: 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 --- base/common/src/com/netscape/certsrv/key/KeyClient.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'base/common/src/com/netscape/certsrv/key') 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) { -- cgit