Package com.netscape.cms.profile.common
Class Profile
java.lang.Object
com.netscape.cms.profile.common.Profile
- Direct Known Subclasses:
EnrollProfile
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 Summary
FieldsModifier and TypeFieldDescriptionstatic org.slf4j.Logger
protected String
protected String
protected IConfigStore
protected String
protected Hashtable
<String, ProfileInput> protected Hashtable
<String, ProfileOutput> protected Hashtable
<String, Vector<ProfilePolicy>> protected Hashtable
<String, IProfileUpdater> static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected PluginRegistry
protected static Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInputName
(String name) protected String
Signed Audit Log Subject ID This method is used to obtain the "SubjectID" for a signed audit log message.createProfileInput
(String id, String inputID, NameValuePairs nvps) Creates a input policy.createProfileInput
(String id, String inputId, NameValuePairs nvps, boolean createConfig) createProfileOutput
(String id, String outputID, NameValuePairs nvps) Creates a output policy.createProfileOutput
(String id, String outputId, NameValuePairs nvps, boolean createConfig) createProfilePolicy
(String setId, String id, String defaultClassId, String constraintClassId) Creates a profile policy.createProfilePolicy
(String setId, String id, String defaultClassId, String constraintClassId, boolean createConfig) abstract IRequest[]
createRequests
(Map<String, String> ctx, Locale locale) Creates one or more requests.void
Delete all profile inputsvoid
Delete all profile inputsvoid
Delete all profile policiesvoid
deleteProfileInput
(String inputId) Deletes input policy by id.void
deleteProfileOutput
(String outputId) Deletes output policy by id.void
deleteProfilePolicy
(String setId, String policyId) Deletes a policy.void
Process a request after validation.Retrieves the user id of the person who approves this profile.Retrieves the instance id of the authenticator for this profile.Retrieves the configuration store of this profile.getDescription
(Locale locale) Returns the profile description.getId()
Returns the identifier of this profile.getInputDescriptor
(String name) Returns the profile name.getPolicies
(String setId) abstract String
getPolicySetId
(IRequest req) Retrieves a default set id for the given request.Retrieves input policy by id.Retrieves a list of input policy IDs.Retrieves output policy by id.Retrieves a list of output policy IDs.getProfilePolicies
(String setId) Returns a list of profile policies.getProfilePolicy
(String setId, String id) Retrieves a policy.getProfilePolicyIds
(String setId) Retrieves all the policy id within a set.Returns the profile policy set identifiers.getProfileUpdater
(String name) getRequestorDN
(IRequest request) Retrieves a localized string that represents requestor's distinguished name.void
init
(IConfigStore config) Initializes this profile.boolean
isEnable()
Is this a renewal profileboolean
Checks if this profile is end-user profile or not.is output going to be in xml?void
Passes the request to the set of default policies that populate the profile information against the profile.void
populateInput
(Map<String, String> ctx, IRequest request) Populates user-supplied input values into the requests.void
Sets the instance id of the authenticator for this profile.void
setAuthzAcl
(String id) void
setDescription
(Locale locale, String desc) Returns the profile description.void
Sets id of this profile.void
void
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
(IAuthToken token, IRequest request) Handles end-user request submission.abstract void
submit
(IAuthToken token, IRequest request, boolean explicitApprovalRequired) void
Passes the request to the set of constraint policies that validate the request against the profile.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
signedAuditLogger
-
PROP_ENABLE
- See Also:
-
PROP_ENABLE_BY
- See Also:
-
PROP_IS_RENEWAL
- See Also:
-
PROP_XML_OUTPUT
- See Also:
-
PROP_VISIBLE
- See Also:
-
PROP_INPUT_LIST
- See Also:
-
PROP_OUTPUT_LIST
- See Also:
-
PROP_UPDATER_LIST
- See Also:
-
PROP_POLICY_LIST
- See Also:
-
PROP_DEFAULT
- See Also:
-
PROP_CONSTRAINT
- See Also:
-
PROP_INPUT
- See Also:
-
PROP_OUTPUT
- See Also:
-
PROP_CLASS_ID
- See Also:
-
PROP_INSTANCE_ID
- See Also:
-
PROP_PARAMS
- See Also:
-
PROP_NAME
- See Also:
-
PROP_DESC
- See Also:
-
PROP_NO_DEFAULT
- See Also:
-
PROP_NO_CONSTRAINT
- See Also:
-
PROP_GENERIC_EXT_DEFAULT
- See Also:
-
mConfig
-
registry
-
mInputNames
-
mInputs
-
mInputIds
-
mOutputs
-
mOutputIds
-
mUpdaters
-
mUpdaterIds
-
mAuthInstanceId
-
mId
-
mAuthzAcl
-
mPolicySet
-
-
Constructor Details
-
Profile
public Profile()
-
-
Method Details
-
isEnable
public boolean isEnable() -
isRenewal
Is this a renewal profile -
setRenewal
public void setRenewal(boolean renewal) -
isXmlOutput
is output going to be in xml? -
setXMLOutput
public void setXMLOutput(boolean xmlOutput) -
getApprovedBy
Retrieves the user id of the person who approves this profile.- Returns:
- user id of the approver of this profile
-
setId
-
getId
-
getRequestorDN
-
getAuthenticatorId
Retrieves the instance id of the authenticator for this profile.- Returns:
- authenticator instance id
-
setAuthenticatorId
Sets the instance id of the authenticator for this profile.- Parameters:
id
- authenticator instance id
-
setAuthzAcl
-
getAuthzAcl
-
init
Initializes this profile.- Parameters:
config
- configuration store for this profile- Throws:
EBaseException
- failed to initialize
-
getConfigStore
Retrieves the configuration store of this profile.- Returns:
- configuration store
-
getInputNames
-
getProfileUpdaterIds
-
getProfileUpdater
-
getProfileOutputIds
Retrieves a list of output policy IDs.- Returns:
- output policy id list
-
getProfileOutput
Retrieves output policy by id.- Parameters:
id
- output policy id- Returns:
- output policy instance
-
getProfileInputIds
Retrieves a list of input policy IDs.- Returns:
- input policy id list
-
getProfileInput
Retrieves input policy by id.- Parameters:
id
- input policy id- Returns:
- input policy instance
-
addInputName
-
getInputDescriptor
-
getInput
- Throws:
EProfileException
-
setInput
public void setInput(String name, Locale locale, IRequest request, String value) throws EProfileException - Throws:
EProfileException
-
getProfilePolicySetIds
Returns the profile policy set identifiers.- Returns:
- a list of policy set id
-
deleteProfilePolicy
Deletes a policy.- Parameters:
setId
- id of the policy setpolicyId
- id of policy to delete- Throws:
EProfileException
- failed to delete
-
deleteAllProfilePolicies
Delete all profile policies- Throws:
EProfileException
-
deleteProfileInput
Deletes input policy by id.- Parameters:
inputId
- id of the input policy- Throws:
EProfileException
- failed to delete
-
deleteAllProfileInputs
Delete all profile inputs- Throws:
EProfileException
-
deleteProfileOutput
Deletes output policy by id.- Parameters:
outputId
- id of the output policy- Throws:
EProfileException
- failed to delete
-
deleteAllProfileOutputs
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 idoutputID
- id of the registered output implementationnvps
- 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 idinputID
- id of the registered input implementationnvps
- 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 policyid
- policy iddefaultClassId
- id of the registered default implementationconstraintClassId
- 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
Retrieves a policy.- Parameters:
setId
- set idid
- 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
-
setName
-
createRequests
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 contextlocale
- user locale- Returns:
- a list of requests
- Throws:
Exception
- failed to create requests
-
getDescription
-
setDescription
-
populateInput
-
getPolicies
-
getPolicySetId
-
populate
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
Passes the request to the set of constraint policies that validate the request against the profile.- Parameters:
request
- request- Throws:
ERejectException
- validation violation
-
getProfilePolicies
Returns a list of profile policies.- Parameters:
setId
- set id- Returns:
- a list of policies
-
getProfilePolicyIds
Retrieves all the policy id within a set.- Parameters:
setId
- set id- Returns:
- a list of policy id
-
execute
Process a request after validation.- Parameters:
request
- request to be processed- Throws:
EProfileException
- failed to process
-
submit
public abstract void submit(IAuthToken token, IRequest request) throws EDeferException, EProfileException Handles end-user request submission.- Parameters:
token
- authentication tokenrequest
- request to be processed- Throws:
EDeferException
- defer requestEProfileException
- failed to submit
-
submit
public abstract void submit(IAuthToken token, IRequest request, boolean explicitApprovalRequired) throws EDeferException, EProfileException - Throws:
EDeferException
EProfileException
-
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
-