summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2011-12-08 21:15:59 -0500
committerAde Lee <alee@redhat.com>2011-12-08 21:15:59 -0500
commit171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch)
tree1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java
parentadad2fcee8a29fdb82376fbce07dedb11fccc182 (diff)
downloadpki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz
pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz
pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java65
1 files changed, 28 insertions, 37 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java
index b71cbb3c..cf699c61 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/UpdateConnector.java
@@ -17,6 +17,7 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;
+
import java.io.IOException;
import java.util.Enumeration;
import java.util.Locale;
@@ -44,6 +45,7 @@ import com.netscape.cms.servlet.common.CMSRequest;
import com.netscape.cms.servlet.common.ICMSTemplateFiller;
import com.netscape.cmsutil.xml.XMLObject;
+
public class UpdateConnector extends CMSServlet {
/**
@@ -60,7 +62,6 @@ public class UpdateConnector extends CMSServlet {
/**
* initialize the servlet.
- *
* @param sc servlet configuration, read from the web.xml file
*/
public void init(ServletConfig sc) throws ServletException {
@@ -70,7 +71,7 @@ public class UpdateConnector extends CMSServlet {
}
/**
- * Process the HTTP request.
+ * Process the HTTP request.
*/
protected void process(CMSRequest cmsReq) throws EBaseException {
CMS.debug("UpdateConnector: processing...");
@@ -84,9 +85,9 @@ public class UpdateConnector extends CMSServlet {
CMS.debug("UpdateConnector authentication successful.");
} catch (Exception e) {
CMS.debug("UpdateConnector: authentication failed.");
- log(ILogger.LL_FAILURE,
+ log(ILogger.LL_FAILURE,
CMS.getLogMessage("CMSGW_ERR_BAD_SERV_OUT_STREAM", "",
- e.toString()));
+ e.toString()));
outputError(httpResp, AUTH_FAILURE, "Error: Not authenticated");
return;
}
@@ -99,19 +100,19 @@ public class UpdateConnector extends CMSServlet {
AuthzToken authzToken = null;
try {
- authzToken = authorize(mAclMethod, authToken, mAuthzResourceName,
- "modify");
+ authzToken = authorize(mAclMethod, authToken, mAuthzResourceName,
+ "modify");
CMS.debug("UpdateConnector authorization successful.");
} catch (EAuthzAccessDenied e) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("ADMIN_SRVLT_AUTH_FAILURE", e.toString()));
+ CMS.getLogMessage("ADMIN_SRVLT_AUTH_FAILURE", e.toString()));
outputError(httpResp, "Error: Not authorized");
return;
} catch (Exception e) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("ADMIN_SRVLT_AUTH_FAILURE", e.toString()));
+ CMS.getLogMessage("ADMIN_SRVLT_AUTH_FAILURE", e.toString()));
outputError(httpResp,
- "Error: Encountered problem during authorization.");
+ "Error: Encountered problem during authorization.");
return;
}
@@ -124,35 +125,33 @@ public class UpdateConnector extends CMSServlet {
Enumeration list = httpReq.getParameterNames();
while (list.hasMoreElements()) {
- String name = (String) list.nextElement();
+ String name = (String)list.nextElement();
String val = httpReq.getParameter(name);
if (name != null && name.startsWith("ca.connector")) {
- CMS.debug("Adding connector update name=" + name + " val="
- + val);
+ CMS.debug("Adding connector update name=" + name + " val=" + val);
cs.putString(name, val);
} else {
- CMS.debug("Skipping connector update name=" + name + " val="
- + val);
+ CMS.debug("Skipping connector update name=" + name + " val=" + val);
}
}
-
- try {
+
+ try {
String nickname = cs.getString("ca.subsystem.nickname", "");
String tokenname = cs.getString("ca.subsystem.tokenname", "");
if (!tokenname.equals("Internal Key Storage Token"))
- nickname = tokenname + ":" + nickname;
+ nickname = tokenname+":"+nickname;
cs.putString("ca.connector.KRA.nickName", nickname);
cs.commit(false);
} catch (Exception e) {
}
// start the connector
- try {
- ICertificateAuthority ca = (ICertificateAuthority) CMS
- .getSubsystem("ca");
- ICAService caService = (ICAService) ca.getCAService();
- IConnector kraConnector = caService.getConnector(cs
- .getSubStore("ca.connector.KRA"));
+ try {
+ ICertificateAuthority ca = (ICertificateAuthority)
+ CMS.getSubsystem("ca");
+ ICAService caService = (ICAService)ca.getCAService();
+ IConnector kraConnector = caService.getConnector(
+ cs.getSubStore("ca.connector.KRA"));
caService.setKRAConnector(kraConnector);
kraConnector.start();
} catch (Exception e) {
@@ -174,22 +173,14 @@ public class UpdateConnector extends CMSServlet {
}
}
- protected void setDefaultTemplates(ServletConfig sc) {
- }
+ protected void setDefaultTemplates(ServletConfig sc) {}
- protected void renderTemplate(CMSRequest cmsReq, String templateName,
- ICMSTemplateFiller filler) throws IOException {// do nothing
- }
+ protected void renderTemplate(
+ CMSRequest cmsReq, String templateName, ICMSTemplateFiller filler)
+ throws IOException {// do nothing
+ }
- protected void renderResult(CMSRequest cmsReq) throws IOException {// do
- // nothing,
- // ie, it
- // will
- // not
- // return
- // the
- // default
- // javascript.
+ protected void renderResult(CMSRequest cmsReq) throws IOException {// do nothing, ie, it will not return the default javascript.
}
/**