From 32150d3ee32f8ac27118af7c792794b538c78a2f Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Wed, 7 Dec 2011 16:58:12 -0500 Subject: Formatting Formatted project according to eclipse project settings --- .../cms/servlet/admin/ProfileAdminServlet.java | 1176 +++++++++----------- 1 file changed, 521 insertions(+), 655 deletions(-) (limited to 'pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java') diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java index 1cfab0b6..1ae8def1 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cms.servlet.admin; - import java.io.File; import java.io.IOException; import java.util.Enumeration; @@ -53,14 +52,12 @@ import com.netscape.certsrv.property.IDescriptor; import com.netscape.certsrv.registry.IPluginInfo; import com.netscape.certsrv.registry.IPluginRegistry; - /** * This class is an administration servlet for policy management. - * - * Each service (CA, KRA, RA) should be responsible - * for registering an instance of this with the remote - * administration subsystem. - * + * + * Each service (CA, KRA, RA) should be responsible for registering an instance + * of this with the remote administration subsystem. + * * @version $Revision$, $Date$ */ public class ProfileAdminServlet extends AdminServlet { @@ -72,8 +69,7 @@ public class ProfileAdminServlet extends AdminServlet { public final static String PROP_AUTHORITY = "authority"; private final static String INFO = "ProfileAdminServlet"; - private final static String PW_PASSWORD_CACHE_ADD = - "PASSWORD_CACHE_ADD"; + private final static String PW_PASSWORD_CACHE_ADD = "PASSWORD_CACHE_ADD"; public final static String PROP_PREDICATE = "predicate"; private IAuthority mAuthority = null; @@ -96,8 +92,7 @@ public class ProfileAdminServlet extends AdminServlet { public static String MISSING_POLICY_ORDERING = "Missing policy ordering"; public static String BAD_CONFIGURATION_VAL = "Invalid configuration value."; - private final static String LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE = - "LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE_3"; + private final static String LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE = "LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE_3"; /** * Constructs administration servlet. @@ -116,7 +111,8 @@ public class ProfileAdminServlet extends AdminServlet { if (authority != null) mAuthority = (IAuthority) CMS.getSubsystem(authority); mRegistry = (IPluginRegistry) CMS.getSubsystem(CMS.SUBSYSTEM_REGISTRY); - mProfileSub = (IProfileSubsystem) CMS.getSubsystem(CMS.SUBSYSTEM_PROFILE); + mProfileSub = (IProfileSubsystem) CMS + .getSubsystem(CMS.SUBSYSTEM_PROFILE); } /** @@ -132,10 +128,12 @@ public class ProfileAdminServlet extends AdminServlet { if (ext_info instanceof IPolicyRule) { if (nvps.getPair(IPolicyRule.PROP_ENABLE) == null) { - nvps.add(IPolicyRule.PROP_ENABLE, "boolean;Enable this policy rule"); + nvps.add(IPolicyRule.PROP_ENABLE, + "boolean;Enable this policy rule"); } if (nvps.getPair(PROP_PREDICATE) == null) { - nvps.add(PROP_PREDICATE, "string;Rules describing when this policy should run."); + nvps.add(PROP_PREDICATE, + "string;Rules describing when this policy should run."); } } } @@ -143,9 +141,8 @@ public class ProfileAdminServlet extends AdminServlet { /** * Serves HTTP admin request. */ - public void service(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + public void service(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { super.service(req, resp); super.authenticate(req); @@ -153,7 +150,7 @@ public class ProfileAdminServlet extends AdminServlet { AUTHZ_RES_NAME = "certServer.profile.configuration"; String scope = req.getParameter(Constants.OP_SCOPE); - CMS.debug("ProfileAdminServlet: service scope: " + scope); + CMS.debug("ProfileAdminServlet: service scope: " + scope); if (scope.equals(ScopeDef.SC_PROFILE_RULES)) { processProfileRuleMgmt(req, resp); } else if (scope.equals(ScopeDef.SC_PROFILE_POLICIES)) { @@ -176,33 +173,30 @@ public class ProfileAdminServlet extends AdminServlet { sendResponse(ERROR, INVALID_POLICY_SCOPE, null, resp); } - private boolean readAuthorize(HttpServletRequest req, - HttpServletResponse resp) throws IOException { + private boolean readAuthorize(HttpServletRequest req, + HttpServletResponse resp) throws IOException { mOp = "read"; if ((mToken = super.authorize(req)) == null) { - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), "CMS_ADMIN_SRVLT_AUTHZ_FAILED"), - null, resp); + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_ADMIN_SRVLT_AUTHZ_FAILED"), null, resp); return false; } return true; } - private boolean modifyAuthorize(HttpServletRequest req, - HttpServletResponse resp) throws IOException { + private boolean modifyAuthorize(HttpServletRequest req, + HttpServletResponse resp) throws IOException { mOp = "modify"; if ((mToken = super.authorize(req)) == null) { - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), "CMS_ADMIN_SRVLT_AUTHZ_FAILED"), - null, resp); + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_ADMIN_SRVLT_AUTHZ_FAILED"), null, resp); return false; } return true; } public void processProfilePolicy(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -222,8 +216,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void processProfileInput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); String scope = super.getParameter(req, Constants.OP_SCOPE); @@ -244,8 +237,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void processProfileOutput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); String scope = super.getParameter(req, Constants.OP_SCOPE); @@ -266,8 +258,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void processProfileInputConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -283,8 +274,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void processProfileOutputConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -300,8 +290,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void processPolicyDefaultConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -321,8 +310,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void processPolicyConstraintConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -346,8 +334,7 @@ public class ProfileAdminServlet extends AdminServlet { * Process Policy Implementation Management. */ public void processPolicyImplMgmt(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -356,13 +343,11 @@ public class ProfileAdminServlet extends AdminServlet { return; listProfileImpls(req, resp); } else - sendResponse(ERROR, INVALID_POLICY_IMPL_OP, - null, resp); + sendResponse(ERROR, INVALID_POLICY_IMPL_OP, null, resp); } public void processProfileRuleMgmt(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { // Get operation type String op = req.getParameter(Constants.OP_TYPE); @@ -387,16 +372,14 @@ public class ProfileAdminServlet extends AdminServlet { return; modifyProfileInstance(req, resp); } else - sendResponse(ERROR, INVALID_POLICY_IMPL_OP, - null, resp); + sendResponse(ERROR, INVALID_POLICY_IMPL_OP, null, resp); } /** * Lists all registered profile impementations */ public void listProfileImpls(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { Enumeration impls = mRegistry.getIds("profile"); NameValuePairs nvp = new NameValuePairs(); @@ -405,29 +388,30 @@ public class ProfileAdminServlet extends AdminServlet { String id = (String) impls.nextElement(); IPluginInfo info = mRegistry.getPluginInfo("profile", id); - nvp.add(id, info.getClassName() + "," + - info.getDescription(getLocale(req))); - } + nvp.add(id, + info.getClassName() + "," + + info.getDescription(getLocale(req))); + } sendResponse(SUCCESS, null, nvp, resp); } /** * Add policy profile *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void addProfilePolicy(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -452,10 +436,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -464,11 +446,9 @@ public class ProfileAdminServlet extends AdminServlet { } if (mProfileSub.isProfileEnable(profileId)) { - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), - "CMS_PROFILE_CREATE_POLICY_FAILED", - "Profile is currently enabled"), - null, resp); + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_PROFILE_CREATE_POLICY_FAILED", + "Profile is currently enabled"), null, resp); return; } @@ -480,51 +460,42 @@ public class ProfileAdminServlet extends AdminServlet { try { if (!isValidId(setId)) { - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), - "CMS_PROFILE_CREATE_POLICY_FAILED", - "Invalid set id " + setId), - null, resp); - return; + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_PROFILE_CREATE_POLICY_FAILED", + "Invalid set id " + setId), null, resp); + return; } if (!isValidId(pId)) { - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), - "CMS_PROFILE_CREATE_POLICY_FAILED", - "Invalid policy id " + pId), - null, resp); - return; + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_PROFILE_CREATE_POLICY_FAILED", + "Invalid policy id " + pId), null, resp); + return; } - policy = profile.createProfilePolicy(setId, pId, - defImpl, conImpl); + policy = profile.createProfilePolicy(setId, pId, defImpl, + conImpl); } catch (EBaseException e1) { // error - CMS.debug("ProfileAdminServlet: addProfilePolicy " + - e1.toString()); + CMS.debug("ProfileAdminServlet: addProfilePolicy " + + e1.toString()); // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), "CMS_PROFILE_CREATE_POLICY_FAILED", - e1.toString()), - null, resp); + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_PROFILE_CREATE_POLICY_FAILED", e1.toString()), + null, resp); return; } NameValuePairs nvp = new NameValuePairs(); // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -532,47 +503,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Add profile input *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ - public void addProfileInput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + public void addProfileInput(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -595,10 +564,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -629,16 +596,13 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), "CMS_PROFILE_CREATE_INPUT_FAILED", - e1.toString()), - null, resp); + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_PROFILE_CREATE_INPUT_FAILED", e1.toString()), + null, resp); return; } @@ -647,10 +611,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -658,47 +620,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Add profile output *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void addProfileOutput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -721,10 +681,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -749,23 +707,20 @@ public class ProfileAdminServlet extends AdminServlet { } try { - output = profile.createProfileOutput(outputId, outputImpl, - nvps); + output = profile + .createProfileOutput(outputId, outputImpl, nvps); } catch (EBaseException e1) { // error // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); - sendResponse(ERROR, - CMS.getUserMessage(getLocale(req), "CMS_PROFILE_CREATE_OUTPUT_FAILED", - e1.toString()), - null, resp); + sendResponse(ERROR, CMS.getUserMessage(getLocale(req), + "CMS_PROFILE_CREATE_OUTPUT_FAILED", e1.toString()), + null, resp); return; } @@ -774,10 +729,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -785,47 +738,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Delete policy profile *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void deleteProfilePolicy(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -857,10 +808,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -879,10 +828,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -894,10 +841,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -905,47 +850,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Delete profile input *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void deleteProfileInput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -968,8 +911,10 @@ public class ProfileAdminServlet extends AdminServlet { if (name.equals("INPUTID")) inputId = req.getParameter(name); } - CMS.debug("ProfileAdminServlet: deleteProfileInput profileId -> " + profileId); - CMS.debug("ProfileAdminServlet: deleteProfileInput inputId -> " + inputId); + CMS.debug("ProfileAdminServlet: deleteProfileInput profileId -> " + + profileId); + CMS.debug("ProfileAdminServlet: deleteProfileInput inputId -> " + + inputId); IProfile profile = null; try { @@ -979,10 +924,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -996,10 +939,8 @@ public class ProfileAdminServlet extends AdminServlet { } catch (EBaseException e1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1011,10 +952,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1022,47 +961,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Delete profile output *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void deleteProfileOutput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1085,8 +1022,10 @@ public class ProfileAdminServlet extends AdminServlet { if (name.equals("OUTPUTID")) outputId = req.getParameter(name); } - CMS.debug("ProfileAdminServlet: deleteProfileOutput profileId -> " + profileId); - CMS.debug("ProfileAdminServlet: deleteProfileOutput outputId -> " + outputId); + CMS.debug("ProfileAdminServlet: deleteProfileOutput profileId -> " + + profileId); + CMS.debug("ProfileAdminServlet: deleteProfileOutput outputId -> " + + outputId); IProfile profile = null; try { @@ -1096,10 +1035,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1107,16 +1044,15 @@ public class ProfileAdminServlet extends AdminServlet { return; } - CMS.debug("ProfileAdminServlet: deleteProfileOutput profile -> " + profile); + CMS.debug("ProfileAdminServlet: deleteProfileOutput profile -> " + + profile); try { profile.deleteProfileOutput(outputId); } catch (EBaseException e1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1128,10 +1064,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1139,47 +1073,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Add default policy profile configuration *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void addPolicyDefaultConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1201,16 +1133,14 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); sendResponse(ERROR, null, null, resp); return; - } + } StringTokenizer ss = new StringTokenizer(policyId, ":"); String setId = ss.nextToken(); @@ -1219,7 +1149,7 @@ public class ProfileAdminServlet extends AdminServlet { IProfilePolicy policy = profile.getProfilePolicy(setId, pId); IPolicyDefault def = policy.getDefault(); IConfigStore defConfig = def.getConfigStore(); - + Enumeration names = req.getParameterNames(); while (names.hasMoreElements()) { @@ -1232,28 +1162,28 @@ public class ProfileAdminServlet extends AdminServlet { if (name.equals("RS_ID")) continue; try { - def.setConfig(name,req.getParameter(name)); + def.setConfig(name, req.getParameter(name)); } catch (EPropertyException e) { - CMS.debug("ProfileAdminServlet: modifyPolicyDefConfig setConfig exception."); - try { - profile.deleteProfilePolicy(setId, pId); - } catch (Exception e11) {} - sendResponse(ERROR,BAD_CONFIGURATION_VAL,null,resp); - return; + CMS.debug("ProfileAdminServlet: modifyPolicyDefConfig setConfig exception."); + try { + profile.deleteProfilePolicy(setId, pId); + } catch (Exception e11) { + } + sendResponse(ERROR, BAD_CONFIGURATION_VAL, null, resp); + return; } - // defConfig.putString("params." + name, req.getParameter(name)); + // defConfig.putString("params." + name, + // req.getParameter(name)); } try { profile.getConfigStore().commit(false); } catch (Exception e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1264,10 +1194,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1275,47 +1203,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Add policy constraints profile configuration *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void addPolicyConstraintConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1337,16 +1263,14 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); sendResponse(ERROR, null, null, resp); return; - } + } StringTokenizer ss = new StringTokenizer(policyId, ":"); String setId = ss.nextToken(); @@ -1369,28 +1293,28 @@ public class ProfileAdminServlet extends AdminServlet { continue; try { - con.setConfig(name,req.getParameter(name)); + con.setConfig(name, req.getParameter(name)); } catch (EPropertyException e) { - CMS.debug("ProfileAdminServlet: addPolicyConstraintsConfig setConfig exception."); - try { - profile.deleteProfilePolicy(setId, pId); - } catch (Exception e11) {} - sendResponse(ERROR,BAD_CONFIGURATION_VAL,null,resp); - return; + CMS.debug("ProfileAdminServlet: addPolicyConstraintsConfig setConfig exception."); + try { + profile.deleteProfilePolicy(setId, pId); + } catch (Exception e11) { + } + sendResponse(ERROR, BAD_CONFIGURATION_VAL, null, resp); + return; } - // conConfig.putString("params." + name, req.getParameter(name)); + // conConfig.putString("params." + name, + // req.getParameter(name)); } try { profile.getConfigStore().commit(false); } catch (Exception e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1402,10 +1326,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1413,47 +1335,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Modify default policy profile configuration *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void modifyPolicyDefaultConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1475,16 +1395,14 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); sendResponse(ERROR, null, null, resp); return; - } + } StringTokenizer ss = new StringTokenizer(policyId, ":"); String setId = ss.nextToken(); @@ -1492,7 +1410,7 @@ public class ProfileAdminServlet extends AdminServlet { IProfilePolicy policy = profile.getProfilePolicy(setId, pId); IPolicyDefault def = policy.getDefault(); IConfigStore defConfig = def.getConfigStore(); - + Enumeration names = req.getParameterNames(); while (names.hasMoreElements()) { @@ -1505,25 +1423,24 @@ public class ProfileAdminServlet extends AdminServlet { if (name.equals("RS_ID")) continue; try { - def.setConfig(name,req.getParameter(name)); + def.setConfig(name, req.getParameter(name)); } catch (EPropertyException e) { - CMS.debug("ProfileAdminServlet: modifyPolicyDefConfig setConfig exception."); - sendResponse(ERROR,BAD_CONFIGURATION_VAL,null,resp); - return; + CMS.debug("ProfileAdminServlet: modifyPolicyDefConfig setConfig exception."); + sendResponse(ERROR, BAD_CONFIGURATION_VAL, null, resp); + return; } - // defConfig.putString("params." + name, req.getParameter(name)); + // defConfig.putString("params." + name, + // req.getParameter(name)); } try { profile.getConfigStore().commit(false); } catch (Exception e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1534,10 +1451,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1545,47 +1460,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Modify profile input configuration *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void modifyInputConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1607,10 +1520,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1639,10 +1550,8 @@ public class ProfileAdminServlet extends AdminServlet { } catch (Exception e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1653,10 +1562,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1664,47 +1571,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Modify profile output configuration *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void modifyOutputConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1726,10 +1631,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1751,18 +1654,16 @@ public class ProfileAdminServlet extends AdminServlet { continue; if (name.equals("RS_ID")) continue; - outputConfig.putString("params." + name, - req.getParameter(name)); + outputConfig + .putString("params." + name, req.getParameter(name)); } try { profile.getConfigStore().commit(false); } catch (Exception e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1773,10 +1674,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1784,47 +1683,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Modify policy constraints profile configuration *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void modifyPolicyConstraintConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -1846,16 +1743,14 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); sendResponse(ERROR, null, null, resp); return; - } + } StringTokenizer ss = new StringTokenizer(policyId, ":"); String setId = ss.nextToken(); @@ -1866,7 +1761,8 @@ public class ProfileAdminServlet extends AdminServlet { Enumeration names = req.getParameterNames(); - CMS.debug("ProfileAdminServlet: modifyPolicyConstraintConfig policy " + policy + " con " + con); + CMS.debug("ProfileAdminServlet: modifyPolicyConstraintConfig policy " + + policy + " con " + con); while (names.hasMoreElements()) { String name = (String) names.nextElement(); @@ -1877,27 +1773,27 @@ public class ProfileAdminServlet extends AdminServlet { if (name.equals("RS_ID")) continue; - // CMS.debug("ProfileAdminServlet: modifyPolicyConstraintConfig name" + name + " val " + req.getParameter(name)); + // CMS.debug("ProfileAdminServlet: modifyPolicyConstraintConfig name" + // + name + " val " + req.getParameter(name)); try { - con.setConfig(name,req.getParameter(name)); + con.setConfig(name, req.getParameter(name)); } catch (EPropertyException e) { - CMS.debug("ProfileAdminServlet: modifyPolicyConstraintsConfig setConfig exception."); - sendResponse(ERROR,BAD_CONFIGURATION_VAL,null,resp); - return; + CMS.debug("ProfileAdminServlet: modifyPolicyConstraintsConfig setConfig exception."); + sendResponse(ERROR, BAD_CONFIGURATION_VAL, null, resp); + return; } - //conConfig.putString("params." + name, req.getParameter(name)); + // conConfig.putString("params." + name, + // req.getParameter(name)); } try { profile.getConfigStore().commit(false); } catch (Exception e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -1909,10 +1805,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -1920,33 +1814,30 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } public void getPolicyDefaultConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); StringTokenizer st = new StringTokenizer(id, ";"); @@ -1958,9 +1849,9 @@ public class ProfileAdminServlet extends AdminServlet { try { profile = mProfileSub.getProfile(profileId); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getPolicyDefaultConfig() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getPolicyDefaultConfig() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } IProfilePolicy policy = null; @@ -1983,22 +1874,26 @@ public class ProfileAdminServlet extends AdminServlet { if (desc == null) { nvp.add(name, ";" + ";" + rule.getConfig(name)); } else { - nvp.add(name, desc.getSyntax() + ";" + ";" + getNonNull(desc.getConstraint()) + ";" + desc.getDescription(getLocale(req)) + ";" + rule.getConfig(name)); + nvp.add(name, + desc.getSyntax() + ";" + ";" + + getNonNull(desc.getConstraint()) + ";" + + desc.getDescription(getLocale(req)) + ";" + + rule.getConfig(name)); } } sendResponse(SUCCESS, null, nvp, resp); } public void getPolicyConstraintConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); - String constraintsList = req.getParameter(Constants.PR_CONSTRAINTS_LIST); + String constraintsList = req + .getParameter(Constants.PR_CONSTRAINTS_LIST); // this one gets called when one of the elements in the default list get // selected, then it returns the list of supported constraintsPolicy if (constraintsList != null) { - + } StringTokenizer st = new StringTokenizer(id, ";"); @@ -2010,9 +1905,9 @@ public class ProfileAdminServlet extends AdminServlet { try { profile = mProfileSub.getProfile(profileId); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getPolicyConstraintConfig() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getPolicyConstraintConfig() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } StringTokenizer ss = new StringTokenizer(policyId, ":"); @@ -2031,15 +1926,18 @@ public class ProfileAdminServlet extends AdminServlet { if (desc == null) { nvp.add(name, ";" + rule.getConfig(name)); } else { - nvp.add(name, desc.getSyntax() + ";" + getNonNull(desc.getConstraint()) + ";" + desc.getDescription(getLocale(req)) + ";" + rule.getConfig(name)); + nvp.add(name, + desc.getSyntax() + ";" + + getNonNull(desc.getConstraint()) + ";" + + desc.getDescription(getLocale(req)) + ";" + + rule.getConfig(name)); } } sendResponse(SUCCESS, null, nvp, resp); } public void getProfilePolicy(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); // only allow profile retrival if it is disabled @@ -2049,9 +1947,9 @@ public class ProfileAdminServlet extends AdminServlet { try { profile = mProfileSub.getProfile(id); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getProfilePolicy() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getProfilePolicy() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } NameValuePairs nvp = new NameValuePairs(); @@ -2073,9 +1971,9 @@ public class ProfileAdminServlet extends AdminServlet { IPolicyConstraint con = policy.getConstraint(); IConfigStore conConfig = con.getConfigStore(); - nvp.add(setId + ":" + policy.getId(), - def.getName(getLocale(req)) + ";" + - con.getName(getLocale(req))); + nvp.add(setId + ":" + policy.getId(), + def.getName(getLocale(req)) + ";" + + con.getName(getLocale(req))); } } @@ -2083,17 +1981,16 @@ public class ProfileAdminServlet extends AdminServlet { } public void getProfileOutput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); IProfile profile = null; try { profile = mProfileSub.getProfile(id); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getProfileOutput() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getProfileOutput() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } NameValuePairs nvp = new NameValuePairs(); @@ -2109,18 +2006,17 @@ public class ProfileAdminServlet extends AdminServlet { sendResponse(SUCCESS, null, nvp, resp); } - public void getProfileInput(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + public void getProfileInput(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); IProfile profile = null; try { profile = mProfileSub.getProfile(id); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getProfileInput() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getProfileInput() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } NameValuePairs nvp = new NameValuePairs(); @@ -2136,10 +2032,9 @@ public class ProfileAdminServlet extends AdminServlet { sendResponse(SUCCESS, null, nvp, resp); } - public void getInputConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { - + public void getInputConfig(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + String id = req.getParameter(Constants.RS_ID); StringTokenizer st = new StringTokenizer(id, ";"); String profileId = st.nextToken(); @@ -2149,9 +2044,9 @@ public class ProfileAdminServlet extends AdminServlet { try { profile = mProfileSub.getProfile(profileId); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getInputConfig() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getInputConfig() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } IProfileInput profileInput = null; @@ -2162,24 +2057,24 @@ public class ProfileAdminServlet extends AdminServlet { while (names.hasMoreElements()) { String name = (String) names.nextElement(); - IDescriptor desc = profileInput.getConfigDescriptor( - getLocale(req), name); + IDescriptor desc = profileInput.getConfigDescriptor(getLocale(req), + name); if (desc == null) { nvp.add(name, ";" + ";" + profileInput.getConfig(name)); } else { - nvp.add(name, desc.getSyntax() + ";" + - getNonNull(desc.getConstraint()) + ";" + - desc.getDescription(getLocale(req)) + ";" + - profileInput.getConfig(name)); + nvp.add(name, + desc.getSyntax() + ";" + + getNonNull(desc.getConstraint()) + ";" + + desc.getDescription(getLocale(req)) + ";" + + profileInput.getConfig(name)); } } sendResponse(SUCCESS, null, nvp, resp); } - public void getOutputConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + public void getOutputConfig(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); StringTokenizer st = new StringTokenizer(id, ";"); @@ -2190,9 +2085,9 @@ public class ProfileAdminServlet extends AdminServlet { try { profile = mProfileSub.getProfile(profileId); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getOutputConfig() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getOutputConfig() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } IProfileOutput profileOutput = null; @@ -2204,14 +2099,15 @@ public class ProfileAdminServlet extends AdminServlet { while (names.hasMoreElements()) { String name = (String) names.nextElement(); IDescriptor desc = profileOutput.getConfigDescriptor( - getLocale(req), name); + getLocale(req), name); if (desc == null) { nvp.add(name, ";" + ";" + profileOutput.getConfig(name)); } else { - nvp.add(name, desc.getSyntax() + ";" + - getNonNull(desc.getConstraint()) + ";" + - desc.getDescription(getLocale(req)) + ";" + - profileOutput.getConfig(name)); + nvp.add(name, + desc.getSyntax() + ";" + + getNonNull(desc.getConstraint()) + ";" + + desc.getDescription(getLocale(req)) + ";" + + profileOutput.getConfig(name)); } } @@ -2219,8 +2115,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void listProfileInstances(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { NameValuePairs nvp = new NameValuePairs(); Enumeration e = mProfileSub.getProfileIds(); @@ -2234,7 +2129,7 @@ public class ProfileAdminServlet extends AdminServlet { } catch (EBaseException e1) { // error } - + String status = null; if (mProfileSub.isProfileEnable(profileId)) { @@ -2250,8 +2145,7 @@ public class ProfileAdminServlet extends AdminServlet { } public void getProfileInstanceConfig(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String id = req.getParameter(Constants.RS_ID); IProfile profile = null; @@ -2259,9 +2153,9 @@ public class ProfileAdminServlet extends AdminServlet { try { profile = mProfileSub.getProfile(id); } catch (EBaseException e1) { - CMS.debug( "ProfileAdminServlet::getProfileInstanceConfig() - " + - "profile is null!" ); - throw new ServletException( e1.toString() ); + CMS.debug("ProfileAdminServlet::getProfileInstanceConfig() - " + + "profile is null!"); + throw new ServletException(e1.toString()); } NameValuePairs nvp = new NameValuePairs(); @@ -2269,8 +2163,7 @@ public class ProfileAdminServlet extends AdminServlet { nvp.add("name", profile.getName(getLocale(req))); nvp.add("desc", profile.getDescription(getLocale(req))); nvp.add("visible", Boolean.toString(profile.isVisible())); - nvp.add("enable", Boolean.toString( - mProfileSub.isProfileEnable(id))); + nvp.add("enable", Boolean.toString(mProfileSub.isProfileEnable(id))); String authid = profile.getAuthenticatorId(); @@ -2288,20 +2181,20 @@ public class ProfileAdminServlet extends AdminServlet { /** * Delete profile instance *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void deleteProfileInstance(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -2314,10 +2207,8 @@ public class ProfileAdminServlet extends AdminServlet { if (id == null) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -2327,51 +2218,47 @@ public class ProfileAdminServlet extends AdminServlet { String config = null; - ISubsystem subsystem = CMS.getSubsystem("ca"); + ISubsystem subsystem = CMS.getSubsystem("ca"); String subname = "ca"; - if (subsystem == null) - subname = "ra"; + if (subsystem == null) + subname = "ra"; try { - config = CMS.getConfigStore().getString("instanceRoot") + - "/profiles/" + subname + "/" + id + ".cfg"; + config = CMS.getConfigStore().getString("instanceRoot") + + "/profiles/" + subname + "/" + id + ".cfg"; } catch (EBaseException e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); sendResponse(ERROR, null, null, resp); return; } - + try { mProfileSub.deleteProfile(id, config); } catch (EProfileException e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); - sendResponse(ERROR, CMS.getUserMessage(getLocale(req), e.toString(), id), null, resp); + sendResponse(ERROR, + CMS.getUserMessage(getLocale(req), e.toString(), id), + null, resp); return; } // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -2379,32 +2266,29 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } - public void - putUserPWPair(String combo) { + public void putUserPWPair(String combo) { int semicolon; semicolon = combo.indexOf(";"); @@ -2414,12 +2298,11 @@ public class ProfileAdminServlet extends AdminServlet { CMS.putPasswordCache(user, pw); } - public boolean isValidId(String id) - { + public boolean isValidId(String id) { for (int i = 0; i < id.length(); i++) { - char c = id.charAt(i); - if (!Character.isLetterOrDigit(c)) - return false; + char c = id.charAt(i); + if (!Character.isLetterOrDigit(c)) + return false; } return true; } @@ -2427,20 +2310,20 @@ public class ProfileAdminServlet extends AdminServlet { /** * Add profile instance *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void addProfileInstance(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -2453,10 +2336,8 @@ public class ProfileAdminServlet extends AdminServlet { if (id == null || id.trim().equals("") || !isValidId(id)) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -2468,14 +2349,14 @@ public class ProfileAdminServlet extends AdminServlet { IProfile p = null; try { - p = mProfileSub.getProfile(id); + p = mProfileSub.getProfile(id); } catch (EProfileException e1) { } if (p != null) { sendResponse(ERROR, POLICY_INST_ID_ALREADY_USED, null, resp); return; } - + String impl = req.getParameter("impl"); String name = req.getParameter("name"); String desc = req.getParameter("desc"); @@ -2490,14 +2371,13 @@ public class ProfileAdminServlet extends AdminServlet { subname = "ra"; try { - config = CMS.getConfigStore().getString("instanceRoot") + "/profiles/" + subname + "/" + id + ".cfg"; + config = CMS.getConfigStore().getString("instanceRoot") + + "/profiles/" + subname + "/" + id + ".cfg"; } catch (EBaseException e) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -2517,10 +2397,9 @@ public class ProfileAdminServlet extends AdminServlet { // create profile try { profile = mProfileSub.createProfile(id, impl, - info.getClassName(), - config); - profile.setName(getLocale(req), name); - profile.setDescription(getLocale(req), name); + info.getClassName(), config); + profile.setName(getLocale(req), name); + profile.setDescription(getLocale(req), name); if (visible != null && visible.equals("true")) { profile.setVisible(true); } else { @@ -2531,19 +2410,17 @@ public class ProfileAdminServlet extends AdminServlet { mProfileSub.createProfileConfig(id, impl, config); if (profile instanceof IProfileEx) { - // populates profile specific plugins such as - // policies, inputs and outputs - ((IProfileEx)profile).populate(); - } + // populates profile specific plugins such as + // policies, inputs and outputs + ((IProfileEx) profile).populate(); + } } catch (Exception e) { CMS.debug("ProfileAdminServlet: " + e.toString()); // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -2553,10 +2430,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); @@ -2564,47 +2439,45 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } /** * Modify profile instance *

- * + * *

+ * * @param req HTTP servlet request * @param resp HTTP servlet response * @exception ServletException a servlet error has occurred * @exception IOException an input/output error has occurred */ public void modifyProfileInstance(HttpServletRequest req, - HttpServletResponse resp) - throws ServletException, IOException { + HttpServletResponse resp) throws ServletException, IOException { String auditMessage = null; String auditSubjectID = auditSubjectID(); @@ -2623,10 +2496,8 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + auditSubjectID, ILogger.FAILURE, auditParams(req)); audit(auditMessage); @@ -2651,15 +2522,13 @@ public class ProfileAdminServlet extends AdminServlet { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.SUCCESS, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.SUCCESS, auditParams(req)); audit(auditMessage); try { - profile.getConfigStore().commit(false); + profile.getConfigStore().commit(false); } catch (Exception e) { } @@ -2667,35 +2536,32 @@ public class ProfileAdminServlet extends AdminServlet { } catch (IOException eAudit1) { // store a message in the signed audit log file auditMessage = CMS.getLogMessage( - LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - auditSubjectID, - ILogger.FAILURE, - auditParams(req)); + LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, auditSubjectID, + ILogger.FAILURE, auditParams(req)); audit(auditMessage); // rethrow the specific exception to be handled later throw eAudit1; // } catch( ServletException eAudit2 ) { - // // store a message in the signed audit log file - // auditMessage = CMS.getLogMessage( - // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, - // auditSubjectID, - // ILogger.FAILURE, - // auditParams( req ) ); + // // store a message in the signed audit log file + // auditMessage = CMS.getLogMessage( + // LOGGING_SIGNED_AUDIT_CONFIG_CERT_PROFILE, + // auditSubjectID, + // ILogger.FAILURE, + // auditParams( req ) ); // - // audit( auditMessage ); + // audit( auditMessage ); // - // // rethrow the specific exception to be handled later - // throw eAudit2; + // // rethrow the specific exception to be handled later + // throw eAudit2; } } - protected String getNonNull(String s) { - if (s == null) - return ""; - return s; - } + protected String getNonNull(String s) { + if (s == null) + return ""; + return s; + } } - -- cgit