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.

    • 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​(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
      • 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 IDescriptor getInputDescriptor​(java.lang.String name)
      • 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 EProfileException
        Deletes a policy.
        Parameters:
        setId - id of the policy set
        policyId - id of policy to delete
        Throws:
        EProfileException - failed to delete
      • deleteProfileInput

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

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

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

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

        public ProfilePolicy createProfilePolicy​(java.lang.String setId,
                                                 java.lang.String id,
                                                 java.lang.String defaultClassId,
                                                 java.lang.String constraintClassId)
                                          throws 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:
        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 EProfileException
        Throws:
        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 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,
                                  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​(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​(IRequest request)
                      throws EProfileException
        Passes the request to the set of default policies that populate the profile information against the profile.
        Parameters:
        request - request
        Throws:
        EProfileException - failed to populate default values
      • validate

        public void validate​(IRequest request)
                      throws ERejectException
        Passes the request to the set of constraint policies that validate the request against the profile.
        Parameters:
        request - request
        Throws:
        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
      • 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