Class Profile

java.lang.Object
com.netscape.cms.profile.common.Profile
Direct Known Subclasses:
EnrollProfile

public abstract class Profile extends 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 Details

  • Constructor Details

    • Profile

      public Profile()
  • Method Details

    • isEnable

      public boolean isEnable()
    • isRenewal

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

      public void setRenewal(boolean renewal)
    • isXmlOutput

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

      public void setXMLOutput(boolean xmlOutput)
    • getApprovedBy

      public 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(String id)
      Sets id of this profile.
      Parameters:
      id - profile identifier
    • getId

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

      public String getRequestorDN(Request 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 String getAuthenticatorId()
      Retrieves the instance id of the authenticator for this profile.
      Returns:
      authenticator instance id
    • setAuthenticatorId

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

      public void setAuthzAcl(String id)
    • getAuthzAcl

      public String getAuthzAcl()
    • init

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

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

      public Enumeration<String> getInputNames()
    • getProfileUpdaterIds

      public Enumeration<String> getProfileUpdaterIds()
    • getProfileUpdater

      public IProfileUpdater getProfileUpdater(String name)
    • getProfileOutputIds

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

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

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

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

      public void addInputName(String name)
    • getProfilePolicySetIds

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

      public void deleteProfilePolicy(String setId, 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
    • deleteAllProfilePolicies

      public void deleteAllProfilePolicies() throws EProfileException
      Delete all profile policies
      Throws:
      EProfileException
    • deleteProfileInput

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

      public void deleteAllProfileInputs() throws EProfileException
      Delete all profile inputs
      Throws:
      EProfileException
    • deleteProfileOutput

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

      public void deleteAllProfileOutputs() throws EProfileException
      Delete all profile inputs
      Throws:
      EProfileException
    • createProfileOutput

      public ProfileOutput createProfileOutput(String id, 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
    • createProfileOutput

      public ProfileOutput createProfileOutput(String id, String outputId, NameValuePairs nvps, boolean createConfig) throws EProfileException
      Throws:
      EProfileException
    • createProfileInput

      public ProfileInput createProfileInput(String id, 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
    • createProfileInput

      public ProfileInput createProfileInput(String id, String inputId, NameValuePairs nvps, boolean createConfig) throws EProfileException
      Throws:
      EProfileException
    • createProfilePolicy

      public ProfilePolicy createProfilePolicy(String setId, String id, String defaultClassId, 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(String setId, String id, String defaultClassId, String constraintClassId, boolean createConfig) throws EProfileException
      Throws:
      EProfileException
    • getProfilePolicy

      public ProfilePolicy getProfilePolicy(String setId, 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 String getName(Locale locale)
      Returns the profile name.
      Parameters:
      locale - end-user locale
      Returns:
      localized profile name
    • setName

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

      public abstract Request[] createRequests(Map<String,String> ctx, Locale locale) throws 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:
      Exception - failed to create requests
    • getDescription

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

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

      public void populateInput(Map<String,String> ctx, Request request) throws Exception
      Populates user-supplied input values into the requests.
      Parameters:
      ctx - profile context
      request - request
      Throws:
      Exception - failed to populate
    • getPolicies

      public Vector<ProfilePolicy> getPolicies(String setId)
    • getPolicySetId

      public abstract String getPolicySetId(Request 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(Request 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(Request 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 Enumeration<ProfilePolicy> getProfilePolicies(String setId)
      Returns a list of profile policies.
      Parameters:
      setId - set id
      Returns:
      a list of policies
    • getProfilePolicyIds

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

      public void execute(Request request) throws EProfileException
      Process a request after validation.
      Parameters:
      request - request to be processed
      Throws:
      EProfileException - failed to process
    • submit

      public abstract void submit(IAuthToken token, Request request) throws EDeferException, EProfileException
      Handles end-user request submission.
      Parameters:
      token - authentication token
      request - request to be processed
      Throws:
      EDeferException - defer request
      EProfileException - failed to submit
    • submit

      public abstract void submit(IAuthToken token, Request request, boolean explicitApprovalRequired) throws EDeferException, EProfileException
      Throws:
      EDeferException
      EProfileException
    • auditSubjectID

      protected 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