com.netscape.cms.servlet.admin
Class ProfileAdminServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.netscape.cms.servlet.admin.AdminServlet
              extended by com.netscape.cms.servlet.admin.ProfileAdminServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ProfileAdminServlet
extends AdminServlet

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.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
Serialized Form

Field Summary
static java.lang.String BAD_CONFIGURATION_VAL
           
static java.lang.String COMMA
           
static java.lang.String INVALID_POLICY_IMPL_CONFIG
           
static java.lang.String INVALID_POLICY_IMPL_ID
           
static java.lang.String INVALID_POLICY_IMPL_OP
           
static java.lang.String INVALID_POLICY_INST_ID
           
static java.lang.String INVALID_POLICY_INSTANCE_CONFIG
           
static java.lang.String INVALID_POLICY_SCOPE
           
static java.lang.String MISSING_POLICY_IMPL_CLASS
           
static java.lang.String MISSING_POLICY_IMPL_ID
           
static java.lang.String MISSING_POLICY_INST_ID
           
static java.lang.String MISSING_POLICY_ORDERING
           
static java.lang.String NYI
           
static java.lang.String POLICY_INST_ID_ALREADY_USED
           
static java.lang.String PROP_AUTHORITY
           
static java.lang.String PROP_PREDICATE
           
 
Fields inherited from class com.netscape.cms.servlet.admin.AdminServlet
AUTHZ_CONFIG_STORE, AUTHZ_MGR_BASIC, AUTHZ_MGR_LDAP, AUTHZ_RES_NAME, AUTHZ_SRC_LDAP, AUTHZ_SRC_TYPE, AUTHZ_SRC_XML, CERT_ATTR, ERROR, mAclMethod, mAuthz, mConfig, mLogger, mOp, mSignedAuditLogger, mToken, PROP_ACL, PROP_AUTHZ_MGR, PROP_ID, RESTART, SIGNED_AUDIT_EMPTY_NAME_VALUE_PAIR, SIGNED_AUDIT_NAME_VALUE_DELIMITER, SIGNED_AUDIT_NAME_VALUE_PAIRS_DELIMITER, SIGNED_AUDIT_OPERATION, SIGNED_AUDIT_PASSWORD_VALUE, SIGNED_AUDIT_RESOURCE, SIGNED_AUDIT_RULENAME, SIGNED_AUDIT_SCOPE, SUCCESS
 
Constructor Summary
ProfileAdminServlet()
          Constructs administration servlet.
 
Method Summary
 void addPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Add policy constraints profile configuration
 void addPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Add default policy profile configuration
 void addProfileInput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Add profile input
 void addProfileInstance(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Add profile instance
 void addProfileOutput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Add profile output
 void addProfilePolicy(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Add policy profile
 void deleteProfileInput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Delete profile input
 void deleteProfileInstance(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Delete profile instance
 void deleteProfileOutput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Delete profile output
 void deleteProfilePolicy(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Delete policy profile
 void getInputConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  java.lang.String getNonNull(java.lang.String s)
           
 void getOutputConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void getPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void getPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void getProfileInput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void getProfileInstanceConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void getProfileOutput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void getProfilePolicy(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 java.lang.String getServletInfo()
          Returns serlvet information.
 void init(javax.servlet.ServletConfig config)
          Initializes this servlet.
 boolean isValidId(java.lang.String id)
           
 void listProfileImpls(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Lists all registered profile impementations
 void listProfileInstances(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void modifyInputConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Modify profile input configuration
 void modifyOutputConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Modify profile output configuration
 void modifyPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Modify policy constraints profile configuration
 void modifyPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Modify default policy profile configuration
 void modifyProfileInstance(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Modify profile instance
 void processPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processPolicyImplMgmt(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Process Policy Implementation Management.
 void processProfileInput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processProfileInputConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processProfileOutput(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processProfileOutputConfig(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processProfilePolicy(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void processProfileRuleMgmt(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void putUserPWPair(java.lang.String combo)
           
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Serves HTTP admin request.
 
Methods inherited from class com.netscape.cms.servlet.admin.AdminServlet
audit, auditParams, auditSubjectID, authenticate, authorize, authorize, commit, convertStringArrayToNVPairs, getAuthCreds, getClassByNameAsExtendedPluginInfo, getConfig, getLocale, getParameter, listConfig, outputHttpParameters, sendResponse, setConfig, URLdecode
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_AUTHORITY

public static final java.lang.String PROP_AUTHORITY
See Also:
Constant Field Values

PROP_PREDICATE

public static final java.lang.String PROP_PREDICATE
See Also:
Constant Field Values

INVALID_POLICY_SCOPE

public static java.lang.String INVALID_POLICY_SCOPE

INVALID_POLICY_IMPL_OP

public static java.lang.String INVALID_POLICY_IMPL_OP

NYI

public static java.lang.String NYI

INVALID_POLICY_IMPL_CONFIG

public static java.lang.String INVALID_POLICY_IMPL_CONFIG

INVALID_POLICY_INSTANCE_CONFIG

public static java.lang.String INVALID_POLICY_INSTANCE_CONFIG

MISSING_POLICY_IMPL_ID

public static java.lang.String MISSING_POLICY_IMPL_ID

MISSING_POLICY_IMPL_CLASS

public static java.lang.String MISSING_POLICY_IMPL_CLASS

INVALID_POLICY_IMPL_ID

public static java.lang.String INVALID_POLICY_IMPL_ID

MISSING_POLICY_INST_ID

public static java.lang.String MISSING_POLICY_INST_ID

POLICY_INST_ID_ALREADY_USED

public static java.lang.String POLICY_INST_ID_ALREADY_USED

INVALID_POLICY_INST_ID

public static java.lang.String INVALID_POLICY_INST_ID

COMMA

public static java.lang.String COMMA

MISSING_POLICY_ORDERING

public static java.lang.String MISSING_POLICY_ORDERING

BAD_CONFIGURATION_VAL

public static java.lang.String BAD_CONFIGURATION_VAL
Constructor Detail

ProfileAdminServlet

public ProfileAdminServlet()
Constructs administration servlet.

Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes this servlet.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class AdminServlet
Throws:
javax.servlet.ServletException

getServletInfo

public java.lang.String getServletInfo()
Returns serlvet information.

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse resp)
             throws javax.servlet.ServletException,
                    java.io.IOException
Serves HTTP admin request.

Overrides:
service in class AdminServlet
Throws:
javax.servlet.ServletException
java.io.IOException

processProfilePolicy

public void processProfilePolicy(javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse resp)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processProfileInput

public void processProfileInput(javax.servlet.http.HttpServletRequest req,
                                javax.servlet.http.HttpServletResponse resp)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processProfileOutput

public void processProfileOutput(javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse resp)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processProfileInputConfig

public void processProfileInputConfig(javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse resp)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processProfileOutputConfig

public void processProfileOutputConfig(javax.servlet.http.HttpServletRequest req,
                                       javax.servlet.http.HttpServletResponse resp)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processPolicyDefaultConfig

public void processPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req,
                                       javax.servlet.http.HttpServletResponse resp)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processPolicyConstraintConfig

public void processPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse resp)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

processPolicyImplMgmt

public void processPolicyImplMgmt(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse resp)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Process Policy Implementation Management.

Throws:
javax.servlet.ServletException
java.io.IOException

processProfileRuleMgmt

public void processProfileRuleMgmt(javax.servlet.http.HttpServletRequest req,
                                   javax.servlet.http.HttpServletResponse resp)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

listProfileImpls

public void listProfileImpls(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Lists all registered profile impementations

Throws:
javax.servlet.ServletException
java.io.IOException

addProfilePolicy

public void addProfilePolicy(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Add policy profile

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

addProfileInput

public void addProfileInput(javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse resp)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Add profile input

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

addProfileOutput

public void addProfileOutput(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Add profile output

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

deleteProfilePolicy

public void deleteProfilePolicy(javax.servlet.http.HttpServletRequest req,
                                javax.servlet.http.HttpServletResponse resp)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Delete policy profile

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

deleteProfileInput

public void deleteProfileInput(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse resp)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Delete profile input

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

deleteProfileOutput

public void deleteProfileOutput(javax.servlet.http.HttpServletRequest req,
                                javax.servlet.http.HttpServletResponse resp)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Delete profile output

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

addPolicyDefaultConfig

public void addPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req,
                                   javax.servlet.http.HttpServletResponse resp)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Add default policy profile configuration

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

addPolicyConstraintConfig

public void addPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse resp)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Add policy constraints profile configuration

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

modifyPolicyDefaultConfig

public void modifyPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse resp)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Modify default policy profile configuration

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

modifyInputConfig

public void modifyInputConfig(javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse resp)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Modify profile input configuration

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

modifyOutputConfig

public void modifyOutputConfig(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse resp)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Modify profile output configuration

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

modifyPolicyConstraintConfig

public void modifyPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req,
                                         javax.servlet.http.HttpServletResponse resp)
                                  throws javax.servlet.ServletException,
                                         java.io.IOException
Modify policy constraints profile configuration

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

getPolicyDefaultConfig

public void getPolicyDefaultConfig(javax.servlet.http.HttpServletRequest req,
                                   javax.servlet.http.HttpServletResponse resp)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getPolicyConstraintConfig

public void getPolicyConstraintConfig(javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse resp)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getProfilePolicy

public void getProfilePolicy(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getProfileOutput

public void getProfileOutput(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getProfileInput

public void getProfileInput(javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse resp)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getInputConfig

public void getInputConfig(javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse resp)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getOutputConfig

public void getOutputConfig(javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse resp)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

listProfileInstances

public void listProfileInstances(javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse resp)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getProfileInstanceConfig

public void getProfileInstanceConfig(javax.servlet.http.HttpServletRequest req,
                                     javax.servlet.http.HttpServletResponse resp)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

deleteProfileInstance

public void deleteProfileInstance(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse resp)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Delete profile instance

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

putUserPWPair

public void putUserPWPair(java.lang.String combo)

isValidId

public boolean isValidId(java.lang.String id)

addProfileInstance

public void addProfileInstance(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse resp)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Add profile instance

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

modifyProfileInstance

public void modifyProfileInstance(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse resp)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Modify profile instance

Parameters:
req - HTTP servlet request
resp - HTTP servlet response
Throws:
javax.servlet.ServletException - a servlet error has occurred
java.io.IOException - an input/output error has occurred

getNonNull

protected java.lang.String getNonNull(java.lang.String s)