Class Profile

  • Direct Known Subclasses:
    EnrollProfile

    public abstract class Profile
    extends java.lang.Object
    This class implements a basic profile. A profile contains a list of input policies, default policies, constraint policies and output policies.

    The input policy is for building the enrollment page.

    The default policy is for populating user-supplied and system-supplied values into the request.

    The constraint policy is for validating the request before processing.

    The output policy is for building the result page.

    Each profile can have multiple policy set. Each set is composed of zero or more default policies and zero or more constraint policies.

    • Constructor Summary

      Constructors 
      Constructor Description
      Profile()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addInputName​(java.lang.String name)  
      protected java.lang.String auditSubjectID()
      Signed Audit Log Subject ID This method is used to obtain the "SubjectID" for a signed audit log message.
      ProfileInput createProfileInput​(java.lang.String id, java.lang.String inputID, com.netscape.certsrv.common.NameValuePairs nvps)
      Creates a input policy.
      ProfileInput createProfileInput​(java.lang.String id, java.lang.String inputId, com.netscape.certsrv.common.NameValuePairs nvps, boolean createConfig)  
      ProfileOutput createProfileOutput​(java.lang.String id, java.lang.String outputID, com.netscape.certsrv.common.NameValuePairs nvps)
      Creates a output policy.
      ProfileOutput createProfileOutput​(java.lang.String id, java.lang.String outputId, com.netscape.certsrv.common.NameValuePairs nvps, boolean createConfig)  
      ProfilePolicy createProfilePolicy​(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId)
      Creates a profile policy.
      ProfilePolicy createProfilePolicy​(java.lang.String setId, java.lang.String id, java.lang.String defaultClassId, java.lang.String constraintClassId, boolean createConfig)  
      abstract com.netscape.certsrv.request.IRequest[] createRequests​(java.util.Map<java.lang.String,​java.lang.String> ctx, java.util.Locale locale)
      Creates one or more requests.
      void deleteAllProfileInputs()
      Delete all profile inputs
      void deleteAllProfileOutputs()
      Delete all profile inputs
      void deleteAllProfilePolicies()
      Delete all profile policies
      void deleteProfileInput​(java.lang.String inputId)
      Deletes input policy by id.
      void deleteProfileOutput​(java.lang.String outputId)
      Deletes output policy by id.
      void deleteProfilePolicy​(java.lang.String setId, java.lang.String policyId)
      Deletes a policy.
      void execute​(com.netscape.certsrv.request.IRequest request)
      Process a request after validation.
      java.lang.String getApprovedBy()
      Retrieves the user id of the person who approves this profile.
      java.lang.String getAuthenticatorId()
      Retrieves the instance id of the authenticator for this profile.
      java.lang.String getAuthzAcl()  
      IConfigStore getConfigStore()
      Retrieves the configuration store of this profile.
      java.lang.String getDescription​(java.util.Locale locale)
      Returns the profile description.
      java.lang.String getId()
      Returns the identifier of this profile.
      java.lang.String getInput​(java.lang.String name, java.util.Locale locale, com.netscape.certsrv.request.IRequest request)  
      com.netscape.certsrv.property.IDescriptor getInputDescriptor​(java.lang.String name)  
      java.util.Enumeration<java.lang.String> getInputNames()  
      java.lang.String getName​(java.util.Locale locale)
      Returns the profile name.
      java.util.Vector<ProfilePolicy> getPolicies​(java.lang.String setId)  
      abstract java.lang.String getPolicySetId​(com.netscape.certsrv.request.IRequest req)
      Retrieves a default set id for the given request.
      ProfileInput getProfileInput​(java.lang.String id)
      Retrieves input policy by id.
      java.util.Enumeration<java.lang.String> getProfileInputIds()
      Retrieves a list of input policy IDs.
      ProfileOutput getProfileOutput​(java.lang.String id)
      Retrieves output policy by id.
      java.util.Enumeration<java.lang.String> getProfileOutputIds()
      Retrieves a list of output policy IDs.
      java.util.Enumeration<ProfilePolicy> getProfilePolicies​(java.lang.String setId)
      Returns a list of profile policies.
      ProfilePolicy getProfilePolicy​(java.lang.String setId, java.lang.String id)
      Retrieves a policy.
      java.util.Enumeration<java.lang.String> getProfilePolicyIds​(java.lang.String setId)
      Retrieves all the policy id within a set.
      java.util.Enumeration<java.lang.String> getProfilePolicySetIds()
      Returns the profile policy set identifiers.
      IProfileUpdater getProfileUpdater​(java.lang.String name)  
      java.util.Enumeration<java.lang.String> getProfileUpdaterIds()  
      java.lang.String getRequestorDN​(com.netscape.certsrv.request.IRequest request)
      Retrieves a localized string that represents requestor's distinguished name.
      abstract com.netscape.certsrv.request.IRequestQueue getRequestQueue()
      Retrieves the request queue that is associated with this profile.
      void init​(IConfigStore config)
      Initializes this profile.
      boolean isEnable()  
      java.lang.String isRenewal()
      Is this a renewal profile
      boolean isVisible()
      Checks if this profile is end-user profile or not.
      java.lang.String isXmlOutput()
      is output going to be in xml?
      void populate​(com.netscape.certsrv.request.IRequest request)
      Passes the request to the set of default policies that populate the profile information against the profile.
      void populateInput​(java.util.Map<java.lang.String,​java.lang.String> ctx, com.netscape.certsrv.request.IRequest request)
      Populates user-supplied input values into the requests.
      void setAuthenticatorId​(java.lang.String id)
      Sets the instance id of the authenticator for this profile.
      void setAuthzAcl​(java.lang.String id)  
      void setDescription​(java.util.Locale locale, java.lang.String desc)
      Returns the profile description.
      void setId​(java.lang.String id)
      Sets id of this profile.
      void setInput​(java.lang.String name, java.util.Locale locale, com.netscape.certsrv.request.IRequest request, java.lang.String value)  
      void setName​(java.util.Locale locale, java.lang.String name)
      Returns the profile name.
      void setRenewal​(boolean renewal)  
      void setVisible​(boolean v)
      Sets this profile end-user profile or not.
      void setXMLOutput​(boolean xmlOutput)  
      abstract void submit​(com.netscape.certsrv.authentication.IAuthToken token, com.netscape.certsrv.request.IRequest request)
      Handles end-user request submission.
      void validate​(com.netscape.certsrv.request.IRequest request)
      Passes the request to the set of constraint policies that validate the request against the profile.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • signedAuditLogger

        protected static Logger signedAuditLogger
      • PROP_OUTPUT_LIST

        public static final java.lang.String PROP_OUTPUT_LIST
        See Also:
        Constant Field Values
      • PROP_UPDATER_LIST

        public static final java.lang.String PROP_UPDATER_LIST
        See Also:
        Constant Field Values
      • PROP_POLICY_LIST

        public static final java.lang.String PROP_POLICY_LIST
        See Also:
        Constant Field Values
      • PROP_INSTANCE_ID

        public static final java.lang.String PROP_INSTANCE_ID
        See Also:
        Constant Field Values
      • PROP_NO_CONSTRAINT

        public static final java.lang.String PROP_NO_CONSTRAINT
        See Also:
        Constant Field Values
      • PROP_GENERIC_EXT_DEFAULT

        public static final java.lang.String PROP_GENERIC_EXT_DEFAULT
        See Also:
        Constant Field Values
      • mInputNames

        protected java.util.Vector<java.lang.String> mInputNames
      • mInputs

        protected java.util.Hashtable<java.lang.String,​ProfileInput> mInputs
      • mInputIds

        protected java.util.Vector<java.lang.String> mInputIds
      • mOutputs

        protected java.util.Hashtable<java.lang.String,​ProfileOutput> mOutputs
      • mOutputIds

        protected java.util.Vector<java.lang.String> mOutputIds
      • mUpdaters

        protected java.util.Hashtable<java.lang.String,​IProfileUpdater> mUpdaters
      • mUpdaterIds

        protected java.util.Vector<java.lang.String> mUpdaterIds
      • mAuthInstanceId

        protected java.lang.String mAuthInstanceId
      • mId

        protected java.lang.String mId
      • mAuthzAcl

        protected java.lang.String mAuthzAcl
      • mPolicySet

        protected java.util.Hashtable<java.lang.String,​java.util.Vector<ProfilePolicy>> mPolicySet
    • Constructor Detail

      • Profile

        public Profile()
    • Method Detail

      • isEnable

        public boolean isEnable()
      • isRenewal

        public java.lang.String isRenewal()
        Is this a renewal profile
      • setRenewal

        public void setRenewal​(boolean renewal)
      • isXmlOutput

        public java.lang.String isXmlOutput()
        is output going to be in xml?
      • setXMLOutput

        public void setXMLOutput​(boolean xmlOutput)
      • getApprovedBy

        public java.lang.String getApprovedBy()
        Retrieves the user id of the person who approves this profile.
        Returns:
        user id of the approver of this profile
      • setId

        public void setId​(java.lang.String id)
        Sets id of this profile.
        Parameters:
        id - profile identifier
      • getId

        public java.lang.String getId()
        Returns the identifier of this profile.
        Returns:
        profile id
      • getRequestorDN

        public java.lang.String getRequestorDN​(com.netscape.certsrv.request.IRequest request)
        Retrieves a localized string that represents requestor's distinguished name. This string displayed in the request listing user interface.
        Parameters:
        request - request
        Returns:
        distringuished name of the request owner
      • getAuthenticatorId

        public java.lang.String getAuthenticatorId()
        Retrieves the instance id of the authenticator for this profile.
        Returns:
        authenticator instance id
      • setAuthenticatorId

        public void setAuthenticatorId​(java.lang.String id)
        Sets the instance id of the authenticator for this profile.
        Parameters:
        id - authenticator instance id
      • setAuthzAcl

        public void setAuthzAcl​(java.lang.String id)
      • getAuthzAcl

        public java.lang.String getAuthzAcl()
      • init

        public void init​(IConfigStore config)
                  throws EBaseException
        Initializes this profile.
        Parameters:
        config - configuration store for this profile
        Throws:
        EBaseException - failed to initialize
      • getRequestQueue

        public abstract com.netscape.certsrv.request.IRequestQueue getRequestQueue()
        Retrieves the request queue that is associated with this profile. The request queue is for creating new requests.
        Returns:
        request queue
      • getConfigStore

        public IConfigStore getConfigStore()
        Retrieves the configuration store of this profile.
        Returns:
        configuration store
      • getInputNames

        public java.util.Enumeration<java.lang.String> getInputNames()
      • getProfileUpdaterIds

        public java.util.Enumeration<java.lang.String> getProfileUpdaterIds()
      • getProfileUpdater

        public IProfileUpdater getProfileUpdater​(java.lang.String name)
      • getProfileOutputIds

        public java.util.Enumeration<java.lang.String> getProfileOutputIds()
        Retrieves a list of output policy IDs.
        Returns:
        output policy id list
      • getProfileOutput

        public ProfileOutput getProfileOutput​(java.lang.String id)
        Retrieves output policy by id.
        Parameters:
        id - output policy id
        Returns:
        output policy instance
      • getProfileInputIds

        public java.util.Enumeration<java.lang.String> getProfileInputIds()
        Retrieves a list of input policy IDs.
        Returns:
        input policy id list
      • getProfileInput

        public ProfileInput getProfileInput​(java.lang.String id)
        Retrieves input policy by id.
        Parameters:
        id - input policy id
        Returns:
        input policy instance
      • addInputName

        public void addInputName​(java.lang.String name)
      • getInputDescriptor

        public com.netscape.certsrv.property.IDescriptor getInputDescriptor​(java.lang.String name)
      • getInput

        public java.lang.String getInput​(java.lang.String name,
                                         java.util.Locale locale,
                                         com.netscape.certsrv.request.IRequest request)
                                  throws com.netscape.certsrv.profile.EProfileException
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • setInput

        public void setInput​(java.lang.String name,
                             java.util.Locale locale,
                             com.netscape.certsrv.request.IRequest request,
                             java.lang.String value)
                      throws com.netscape.certsrv.profile.EProfileException
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • getProfilePolicySetIds

        public java.util.Enumeration<java.lang.String> getProfilePolicySetIds()
        Returns the profile policy set identifiers.
        Returns:
        a list of policy set id
      • deleteProfilePolicy

        public void deleteProfilePolicy​(java.lang.String setId,
                                        java.lang.String policyId)
                                 throws com.netscape.certsrv.profile.EProfileException
        Deletes a policy.
        Parameters:
        setId - id of the policy set
        policyId - id of policy to delete
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to delete
      • deleteAllProfilePolicies

        public void deleteAllProfilePolicies()
                                      throws com.netscape.certsrv.profile.EProfileException
        Delete all profile policies
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • deleteProfileInput

        public void deleteProfileInput​(java.lang.String inputId)
                                throws com.netscape.certsrv.profile.EProfileException
        Deletes input policy by id.
        Parameters:
        inputId - id of the input policy
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to delete
      • deleteAllProfileInputs

        public void deleteAllProfileInputs()
                                    throws com.netscape.certsrv.profile.EProfileException
        Delete all profile inputs
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • deleteProfileOutput

        public void deleteProfileOutput​(java.lang.String outputId)
                                 throws com.netscape.certsrv.profile.EProfileException
        Deletes output policy by id.
        Parameters:
        outputId - id of the output policy
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to delete
      • deleteAllProfileOutputs

        public void deleteAllProfileOutputs()
                                     throws com.netscape.certsrv.profile.EProfileException
        Delete all profile inputs
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • createProfileOutput

        public ProfileOutput createProfileOutput​(java.lang.String id,
                                                 java.lang.String outputID,
                                                 com.netscape.certsrv.common.NameValuePairs nvps)
                                          throws com.netscape.certsrv.profile.EProfileException
        Creates a output policy.
        Parameters:
        id - output policy id
        outputID - id of the registered output implementation
        nvps - default parameters
        Returns:
        output policy
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to create
      • createProfileOutput

        public ProfileOutput createProfileOutput​(java.lang.String id,
                                                 java.lang.String outputId,
                                                 com.netscape.certsrv.common.NameValuePairs nvps,
                                                 boolean createConfig)
                                          throws com.netscape.certsrv.profile.EProfileException
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • createProfileInput

        public ProfileInput createProfileInput​(java.lang.String id,
                                               java.lang.String inputID,
                                               com.netscape.certsrv.common.NameValuePairs nvps)
                                        throws com.netscape.certsrv.profile.EProfileException
        Creates a input policy.
        Parameters:
        id - input policy id
        inputID - id of the registered input implementation
        nvps - default parameters
        Returns:
        input policy
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to create
      • createProfileInput

        public ProfileInput createProfileInput​(java.lang.String id,
                                               java.lang.String inputId,
                                               com.netscape.certsrv.common.NameValuePairs nvps,
                                               boolean createConfig)
                                        throws com.netscape.certsrv.profile.EProfileException
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • createProfilePolicy

        public ProfilePolicy createProfilePolicy​(java.lang.String setId,
                                                 java.lang.String id,
                                                 java.lang.String defaultClassId,
                                                 java.lang.String constraintClassId)
                                          throws com.netscape.certsrv.profile.EProfileException
        Creates a profile policy.
        Parameters:
        setId - id of the policy set that owns this policy
        id - policy id
        defaultClassId - id of the registered default implementation
        constraintClassId - id of the registered constraint implementation
        Returns:
        profile policy instance
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to create policy
      • createProfilePolicy

        public ProfilePolicy createProfilePolicy​(java.lang.String setId,
                                                 java.lang.String id,
                                                 java.lang.String defaultClassId,
                                                 java.lang.String constraintClassId,
                                                 boolean createConfig)
                                          throws com.netscape.certsrv.profile.EProfileException
        Throws:
        com.netscape.certsrv.profile.EProfileException
      • getProfilePolicy

        public ProfilePolicy getProfilePolicy​(java.lang.String setId,
                                              java.lang.String id)
        Retrieves a policy.
        Parameters:
        setId - set id
        id - policy id
        Returns:
        profile policy
      • isVisible

        public boolean isVisible()
        Checks if this profile is end-user profile or not. End-user profile will be displayed to the end user. Non end-user profile mainly is for registration manager.
        Returns:
        end-user profile or not
      • setVisible

        public void setVisible​(boolean v)
        Sets this profile end-user profile or not.
        Parameters:
        v - end-user profile or not
      • getName

        public java.lang.String getName​(java.util.Locale locale)
        Returns the profile name.
        Parameters:
        locale - end-user locale
        Returns:
        localized profile name
      • setName

        public void setName​(java.util.Locale locale,
                            java.lang.String name)
        Returns the profile name.
        Parameters:
        locale - end-user locale
        name - profile name
      • createRequests

        public abstract com.netscape.certsrv.request.IRequest[] createRequests​(java.util.Map<java.lang.String,​java.lang.String> ctx,
                                                                               java.util.Locale locale)
                                                                        throws java.lang.Exception
        Creates one or more requests. Normally, only one request will be created. In case of CRMF request, multiple requests may be created for one submission.
        Parameters:
        ctx - profile context
        locale - user locale
        Returns:
        a list of requests
        Throws:
        java.lang.Exception - failed to create requests
      • getDescription

        public java.lang.String getDescription​(java.util.Locale locale)
        Returns the profile description.
        Parameters:
        locale - end-user locale
        Returns:
        localized profile description
      • setDescription

        public void setDescription​(java.util.Locale locale,
                                   java.lang.String desc)
        Returns the profile description.
        Parameters:
        locale - end-user locale
        desc - profile description
      • populateInput

        public void populateInput​(java.util.Map<java.lang.String,​java.lang.String> ctx,
                                  com.netscape.certsrv.request.IRequest request)
                           throws java.lang.Exception
        Populates user-supplied input values into the requests.
        Parameters:
        ctx - profile context
        request - request
        Throws:
        java.lang.Exception - failed to populate
      • getPolicies

        public java.util.Vector<ProfilePolicy> getPolicies​(java.lang.String setId)
      • getPolicySetId

        public abstract java.lang.String getPolicySetId​(com.netscape.certsrv.request.IRequest req)
        Retrieves a default set id for the given request. It is the profile's responsibility to return an appropriate set id for the request.
        Parameters:
        req - request
        Returns:
        policy set id
      • populate

        public void populate​(com.netscape.certsrv.request.IRequest request)
                      throws com.netscape.certsrv.profile.EProfileException
        Passes the request to the set of default policies that populate the profile information against the profile.
        Parameters:
        request - request
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to populate default values
      • validate

        public void validate​(com.netscape.certsrv.request.IRequest request)
                      throws com.netscape.certsrv.profile.ERejectException
        Passes the request to the set of constraint policies that validate the request against the profile.
        Parameters:
        request - request
        Throws:
        com.netscape.certsrv.profile.ERejectException - validation violation
      • getProfilePolicies

        public java.util.Enumeration<ProfilePolicy> getProfilePolicies​(java.lang.String setId)
        Returns a list of profile policies.
        Parameters:
        setId - set id
        Returns:
        a list of policies
      • getProfilePolicyIds

        public java.util.Enumeration<java.lang.String> getProfilePolicyIds​(java.lang.String setId)
        Retrieves all the policy id within a set.
        Parameters:
        setId - set id
        Returns:
        a list of policy id
      • execute

        public void execute​(com.netscape.certsrv.request.IRequest request)
                     throws com.netscape.certsrv.profile.EProfileException
        Process a request after validation.
        Parameters:
        request - request to be processed
        Throws:
        com.netscape.certsrv.profile.EProfileException - failed to process
      • submit

        public abstract void submit​(com.netscape.certsrv.authentication.IAuthToken token,
                                    com.netscape.certsrv.request.IRequest request)
                             throws com.netscape.certsrv.profile.EDeferException,
                                    com.netscape.certsrv.profile.EProfileException
        Handles end-user request submission.
        Parameters:
        token - authentication token
        request - request to be processed
        Throws:
        com.netscape.certsrv.profile.EDeferException - defer request
        com.netscape.certsrv.profile.EProfileException - failed to submit
      • auditSubjectID

        protected java.lang.String auditSubjectID()
        Signed Audit Log Subject ID This method is used to obtain the "SubjectID" for a signed audit log message.

        Returns:
        id string containing the signed audit log message SubjectID