diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-10-08 16:52:53 -0400 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-10-18 16:46:09 -0500 |
commit | 4300459bff057ba50093f735ee9289868e258215 (patch) | |
tree | a708d2946eff5da01218ac200ae11c6d1ed33a32 /base/common/src/com/netscape/cms | |
parent | 643c089887db3369363e2b88dde19ef3a97029a2 (diff) | |
download | pki-4300459bff057ba50093f735ee9289868e258215.tar.gz pki-4300459bff057ba50093f735ee9289868e258215.tar.xz pki-4300459bff057ba50093f735ee9289868e258215.zip |
Added PKIConnection.
The code in PKIClient has been refactored into PKIConnection
such that a single connection object can be used by several
REST clients. The PKIClient will remain the base class for
all REST clients.
Ticket #357
Diffstat (limited to 'base/common/src/com/netscape/cms')
-rw-r--r-- | base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java index 531fc212f..e247b4297 100644 --- a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java +++ b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java @@ -139,7 +139,7 @@ import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.base.ISubsystem; import com.netscape.certsrv.ca.ICertificateAuthority; import com.netscape.certsrv.client.ClientConfig; -import com.netscape.certsrv.client.PKIClient; +import com.netscape.certsrv.client.PKIConnection; import com.netscape.certsrv.dbs.IDBSubsystem; import com.netscape.certsrv.dbs.crldb.ICRLIssuingPointRecord; import com.netscape.certsrv.ldap.ILdapConnFactory; @@ -205,15 +205,15 @@ public class ConfigurationUtils { public static ClientResponse<String> getClientResponse(String hostname, int port, boolean secure, String path, String content, String clientnickname, SSLCertificateApprovalCallback certApprovalCallback) - throws URISyntaxException { + throws Exception { String protocol = secure ? "https" : "http"; ClientConfig config = new ClientConfig(); config.setServerURI(protocol + "://" + hostname + ":" + port + path); config.setCertNickname(clientnickname); - PKIClient client = new PKIClient(config); - ClientResponse<String> response = client.post(content); + PKIConnection connection = new PKIConnection(config); + ClientResponse<String> response = connection.post(content); return response; } @@ -311,8 +311,7 @@ public class ConfigurationUtils { } } - public static String getInstallToken(String sdhost, int sdport, String user, String passwd) - throws EPropertyNotFound, EBaseException, URISyntaxException, IOException { + public static String getInstallToken(String sdhost, int sdport, String user, String passwd) throws Exception { IConfigStore cs = CMS.getConfigStore(); boolean oldtoken = cs.getBoolean("cs.useOldTokenInterface", true); @@ -343,8 +342,7 @@ public class ConfigurationUtils { } } - public static String getOldCookie(String sdhost, int sdport, String user, String passwd) throws IOException, - EPropertyNotFound, EBaseException, URISyntaxException { + public static String getOldCookie(String sdhost, int sdport, String user, String passwd) throws Exception { IConfigStore cs = CMS.getConfigStore(); String subca_url = "https://" + CMS.getEEHost() + ":" |